Overview

1 What are LLM Agents and Multi-Agent Systems?

Large language models can describe what they intend to do, but by themselves they cannot actually carry out actions in the world. The chapter introduces LLM agents as the orchestration layer that turns those intentions into real work by managing tool calls, passing results back into the model, and repeating this process until a task is complete. It also explains why this matters in practice: modern agents become far more useful when they can search the web, query knowledge bases, run code, or control software and even operating systems.

To make this concrete, the chapter surveys common use cases such as report generation, web search and deep research, retrieval-augmented generation, coding assistance, and computer-use personal assistants. It then defines an LLM agent as an autonomous system built around a backbone LLM and tools, and shows that the backbone model needs two key capabilities to be effective: planning and tool calling. The processing loop is the core mechanism that ties these together, letting the agent form an initial plan, take actions, inspect results, revise its approach, and continue until the task is done, while optionally involving memory or humans to improve quality and reduce errors.

The chapter also broadens the view from single agents to multi-agent systems, where multiple specialized agents collaborate to handle larger or more complex tasks, sometimes through subagents or interoperable protocols. It highlights important standards and patterns such as MCP for tool and resource access, Agent Skills for reusable workflows, and A2A for agent-to-agent communication, along with design enhancements like memory and human-in-the-loop review. Finally, it lays out the book’s educational goal: to build an entire LLM agent framework from scratch, learning the underlying mechanics of tools, models, memory, skills, subagents, and multi-agent coordination by implementing them directly.

The applications for LLM agents are many, including agentic RAG, report generation, deep search and computer use, all of which can benefit from MAS.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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 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 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.
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
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 standard that originated from Anthropic that standardizes how reusable workflows are documented and used by LLM agents
  • In one form of MAS, subagents can be dispatched by an LLM agent to work on subtasks that contribute to the overall task execution
  • A2A is a protocol introduced 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 for a user.
Why isn’t an LLM by itself considered an agent?Because an LLM can generate text and express intent, but it cannot actually execute actions on its own. It needs an orchestration system to carry out tool calls and task steps.
How do LLM agents turn an LLM’s intent into action?They use tool-calling and a processing loop. The LLM generates a plan or tool-call request, the system executes the requested tool, and the results are sent back to the LLM for the next step.
What are the two key LLM capabilities needed for an effective LLM agent?Planning and tool calling. The backbone LLM must be able to choose sensible next steps and generate structured requests to use tools appropriately.
What is the processing loop of an LLM agent?It is the repeated cycle in which the agent plans, makes tool calls, receives results, adapts its plan, and continues until the task is completed or a stopping condition is reached.
When are multi-agent systems useful?Multi-agent systems are useful when a task can be broken into smaller subtasks, when parallelization improves speed or scale, or when specialized agents can do parts of the work better than one general-purpose agent.
What is a common way to design a multi-agent system?A common pattern is to use a coordinator agent that dispatches subtasks to subagents, then combines their outputs into the final result.
What role does memory play in an LLM agent?Memory lets an agent save useful information from past tasks, such as trajectories or tool results, and load that information later to avoid repeating work and improve future performance.
Why would you use a human-in-the-loop pattern with an LLM agent?To reduce the risk of cascading errors and to let a human review or approve important plans and results, especially when accuracy matters more than speed.
What protocols are important for building modern LLM agents and multi-agent systems?MCP for accessing third-party tools and resources, Agent Skills for reusable workflows, and A2A for standardized agent-to-agent communication in interoperable multi-agent systems.

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


Close
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) Build a Multi-Agent System (from Scratch) ebook for free
Close
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) Build a Multi-Agent System (from Scratch) ebook for free