liveBook · Manning

What you will learn in Build a Multi-Agent System (from Scratch)

With MCP and A2A

by Val Andrei Fajardo · Manning Early Access Program (MEAP)

Chapter by chapter

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.

1.1 Where LLM agents and multi-agent systems are useful · 1.1.1 Report generation · 1.1.2 Web search and deep search · 1.1.3 Search and retrieval agents · 1.1.4 Coding LLM agents · 1.1.5 Computer use for personal assistants · 1.2 What is an LLM agent? · 1.2.1 Prerequisite LLM capabilities · 1.3 The processing loop · 1.4 Important enhancements and patterns · 1.5 Protocols for LLM agents · 1.6 Assembling LLM agents into MAS · 1.7 What we’re building in this book · 1.8 Code resources for this book · 1.8.1 GitHub Repository · 1.8.2 Code Listings — Source Code · 1.8.3 Code Snippets — Example Notebooks · 1.8.4 Additional Examples and Capstone Projects · 1.8.5 Running the chapter notebooks · 1.8.6 Setting the LLM · 1.9 The basics of UML diagrams · 1.10 Our roadmap · 1.11 Summary

What you learn in chapter 1 →

Chapter 2: Working with Tools

This introduction explains how tools expand LLM agents’ capabilities and outlines the basic tool-calling process.

2.1 BaseTool: a blueprint for tools · 2.1.1 Implementing ToolCall and ToolCallResult · 2.1.2 Defining BaseTool · 2.1.3 The AsyncBaseTool · 2.2 SimpleFunctionTool: a subclass of BaseTool · 2.2.1 Implementing SimpleFunctionTool · 2.2.2 The AsyncSimpleFunctionTool · 2.3 PydanticFunctionTool: another subclass of BaseTool · 2.4 Extending to MAS: Tools · 2.5 Summary

What you learn in chapter 2 →

Chapter 3: Working with LLMs

This introduction previews adding an LLM abstraction, an Ollama integration, and a complete tool-calling demonstration to the framework.

3.1 BaseLLM: a blueprint for LLMs · 3.1.1 Implementing CompleteResult, ChatMessage, and ChatRole · 3.1.2 Defining BaseLLM · 3.2 OllamaLLM: a subclass of BaseLLM · 3.2.1 Implementing OllamaLLM · 3.2.2 Hailstone tool call with OllamaLLM · 3.3 Extending to MAS: LLMs · 3.4 Summary

What you learn in chapter 3 →

Chapter 4: The LLMAgent Class

This introduction connects the framework’s LLM and tool components to an agent and explains how to configure the chapter notebook’s LLM.

4.1 LLMAgent: a simple LLM agent class · 4.1.1 Implementing Task and TaskResult · 4.1.2 Implementing LLMAgent: Part 1 · 4.2 Implementing a processing loop for LLMAgent · 4.2.1 Designing a processing loop · 4.2.2 Implementing TaskStep, TaskStepResult, and NextStepDecision · 4.2.3 Implementing LLMAgent: Part 2 · 4.3 Putting it all together: Hailstone LLM agent · 4.4 Extending to MAS: LLMAgent · 4.5 Summary

What you learn in chapter 4 →

Chapter 5: MCP Tools

This introduction situates MCP as a standard for connecting agents to external systems and enabling access to third-party tools.

5.1 Introducing MCP · 5.1.1 The MCP ecosystem · 5.1.2 The tool-calling process for an MCP tool · 5.1.3 The MCP architecture · 5.2 Integrating MCP into our framework · 5.2.1 Implementing MCPToolProvider · 5.2.2 Implementing MCPTool · 5.3 LLMAgentBuilder: a dynamic builder of LLMAgent · 5.3.1 Implementing LLMAgentBuilder · 5.4 Extending to MAS: MCP Tools · 5.5 Summary

What you learn in chapter 5 →

Chapter 6: Skills

This introduction explains why reusable procedures complement tools and how an open standard supports sharing skills.

