Overview

1 What are LLM Agents and Multi-Agent Systems?

This chapter introduces the central idea that large language models can describe plans and intentions, but they cannot actually carry out actions on their own. To bridge that gap, LLM agents wrap a model in an orchestration system that turns tool requests and plans into real actions, allowing the model to search, compute, browse, code, and interact with software on a user’s behalf. The chapter emphasizes that modern agents become far more capable when they are equipped with tools, third-party resources, and standards such as MCP for tool access and A2A for agent-to-agent communication.

The chapter also surveys where these systems are already useful in practice: report generation, web and deep search, retrieval-augmented generation, coding assistants, and computer-use automation. In each case, the agent repeatedly follows a processing loop in which it plans a next step, calls a tool, reviews the result, and either adapts or finishes. It explains that effective agents depend on backbone models with strong planning and tool-calling abilities, and that features such as memory and human oversight can improve reliability, reduce repeated work, and prevent cascading mistakes.

Finally, the chapter frames multi-agent systems as collections of specialized LLM agents that collaborate on larger tasks by dividing labor according to strengths and responsibilities. It notes that these systems can outperform a single general-purpose agent when a problem can be broken into smaller subproblems, though they also introduce new coordination challenges. The rest of the book is positioned as a hands-on journey: building an LLM agent framework from scratch, adding tools, memory, protocols, and human-in-the-loop controls, and then extending the result into multi-agent collaboration.

The applications for LLM agents are many, including agentic RAG, report generation, deep search and computer use, all of which can benefit from MAS.
An LLM agent is comprised of a backbone LLM and its equipped tools.
LLM agents utilize the planning capability of backbone LLMs to formulate initial plans for tasks, as well as to adapt current plans based on the results of past steps or actions taken towards task completion.
An illustration of the tool-equipping process, where a textual description of the tool that contains the tool’s name, description and its parameters is provided to the LLM agent.
The tool-calling process, where any equipped tool can be used.
A mental model of an LLM agent performing a task through its processing loop, where tool calling and planning are used repeatedly. The task is executed through a series of sub-steps, a typical approach for performing tasks.
An LLM agent that has access to memory modules where it can store key information of task executions and load this back into its context for future tasks.
A mental model of the LLM agent processing loop that has memory modules for saving and loading important information obtained during task execution.
An LLM agent processing loop with access to human operators. The processing loop is effectively paused each time a human operator is required to provide input.
Multiple LLM agents collaborating to complete an overarching task. The outcomes of each LLM agent’s processing loop are combined to form the overall task result.
The difference between LLM agent framework developers and application developers
A first look at the llm-agents-from-scratch framework that we’ll build together.
A simple UML class diagram that shows two classes from the llm-agents-from-scratch framework. The BaseTool class lives in the base module, while the ToolCallResult lives in the data_structures module. The attributes and methods of both classes are indicated in their respective class diagrams and the relation between them is also described.
A UML sequence diagram that illustrates how the flow of a tool call. First, an LLM agent prepares a ToolCall object and invokes the BaseTool, which initiates the processing of the tool call. Once completed, the BaseTool class constructs a ToolCallResult which then gets sent back to the LLM agent.
The build plan for our llm-agents-from-scratch framework

Summary

  • LLMs have become very powerful text generators that have been applied successfully to tasks like text summarization, question-answering, and text classification, but they have a critical limitation in that they cannot act; they can only express an intent to act (such as making a tool call) through text. That’s where LLM agents come in to bring in the ability to carry out the intended actions.
  • Applications for LLM agents are many, such as report generation, deep research, computer use and coding.
  • With MAS, individual LLM agents collaborate to collectively perform tasks.
  • Many applications for LLM agents can further benefit from MAS. In principle, MAS excel when complex tasks can be decomposed into smaller subtasks, where specialized LLM agents outperform general-purpose LLM agents.
  • LLM agents are systems comprised of an LLM and tools that can act autonomously to perform tasks.
  • LLM agents use a processing loop to execute tasks. Tool calling and planning capabilities are key components of that processing loop.
  • Protocols like MCP, Agent Skills, and A2A have helped to create a vibrant LLM agent ecosystem that is powering the growth of LLM agents and their applications.
  • MCP is a protocol developed by Anthropic that has paved the way for LLM agents to use third-party provided tools.
  • Agent Skills is another protocol that originated from Anthropic that standardizes how reusable workflows are documented and used by LLM agents
  • A2A is a protocol developed by Google to standardize agent-to-agent interactions in MAS.
  • In this book, we’ll primarily be framework developers, building our own LLM agent framework to learn the internals of LLM agents more deeply.
  • Supplementary materials in the form of additional example notebooks and capstone projects are provided in the book’s GitHub repository to deepen your learning.

FAQ

What is an LLM agent?An LLM agent is an autonomous system made up of a backbone LLM and tools that can act on the LLM’s tool-call requests and plans to perform tasks on behalf of a user.
Why are LLMs alone not enough to act as agents?LLMs can generate text and express intent or plan actions, but they cannot actually execute those actions by themselves. They need an orchestration system around them to process tool calls and carry out the intended steps.
What is tool calling in an LLM agent?Tool calling is the process where an LLM generates a structured request, often in JSON, to invoke an equipped tool with specific parameters. The agent then executes the tool and sends the result back to the LLM for synthesis.
What kinds of real-world applications use LLM agents?Common applications include report generation, web search and deep research, agentic RAG, coding assistants, and computer-use systems that can interact with browsers or other software.
When is a multi-agent system useful?A multi-agent system is useful when a task can be broken into smaller sub-tasks that are better handled by specialized agents. This is especially helpful for complex workflows like research, reporting, or full-stack coding.
What is the role of planning in an LLM agent?Planning helps the agent decide what to do next, both at the start of a task and throughout execution. Good planning allows the agent to adapt its strategy based on previous steps and course-correct when needed.
What are some important enhancements for LLM agents?Two major enhancements are memory and human-in-the-loop. Memory lets agents reuse useful information from past tasks, while human-in-the-loop allows humans to review, approve, or correct plans and results.
What is MCP and why is it important?MCP, or Model Context Protocol, is a standard for connecting LLM agents to third-party tools and other resources. It expands what agents can do by making it easier to integrate external capabilities in a consistent way.
What is A2A in the context of multi-agent systems?A2A, or Agent2Agent Protocol, is a standard for communication between agents. It allows agents built with different frameworks to collaborate within a multi-agent system.
Why is this book building an LLM agent framework from scratch?The book builds the framework from scratch to show how LLM agents and multi-agent systems work under the hood. This deeper understanding helps readers use existing frameworks more confidently and build specialized solutions when needed.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Build a Multi-Agent System (from Scratch) ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Build a Multi-Agent System (from Scratch) ebook for free