The Agentic AI Codex
Ch 12 · Multi-Agent Systems & A2A
Chapter 12 · Many minds

Multi-Agent Systems & A2A

One agent solves one task. A team of agents — supervisor, specialists, critics, validators — solves a workflow. This chapter covers the proven multi-agent topologies, when to use each, the new A2A (Agent-to-Agent) protocol, and the failure modes that come with many minds.

12.1 · When you actually need multiple agents

Most problems don't. A single agent with a good prompt and a clean tool set beats a "team" on cost, latency, and predictability. Add agents when one or more of these are true:

  • The task parallelizes (e.g. summarise 50 docs).
  • The task needs independent perspectives (writer + critic, dev + reviewer).
  • One agent's context window can't hold the whole problem.
  • Different sub-tasks need different models (a small cheap one for triage, a frontier one for synthesis).
  • Safety requires an isolated validator that cannot be talked out of its rules.

12.2 · Six classic topologies — definition + example

Router

1 agent → 1-of-N specialists

Definition. A classifier picks exactly one downstream specialist (or "answer directly") per request.

Example. A help-desk router sends billing questions to the refund agent and technical questions to the troubleshooting agent.

Supervisor

One agent orchestrates a team

Definition. A supervisor LLM decomposes the goal into sub-tasks and dispatches each to a specialist, then composes the final answer.

Example. "Write a report on EV adoption" → supervisor delegates research, data analysis, writing, and review to four specialists.

Hierarchical

Supervisors of supervisors

Definition. A top-level supervisor delegates to sub-supervisors, each managing a team of specialists.

Example. Claude Code: a primary agent spawns Explore / Plan / Review sub-agents, each with their own scope and tools.

Pipeline

A → B → C (linear handoffs)

Definition. Output of agent A is the input of B, and B → C. No back-and-forth.

Example. Document processing: Extract → Normalize → Summarise → Translate.

Debate / panel

N agents argue, a judge decides

Definition. Multiple agents (with different roles or prompts) defend competing positions; a judge agent reads the transcript and chooses.

Example. A "bull vs bear" pair argues for/against a stock recommendation; the judge synthesises a balanced report.

Swarm

Peers with handoffs

Definition. A flat team of agents pass control to each other via handoffs — no permanent boss.

Example. OpenAI's Swarm pattern for travel: a triage agent hands off to the flights agent, which hands back to triage, which hands off to hotels.

12.3 · Supervisor / router

One LLM (the supervisor) reads the user request, picks a specialist (or sequence), and dispatches the task. The supervisor receives results and decides next steps.

system: "You are the supervisor. Choose ONE of:
  - researcher: needs to look things up
  - coder:      needs to write or debug code
  - writer:     needs to produce prose
  - none:       answer directly
Respond with JSON: {agent: ..., task: ...}"

Cheap, fast, debuggable. Use it as your default before reaching for fancier topologies.

12.4 · Hierarchical teams

A top-level supervisor delegates to sub-supervisors, each managing their own specialists. This is how Claude Code organises sub-agents: a primary agent spawns scoped sub-agents (Explore, Plan, Review) that report back.

Top supervisor Research team Build team QA team • retriever
• fact-checker • coder • tester • reviewer • red-team

12.5 · Debate & critique

Two or more agents argue different positions; a judge agent (often the same model with a different prompt) picks the best answer. Effective for:

  • Hard reasoning where a single chain-of-thought commits early.
  • Fact-checking — one agent argues "for", another "against".
  • Reducing hallucination in safety-critical outputs.

12.6 · Swarms

Peer agents pass control to each other via handoffs. No single boss. OpenAI's Swarm pattern and the Agents SDK formalised this. Best for open-ended exploration ("here's a topic, brainstorm").

12.7 · A2A — the Agent-to-Agent protocol

A2A (Google + partners, 2025) is to agents what MCP is to tools: a standard protocol so two agents from different organisations or vendors can collaborate.

Agent cards

A JSON file describing an agent's skills, endpoints, auth, and pricing. Discoverable like robots.txt.

Tasks & messages

Long-running tasks with structured status updates and artefacts (files, links).

Streaming + push

SSE / webhooks so agents can collaborate over minutes or days, not just one request.

Auth & identity

OAuth-style flows so agents act on behalf of users with revocable scopes.

MCP vs A2A in one line
MCP connects an agent to tools and data. A2A connects an agent to other agents.

12.8 · Multi-agent failure modes

  1. Cost explosion — three agents = three times the tokens, easily ten.
  2. Loop of agreement — peers nod at each other; debate collapses. Force diverse roles.
  3. Lost-in-translation — the supervisor garbles the task before passing it down.
  4. Untraceable bugs — output is wrong but you can't tell which agent drifted.
  5. Cascading hallucination — agent A invents a fact, agent B accepts and uses it.

12.9 · A case study — the research team

A common shape that ships:

  1. Planner: turn the user's question into 5 sub-questions.
  2. Researcher × N (parallel): for each sub-question, web_search + RAG + summarise.
  3. Synthesizer: merge the summaries into a coherent draft with citations.
  4. Critic: check claims against retrieved passages; flag unsupported lines.
  5. Writer: produce the final styled output.

This pattern (planner → parallel researchers → synthesizer → critic → writer) is how most production "deep research" agents are built.

12.10 · Self-check

Q1 · You need to summarise 200 documents in 2 minutes. Best topology?
Single agent
Debate panel
Supervisor with parallel summariser specialists
Swarm of peers
Q2 · A2A is most analogous to…
REST
An OAuth + RPC protocol for agents
SMTP
SQL