Chapter 12 · Multi-Agent Systems

When one agent
isn't enough.

A single agent is capable — but it runs out of context, can't be expert at everything, and works one step at a time. The fix is a team.

Why teams beat soloists

The limits of one agent.

Every problem in this chapter comes from asking a single agent to do too much. Three limits show up again and again:

Context fills up

An agent holds only so much in working memory. On a long task, early details get pushed out and it loses the thread.

No single expert

One prompt can't be world-class at research and writing and code review. Ask for everything, get mediocre.

One thing at a time

A lone agent works in a line: A, then B, then C. If the parts don't depend on each other, that's wasted time.

The move

Name the limit — the fix is a team.

Split the work across several specialized agents and all three limits ease at once: each agent keeps a small context, each one goes deep on its slice, and independent pieces run side by side.

Many small experts beat one overloaded generalist.

The only open question left is how you wire them together — which is exactly what the four topologies answer.

The gallery

Four ways to arrange agents.

Same kind of agent in every box — you're choosing how they pass work and check each other. Four core shapes:

Sequential

An assembly line — each agent's output is the next one's input.

Parallel

Fan one job out to several workers, then merge the results.

Hierarchical

A manager delegates to specialists and stitches their work back together.

Debate

Agents propose, critique, and revise until a judge picks the best.

Topology 1 · an assembly line

Sequential pipeline.

Researcher Writer Editor Publisher each agent's output is the next one's input

Best for clear, staged workflows · Watch out — one weak link taints everything downstream.

Topology 2 · fan out, then merge

Parallel fan-out.

Input Worker 1 Worker 2 Worker 3 Aggregator

Best for independent subtasks · Watch out — only works when the pieces truly don't depend on each other.

Topology 3 · a manager and workers

Hierarchical. The workhorse.

Orchestrator Specialist 1 Specialist 2 Specialist 3 delegate report back

Best for complex, open-ended goals — the production default · Watch out — a poor manager drifts the whole team.

Topology 4 · propose, critique, judge

Debate.

Agent A Agent B Judge proposes critiques A revises picks best

Best for high-stakes answers where correctness beats speed · Watch out — slower and pricier.

Putting it together

A real software team.

No single agent could hold the whole build in its head — but a hierarchy of specialists can, because each only owns its slice:

Orchestrator
Runs the show. Reads the goal, splits it into tasks, hands each to the right specialist, and assembles the finished result.
Architect
Designs the structure and how the pieces fit — before a line of code is written.
Coder agents ×3
Build separate components in parallel — independent pieces at the same time.
Test agent
Writes and runs tests against what the coders produced, catching what slipped through.
Review agent
Reads the code with fresh eyes for quality and bugs — a second opinion.
Docs agent
Writes the documentation so the work is usable by the humans who come next.

The quiet superpower

Agents that check each other.

Notice the Test and Review agents exist only to check other agents' work. A lone agent grading its own homework tends to miss its own mistakes.

A separate reviewer, with no ego in the code, catches them.

That cross-checking is what makes a team more trustworthy than any single agent — not just faster, but harder to fool.

Chapter 12 key idea

Specialists that check each other beat one generalist.

Deeper focus, work done in parallel, and a second set of eyes. That's why the hierarchical manager-worker shape is the workhorse of real production systems.

The generalist

One agent, overloaded context, no one to catch its mistakes.

The team

Small contexts, sharp specialists, parallel work, built-in review.

Chapter 12 in one breath

Many small experts, wired together.

One agent runs out of context, can't be expert at everything, and works one step at a time. A team fixes all three. Wire them in a line to pass work along, in parallel for independent pieces, in a hierarchy so a manager delegates, or in a debate so they sharpen each other.

Hierarchical is the one you'll reach for most.

Next up

Chapter 13 · Frameworks.

We've named the four topologies and the workhorse among them. Next we open the frameworks that make building these agent teams practical — the tools that turn these shapes into working systems.

Press S for speaker notes · F for fullscreen · to advance.