liveBook · Manning

Multi-agent system

As explained in Build a Multi-Agent System (from Scratch)

A multi-agent system is a system composed of multiple interacting agents that cooperate, coordinate, or compete to achieve goals.

A multi-agent system (MAS) combines interacting agents to carry out tasks. In an LLM-based MAS, agents can specialize in different subtasks, each using its own processing loop, instructions, tools, skills, and memory. A coordinator can delegate work and combine the results. This approach is useful when a complex task can be decomposed and specialized agents perform better than a general-purpose agent. section 1.11 section 1.6

Finding best-value food

A coordinator handles a request for best-value foods in New York City. It delegates croissant and pizza searches to specialized subagents, then combines their results. A remote agent could handle bagels through A2A; the coordinator treats that agent’s internal processing as a black box. section 1.6

Figure 1.10 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.

See how individual agent processing loops contribute results to an overarching task. section 1.6

One dispatch design exposes subagent descriptions to the main agent in its system message. When the main agent selects a subagent, UseSubAgentTool looks up its specification in a registry, constructs the subagent, and runs the delegated task. The completed result returns as a tool-call result. The main agent and subagents can use the same LLMAgent class and LLMAgentBuilder. section 9.0

Configure each agent for its role:

  • Choose instructions and tools for its responsibilities. Select a backbone LLM appropriate to the work; a coordinator may warrant a more powerful model than agents handling simple subtasks. section 1.6 section 3.3
  • Set skill discovery scope and explicit_only_skills. In this implementation, scope controls which skills are available, while listed explicit-only skills cannot be activated by the model on its own. section 6.5
  • Decide whether agents retain individual long-term memory or share experiences. Tag shared episodes with agent identifiers, and use a concurrency-safe store or delegate shared-memory management to the coordinator. section 7.6

Human oversight also needs an explicit design. Operators can approve individual results or the final combined result; earlier approval may prevent costly downstream errors. Tool-based requests for human input need synchronization when multiple agents run. Supervising every agent loop simultaneously is impractical, but an operator can supervise a coordinator’s orchestration. section 8.5

Multiple agents do not automatically outperform a single agent. Decomposition, model selection, coordination, memory, and oversight all affect the result; remote A2A agents add interoperability while hiding their internal logic. section 1.6 section 3.3 section 8.5

How Build a Multi-Agent System (from Scratch) covers it

How deep it goes
Explains subagent registry and dispatch flow, while deferring detailed failure modes and remedies.
Examples
Uses a coordinator delegating New York food searches to croissant, pizza, and remote bagel agents.
What you can do after
Build it from scratch using subagent specifications, a registry, and a dispatch tool.
How it connects
Connects multi-agent systems to tool calling, skills, memory, and human-in-the-loop oversight.

Also explained in

Compare how 13 books explain multi-agent system →

Related concepts

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