# LLM Agents From Scratch

A companion code library for a Manning book that teaches how LLM agents and multi-agent systems work by building one from first principles, without relying on an existing framework.

LLM Agents From Scratch is the companion library for the book Build a Multi-Agent System, With MCP and A2A, available through Manning's Early Access Program. Rather than teaching an existing agent framework, the book has readers build their own, hand-rolled agent framework step by step, primarily for educational understanding rather than production use.

The first part covers building a first LLM agent, including working with tools and language models and writing the core agent class; the second part adds MCP tools, skills, memory, and human-in-the-loop review; and the third part assembles multi-agent systems, including interoperable systems that communicate over A2A. Capstone projects apply the material to larger examples, such as orchestrating parallel tool calls to estimate pi by Monte Carlo methods. The included notebooks default to running a 14-billion-parameter open model locally through Ollama, recommending at least 16 GB of RAM and a discrete GPU.

Website: https://masfromscratch.com/