6.1 Introducing Skills · 6.1.1 Understanding skills · 6.1.2 Specifying skills · 6.1.3 How LLM agents use skills · 6.2 Skill: a new core type · 6.2.1 Implementing SkillFrontmatter and SkillScope · 6.2.2 Implementing Skill · 6.3 Implementing Skill Discovery · 6.3.1 Where and when to discover skills · 6.3.2 Implementing discover_skills() · 6.3.3 Wiring discovery into LLMAgent and TaskHandler · 6.3.4 Disclosing discovered skills to the backbone LLM · 6.4 Implementing Skill Activation · 6.4.1 Activating a skill · 6.4.2 Implementing UseSkillTool · 6.4.3 Wiring UseSkillTool into TaskHandler · 6.4.4 User-explicit activation: run_with_skill() · 6.5 Extending to MAS: Skills · 6.6 Summary

What you learn in chapter 6 →

Chapter 7: Memory

This introduction explains why agents need memory and how episodic memory can help them use past task executions.

7.1 Introducing memory · 7.1.1 Why LLM agents need memory · 7.1.2 What memory is (and isn’t) · 7.2 Episode: the unit of memory · 7.2.1 Implementing Episode · 7.3 Memory Stores · 7.3.1 Defining BaseMemoryStore · 7.3.2 QdrantMemoryStore · 7.4 Memory: a core type for episodic memory · 7.4.1 Implementing Memory · 7.4.2 Recipes for memory · 7.5 Wiring Memory into LLMAgent · 7.5.1 Wiring memory into task execution · 7.5.2 Updating the LLMAgent and TaskHandler classes · 7.6 Extending to MAS: Memory · 7.7 Summary

What you learn in chapter 7 →

Chapter 8: Human In the Loop

This introduction explains when human input, result approval, and stepwise supervision can help with agent tasks that should not be fully autonomous.

8.1 When—and How—should humans be in the loop? · 8.2 Pattern 1: Tool-Based HITL · 8.3 Pattern 2: Result-Approval HITL · 8.3.1 Updating TaskHandler and LLMAgent · 8.4 Pattern 3: Supervised-Execution HITL · 8.4.1 Implementing SupervisedTaskHandler · 8.4.2 Updating LLMAgent · 8.4.3 Introducing the LLM Agent Inspector for supervised task executions · 8.5 Extending to MAS: HITL · 8.6 Summary

What you learn in chapter 8 →

Chapter 9: Assembling MAS with Subagents

This introduction explains how a main LLM agent can delegate tasks to subagents and how subagent dispatch works through a tool.

9.1 Using subagents for context management and specialization · 9.1.1 Context management · 9.1.2 Specialization and repeatability · 9.2 Supporting subagents in our framework · 9.2.1 SubAgentSpec: a core type for specifying a subagent · 9.2.2 Implementing UseSubAgentTool · 9.2.3 Updating LLMAgent and TaskHandler · 9.2.4 Defining default subagents · 9.3 Supporting tool-based HITL in MAS · 9.4 MAS patterns using subagents · 9.4.1 Router · 9.4.2 Fan-out · 9.4.3 Chaining · 9.5 Summary

What you learn in chapter 9 →

Chapter 10: Assembling Interoperable MAS with A2A

This introduction explains how A2A enables collaboration with remote agents across frameworks through standardized HTTP interactions and client-server roles.

10.1 How A2A works · 10.1.1 Understanding subagents vs A2A agents · 10.1.2 Understanding A2A’s client-server architecture · 10.1.3 Understanding the A2A elements used in a task lifecycle · 10.2 Integrating A2A into our framework: client-side · 10.2.1 A2AAgentSpec: a core type for specifying an A2A agent · 10.2.2 Implementing UseA2AAgentTool · 10.2.3 Updating LLMAgent and TaskHandler · 10.3 Integrating A2A into our framework: server-side · 10.3.1 Wrapping LLMAgent in an A2A AgentExecutor · 10.3.2 Standing up an A2A server with the A2A SDK · 10.4 MAS patterns using A2A · 10.4.1 Router, Fan-out, and Chaining, but interoperable · 10.4.2 Limitations of our integration · 10.5 Summary

What you learn in chapter 10 →

Concepts explained in this book

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.