liveBook · Manning

Multi-agent system

As explained in Build an AI Agent (From Scratch)

A multi-agent setup is an architecture in which multiple agents cooperate to complete a task.

A multi-agent system divides a task among agents with specialized roles. It becomes useful when one agent’s growing system prompt and tool set make relevant instructions harder to find and tool choices less reliable. Each specialist can keep a focused prompt and only the tools it needs. section 9.1 section 9.0

Technical blog writing

Split the work among agents for research, coding, drafting, and review. Give the research agent search tools and the coding agent code-execution tools, rather than giving every agent every instruction and tool. section 9.1

Figure 9.2 Four specialist agents for technical blog writing. Each agent focuses on a single role with optimized prompts and dedicated tools.

The four-role diagram shows how a single writing task can be divided into specialists with focused prompts and dedicated tools. section 9.1

Specialization alone does not determine how work moves between agents. Choose a collaboration pattern by asking who selects the next agent—the developer or the LLM—and whether agents share context. section 9.7

Three patterns provide different control and context behavior:

  • Workflow: the developer sets execution order in code. Sequential passes context onward; Parallel runs agents concurrently and merges results; Loop repeats until a stop condition. section 9.7
  • Agent as Tool: an orchestrator calls a specialist through AgentTool and receives its final result, while the specialist’s intermediate work remains isolated. section 9.7
  • Transfer: the LLM calls a transfer_to_agent tool to hand over control. The receiving agent shares context and continues the conversation. section 9.7

These patterns can be combined: use a workflow for overall structure, tool-wrapped agents for specialist consultation, and transfers for routing. A2A extends collaboration across network boundaries; RemoteAgent gives clients the same interface for remote and local agents. section 9.7

How Build an AI Agent (From Scratch) covers it

How deep it goes
Details three collaboration patterns, their control and context behavior, and workflow variants; leaves A2A at an interface-level summary.
Examples
Uses technical blog writing split among research, coding, drafting, and review specialists.
What it assumes
Assumes an Agent with a system prompt, tools, and run() method, plus an existing tool system and ExecutionContext.
What you can do after
Build it from scratch by composing specialized Agent instances with Workflow, AgentTool, or transfer-based orchestration.
How it connects
Connects agent loops and tools to workflows, context sharing, agent transfer, and the Agent-to-Agent protocol.

Also explained in

Compare how 9 books explain multi-agent system →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build an AI Agent (From Scratch). The section links point to the parts of the book it draws on.