Chapter 1: What are LLM Agents and Multi-Agent Systems?
Introduces how LLM agents turn generated intentions into actions through tool-calling and how multiple agents can collaborate in a system.
After this chapter you will be able to
- LLM and agent roles. Explain why an LLM alone cannot carry out its stated intentions and what an LLM agent adds.
- Tool calling and execution. Trace the introductory tool-calling exchange between an LLM, the application, and the agent.
- Multi-agent collaboration and connectivity. Describe how agents collaborate in a multi-agent system, including the roles of subagents and A2A.
- Benefits of multiple agents. Explain how parallel work and task decomposition can make a multi-agent system useful compared with a single agent.
- LLM report generation. Explain the main stages of report generation and why LLM agents are suited to the task.
- Multi-agent report fact-checking. Describe how a multi-agent system can divide report work and use a specialized agent to scrutinize findings.
- Deep Research Orchestration. Explain how deep research extends web search through a sequence of research and reporting activities.
- Multi Agent Research Arrangements. Describe two ways to assign deep research work to multiple agents.
- Agentic RAG retrieval. Explain how an agentic RAG system uses knowledge stores to answer user queries.
- Specialized retrieval agents. Describe how a multi-agent system can use specialized retrieval agents for different knowledge bases.
- Changing Developer Roles. Explain how coding agents are changing the work of human software developers.
- Delegation to Coding Subagents. Describe how a main coding agent can delegate tasks to subagents and why they receive separate sessions and Git worktrees.
- Scaling Infrastructure and Review. Explain the infrastructure and review pressures created by agent-produced code and describe an agent-assisted review approach.
- Computer Use for Assistance. Explain how computer-use permissions enable LLM agents to perform everyday personal-assistant tasks.
- LLM Agent Composition. Explain how an LLM agent combines a backbone LLM and tools to perform tasks, and why the LLM alone is not an agent.
- Initial and adaptive planning. Explain how a backbone LLM plans at the start of a task and adapts its plan as execution proceeds.
- Tool calling process. Trace how an LLM is equipped with a tool and how a tool-call request leads to a result the LLM can use.
- Processing loop execution. Explain how the framework’s processing loop carries a submitted task through successive steps, from initial planning to completion or a stopping condition.
- Trajectory and action inspection. Describe what an agent trajectory records and how it or conversation with the agent can help inspect task execution.
- Memory in task execution. Explain how memory lets an agent reuse information from past tasks, and describe the section’s example of memory use in the processing loop.
- Human review and errors. Explain how human involvement can reduce cascading errors and describe ways a human can intervene in the agent’s task execution.
- Human involvement trade-off. Explain why deciding whether to involve a human requires balancing accuracy against execution time.
- MCP resource integration. Explain what MCP standardizes for LLM agent applications and how it supports an ecosystem of compatible resources.
- Agent Skills open standard. Describe what Agent Skills standardizes and why skills can be shared across agent clients.
- A2A agent interoperability. Explain A2A’s role in agent communication and its potential benefit for multi-agent systems.
- LLM and RL agents. Distinguish LLM agents from reinforcement learning agents in their objectives and setups.
- Coordinated Subagent Collaboration. Explain how a coordinator and specialized subagents can complete an overarching task together.
- Remote Agent Interoperability. Explain how remote A2A agents can participate in a MAS and what makes such a system interoperable.
- Educational framework rationale. Explain why the book builds its own framework rather than relying solely on existing ones, and distinguish its educational focus from production optimization.
- Framework module organization. Describe how the framework separates foundational definitions, agent functionality, and supporting or multi-agent capabilities into modules.
- Repository resources and participation. Describe what the book’s GitHub repository contains and how readers can participate in it.
- Framework listing placement. Explain what the book’s code listings contribute to the framework and how to find where to save their code.
- Purpose of Code Snippets. Explain how code snippets demonstrate the framework and how they differ from code intended for the framework’s source files.
- Chapter Example Notebooks. Describe where to find each chapter’s code snippets and what the notebooks allow readers to do.
- Examples and Capstone Projects. Distinguish the chapter-end examples and exercises from capstone projects by their scope and purpose.
- Chapter notebook setup. Describe how to prepare for and launch the chapter notebooks, including the role of uv.
- Ollama Cloud Model Choice. Explain why the book recommends Ollama cloud models and what is needed to use them.
- Local Ollama Setup. Describe how to prepare a local Ollama model before running the notebooks.
- Class diagram structure. Explain what a UML class diagram shows, using the BaseTool and ToolCallResult example.
- Sequence diagram notation. Describe how a UML sequence diagram represents participants, lifelines, messages, self-messages, and processing duration.
Section by section
Introduction
Introduces how LLM agents turn generated intentions into actions through tool-calling and how multiple agents can collaborate in a system.
- LLM and agent roles: Explain why an LLM alone cannot carry out its stated intentions and what an LLM agent adds.
Why it matters: This distinction explains why an agent is more than an LLM saying what it intends to do. - Tool calling and execution: Trace the introductory tool-calling exchange between an LLM, the application, and the agent.
Why it matters: This exchange shows how a text-generating model can use external capabilities without executing them itself. - Multi-agent collaboration and connectivity: Describe how agents collaborate in a multi-agent system, including the roles of subagents and A2A.
Why it matters: This distinction shows how a system can divide work among agents and connect agents built with different frameworks.
Key terms: LLM agents, orchestration systems, tool-calling, tool-call request, multi-agent systems, MAS, subagents, local agents, Agent2Agent, A2A
1.1 Where LLM agents and multi-agent systems are useful
This section explains why multi-agent systems can be useful for tasks handled by LLM agents.
- Benefits of multiple agents: Explain how parallel work and task decomposition can make a multi-agent system useful compared with a single agent.
Why it matters: These benefits help explain when using multiple agents may be worthwhile.
Key terms: multi-agent systems, parallelization, subtasks, focused LLM agents
1.1.1 Report generation
This section explains how LLM agents can generate reports and how multiple agents can divide and fact-check the work.
- LLM report generation: Explain the main stages of report generation and why LLM agents are suited to the task.
Why it matters: This shows why producing structured reports is a useful application for LLM agents. - Multi-agent report fact-checking: Describe how a multi-agent system can divide report work and use a specialized agent to scrutinize findings.
Why it matters: Dividing work and scrutinizing findings illustrates how multiple agents can contribute different roles to a report.
Key terms: report generation, synthesizing, structured output format, MAS, fact-checker LLM agent, hallucinations, backbone LLM
1.1.2 Web search and deep search
This section describes web search and deep research as LLM agent applications and outlines ways to distribute research across multiple agents.
- Agent Based Web Search: Describe how LLM agents can perform searches for general user queries.
Why it matters: This establishes web search as a practical application of LLM agents. - Deep Research Orchestration: Explain how deep research extends web search through a sequence of research and reporting activities.
Why it matters: This shows how a search application can produce a synthesized report rather than just perform a search. - Multi Agent Research Arrangements: Describe two ways to assign deep research work to multiple agents.
Why it matters: These arrangements illustrate how agents can divide research work and combine their findings.
Key terms: LLM agents, web search tools, enhanced reasoning, deep research, multi-step orchestration, synthesis, report generation, MAS, orchestration steps, deep search agents
1.1.3 Search and retrieval agents
This section describes how agents retrieve information from knowledge bases, specialize across them, and help maintain them.
- Agentic RAG retrieval: Explain how an agentic RAG system uses knowledge stores to answer user queries.
Why it matters: This connects agent tool use to answering questions with stored organizational information. - Specialized retrieval agents: Describe how a multi-agent system can use specialized retrieval agents for different knowledge bases.
Why it matters: Specialization lets a multi-agent system direct a question to the agents associated with relevant sources. - Knowledge base maintenance: Describe the role agents can play in maintaining knowledge bases.
Why it matters: Retrieval agents can also help keep the information they use up to date.
Key terms: retrieval-augmented generation, RAG, agentic RAG, knowledge stores, MAS, knowledge base, search and retrieval agent, routed, knowledge bases, update knowledge
1.1.4 Coding LLM agents
This section describes how coding agents change developers’ roles, distribute coding tasks, and create challenges for development infrastructure and code review.
- Changing Developer Roles: Explain how coding agents are changing the work of human software developers.
Why it matters: This shift helps explain how agents change the developer’s contribution to software projects. - Delegation to Coding Subagents: Describe how a main coding agent can delegate tasks to subagents and why they receive separate sessions and Git worktrees.
Why it matters: Delegation lets a coding harness divide development work while keeping subagents’ work separate. - Scaling Infrastructure and Review: Explain the infrastructure and review pressures created by agent-produced code and describe an agent-assisted review approach.
Why it matters: Producing code faster also means teams need ways to manage and review the increased output safely.
Key terms: LLM agents, design, architecture, subagents, session, Git worktree, harness, version control, code review, multiple providers
1.1.5 Computer use for personal assistants
This section explains how computer-use permissions enable LLM agents to act as flexible personal assistants and contrasts them with traditional rules-based automation.
- Computer Use for Assistance: Explain how computer-use permissions enable LLM agents to perform everyday personal-assistant tasks.
Why it matters: Computer access expands an agent’s usefulness from generating responses to carrying out everyday tasks. - Contrast with Traditional RPA: Distinguish computer-use LLM agents from traditional robotic process automation in their approach to decisions and adaptation.
Why it matters: The distinction explains why computer-use agents can be viewed as a more flexible form of automation.
Key terms: computer use, personal assistants, tools, Robotic Process Automation, RPA, reasoning
1.2 What is an LLM agent?
This section defines an LLM agent as a system that combines a backbone LLM with tools to act autonomously on a user's behalf.
- LLM Agent Composition: Explain how an LLM agent combines a backbone LLM and tools to perform tasks, and why the LLM alone is not an agent.
Why it matters: This distinction helps explain what must be built around an LLM for it to act as an agent.
Key terms: LLM agent, backbone LLM, tools, tool-call requests, plans, autonomous system
1.2.1 Prerequisite LLM capabilities
This section explains the planning and tool-calling capabilities a backbone LLM needs to help an agent execute tasks.
- Initial and adaptive planning: Explain how a backbone LLM plans at the start of a task and adapts its plan as execution proceeds.
Why it matters: Planning lets an agent choose and revise its approach rather than following a fixed initial plan blindly. - Chain of thought and reasoning: Distinguish chain-of-thought prompting and reasoning LLMs from the planning capability used by an agent.
Why it matters: This distinction helps you relate reasoning-oriented models to agent planning without treating the terms as interchangeable. - Tool calling process: Trace how an LLM is equipped with a tool and how a tool-call request leads to a result the LLM can use.
Why it matters: This sequence separates the LLM's request from tool execution and shows how the result becomes useful to the agent. - Tool calling training: Describe how supervised fine-tuning can teach an LLM to make appropriate tool-call requests.
Why it matters: A backbone LLM must be able to produce usable tool requests when a task calls for them.
Key terms: backbone LLM, planning, processing loop, Chain-of-Thought, few-shot exemplars, reasoning LLMs, tool equipping, tool-call request, tool identifier, parameters
1.3 The processing loop
This section explains how an LLM agent uses a processing loop to carry out a task, how its trajectory can be inspected, and how LLM agents differ from specialized LAM agents.
- Processing loop execution: Explain how the framework’s processing loop carries a submitted task through successive steps, from initial planning to completion or a stopping condition.
Why it matters: This loop explains how an agent can make progress and adjust its approach rather than relying on one fixed plan. - Trajectory and action inspection: Describe what an agent trajectory records and how it or conversation with the agent can help inspect task execution.
Why it matters: Inspecting how the agent acted helps explain and improve its behavior. - LLM and LAM agents: Distinguish general-purpose LLM agents from specialized LAM agents and describe how action prediction can be tailored to a domain.
Why it matters: The distinction clarifies when an agent is built around broad language capabilities versus specialized action generation.
Key terms: processing loop, sub-steps, planning, tool calls, stopping condition, trajectory, rollout, plans, LLM agent, large action model
1.4 Important enhancements and patterns
This section explains how memory and human involvement can improve LLM agent task execution, along with the trade-offs involved.
- Memory in task execution: Explain how memory lets an agent reuse information from past tasks, and describe the section’s example of memory use in the processing loop.
Why it matters: Memory can make future tasks more efficient by making earlier results available again. - Human review and errors: Explain how human involvement can reduce cascading errors and describe ways a human can intervene in the agent’s task execution.
Why it matters: Human review can catch errors before they propagate or help correct an unsuccessful result. - Human involvement trade-off: Explain why deciding whether to involve a human requires balancing accuracy against execution time.
Why it matters: The value of extra oversight depends on how much error and delay the task can tolerate.
Key terms: memory modules, context, processing loop, tool calls, human-in-the-loop, cascading errors, task result, human in the loop, error acceptance rates, execution times
1.5 Protocols for LLM agents
This section introduces three standards for LLM agent ecosystems and distinguishes LLM agents from reinforcement learning agents.
- MCP resource integration: Explain what MCP standardizes for LLM agent applications and how it supports an ecosystem of compatible resources.
Why it matters: MCP gives agents a common way to connect to external tools and resources. - Agent Skills open standard: Describe what Agent Skills standardizes and why skills can be shared across agent clients.
Why it matters: The standard makes reusable workflows shareable beyond a single agent framework. - A2A agent interoperability: Explain A2A’s role in agent communication and its potential benefit for multi-agent systems.
Why it matters: A shared communication standard can let agents from different frameworks work together. - LLM and RL agents: Distinguish LLM agents from reinforcement learning agents in their objectives and setups.
Why it matters: The distinction clarifies what the book means by an LLM agent without ruling out RL in model training.
Key terms: Model Context Protocol, MCP, MCP-compatible tools, Agent Skills, skills, SKILL.md, compliant agent client, Agent2Agent Protocol, A2A, agent-to-agent communication
1.6 Assembling LLM agents into MAS
This section explains how specialized LLM agents can be assembled into multi-agent systems, including interoperable systems using remote A2A agents.
- Coordinated Subagent Collaboration: Explain how a coordinator and specialized subagents can complete an overarching task together.
Why it matters: This pattern shows how a larger task can be divided among focused agents. - Agent Composition Choices: Describe the choices involved in composing each agent in a multi-agent system.
Why it matters: An agent's composition determines the resources and instructions it has for its role. - Remote Agent Interoperability: Explain how remote A2A agents can participate in a MAS and what makes such a system interoperable.
Why it matters: This allows a system to combine agents without requiring the coordinator to know their internal implementations. - MAS Performance Caveat: State the section's qualification about the performance of multi-agent systems.
Why it matters: Using multiple agents is not a guarantee of better or flawless results.
Key terms: MAS, coordinator, subagents, subtasks, processing loops, system-level instructions, tools, skills, memory systems, default subagents
1.7 What we’re building in this book
This section explains why the book builds an educational LLM agent framework from scratch and outlines its module organization.
- Educational framework rationale: Explain why the book builds its own framework rather than relying solely on existing ones, and distinguish its educational focus from production optimization.
Why it matters: This explains both the book’s hands-on approach and the limits of the framework it builds. - Framework module organization: Describe how the framework separates foundational definitions, agent functionality, and supporting or multi-agent capabilities into modules.
Why it matters: This organization provides a map for locating the framework components developed in later chapters.
Key terms: framework developers, application developers, production-grade, under the hood, base, tools, llms, agent, memory, skills
1.8 Code resources for this book
This introduction recommends coding along with the book’s hands-on framework to deepen understanding of LLM agents.
1.8.1 GitHub Repository
The section identifies the book’s GitHub repository and describes its code, learning resources, and community uses.
- Repository resources and participation: Describe what the book’s GitHub repository contains and how readers can participate in it.
Why it matters: The repository is where you can find the book’s code and supporting materials and participate in the community.
Key terms: GitHub repository, source code, example notebooks, bonus materials, community examples
1.8.2 Code Listings — Source Code
This section explains how code listings contribute to the framework source and indicate where their code should be saved.
- Framework listing placement: Explain what the book’s code listings contribute to the framework and how to find where to save their code.
Why it matters: Knowing where listings belong helps you assemble the framework as you work through the book.
Key terms: code listings, source code, module, subfolders
1.8.3 Code Snippets — Example Notebooks
This section distinguishes example code snippets from framework source code and explains where to find and run them.
- Purpose of Code Snippets: Explain how code snippets demonstrate the framework and how they differ from code intended for the framework’s source files.
Why it matters: This distinction helps you identify which code illustrates the framework and which belongs in its source. - Chapter Example Notebooks: Describe where to find each chapter’s code snippets and what the notebooks allow readers to do.
Why it matters: Knowing where the examples live makes it easier to follow along and experiment.
Key terms: code snippets, framework’s source code, Jupyter Notebook, examples/
1.8.4 Additional Examples and Capstone Projects
This section distinguishes the book’s additional examples and capstone projects and the framework-developer and application-developer perspectives.
- Examples and Capstone Projects: Distinguish the chapter-end examples and exercises from capstone projects by their scope and purpose.
Why it matters: The distinction helps you choose a resource suited to practicing individual components or combining concepts in a larger application. - Developer Perspectives: Distinguish framework development from application development as illustrated by the book’s code and examples.
Why it matters: Seeing both perspectives helps you understand building a framework and using it to build applications.
Key terms: additional examples and exercises, capstone projects, framework developers, application developers
1.8.5 Running the chapter notebooks
This section explains the prerequisite and general steps for launching the chapter Jupyter notebooks.
- Chapter notebook setup: Describe how to prepare for and launch the chapter notebooks, including the role of uv.
Why it matters: This setup lets you follow along with the code in the later chapters.
Key terms: Jupyter notebooks, uv, dependencies, package builds
1.8.6 Setting the LLM
This section explains how to choose and prepare a backbone LLM for the chapter notebooks, including cloud, local, and hosted-compute options.
- Ollama Cloud Model Choice: Explain why the book recommends Ollama cloud models and what is needed to use them.
Why it matters: This helps you select the recommended model option and prepare its credentials. - Local Ollama Setup: Describe how to prepare a local Ollama model before running the notebooks.
Why it matters: These preparations let the notebooks use a model running on your own machine. - Lightning AI Notebook Setup: Describe how to use the book’s Lightning AI template to run a chapter notebook when local hardware is insufficient.
Why it matters: The template provides a prepared environment when your own computer lacks the resources to run the model. - Alternative Provider Credentials: State the other LLM providers available in the chapter notebooks and their credential requirement.
Why it matters: You can choose another supported provider if you have its credentials.
Key terms: backbone LLM, Ollama cloud models, Ollama API key, local Ollama models, Ollama service, CPU, Lightning AI, book template, Studio, L4 GPU
1.9 The basics of UML diagrams
This section introduces the class and sequence diagram basics used to communicate the book’s implementation designs.
- Class diagram structure: Explain what a UML class diagram shows, using the BaseTool and ToolCallResult example.
Why it matters: Class diagrams help you see the structure of the framework before reading its code. - Sequence diagram notation: Describe how a UML sequence diagram represents participants, lifelines, messages, self-messages, and processing duration.
Why it matters: These conventions let you read how components interact over time. - Tool call sequence example: Trace the example tool call from the agent’s preparation through the return of the result.
Why it matters: The example puts sequence diagram notation into the context of a tool call.
Key terms: UML class diagram, attribute, method, dependency relationship, BaseTool, ToolCallResult, UML sequence diagram, participants, lifeline, messages
1.10 Our roadmap
This section outlines the three-part roadmap for building and enhancing LLM agents and assembling them into multi-agent systems.
1.11 Summary
Where this is used later
- LLMAgent: a simple LLM agent class (chapter 4) · Builds an agent around an LLM.
- BaseTool: a blueprint for tools (chapter 2) · Defines the book's tool interface.
- Using subagents for context management and specialization (chapter 9) · Develops the use of subagents.
- How A2A works (chapter 10) · Explains how A2A connects agents.
- Specialization and repeatability (chapter 9) · Builds on focused agents handling subtasks through specialization.
- Fan-out (chapter 9) · Builds on the benefit of agents working in parallel.
- Chaining (chapter 9) · The idea of successive research steps provides context for chaining agents.
- Router (chapter 9) · The router pattern builds on directing requests to appropriate specialized agents.
Concepts explained in this chapter
- LLM-powered agentAn LLM agent is a software system that orchestrates a large language model and external capabilities to turn the model's intentions into actions.
- tool useToolCall is a data structure representing a requested tool invocation and its arguments.
- A2AThe Agent2Agent protocol is an open standard for communication and collaboration between software agents, including agents built with different frameworks.
- MCPModel Context Protocol is an open standard for connecting AI applications with external tools and contextual resources.
- subagentA subagent is an agent dispatched by another agent to work on a subtask contributing to an overall task.
- multi-agent systemA multi-agent system is a system composed of multiple interacting agents that cooperate, coordinate, or compete to achieve goals.
- processing loopA processing loop is a repeated execution structure in which an LLM agent plans, invokes tools, evaluates results, and continues through successive steps until a stopping condition is met.
- llm agent frameworkAn LLM agent framework is software infrastructure that provides reusable components for building and operating systems centered on large language models.
- agent skillsAgent Skills is an open standard for packaging reusable workflows that compliant LLM agent clients can discover, activate, and execute.
- planningPlanning is the capability of formulating and revising a sequence of actions or steps toward completing a task.
- memory moduleA component that stores information from agent task execution and retrieves selected information into the agent's processing context.
- human-in-the-loopHuman-in-the-loop is a design pattern in which people participate in or oversee stages of an automated process.
- trajectoryA trajectory, or rollout, is a record of an agent's task execution, including its actions and their results.
- memoryMemory is a collection of records from an agent's experiences that can influence its future behavior.
- taskA task is a framework data structure containing the identifier and instruction for a user-submitted task.
- toolA tool is an externally executable capability that an LLM agent can invoke to perform an operation or obtain information.
- agent skillA skill is a reusable workflow packaged for discovery, activation, and execution by an LLM agent.
- basetoolBaseTool is the book-specific base class defining the common interface for callable tools in the framework.
- A2A agentAn A2A agent is an agent accessible to other agents through the Agent2Agent protocol without exposing its internal processes.
- stopping criterionA stopping condition is a rule that determines when iterative task execution must terminate.
- SKILL.mdSKILL.md is the required Markdown file in an Agent Skills bundle that contains the skill's metadata and instructions.
- ToolCallResultToolCallResult is a framework data structure that records a tool-call identifier, its execution result, and whether an error occurred.
- BaseLLMBaseLLM is the example framework's abstract class defining an interface for large language models.
- LLMAgentLLMAgent is the framework class that implements an LLM agent and its task-execution orchestration.
- MCP serverAn MCP server is a program that exposes tools or contextual resources to clients through the Model Context Protocol.
- OllamaLLMOllamaLLM is an LLM interface implementation that connects an agent framework to locally running models supported by Ollama.
- coordinator agentA coordinator LLM agent manages subagents or shared resources in a multi-agent system.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
