12 Multi-Agent Systems
A single agent is capable, but it has real limits. On a long task its context window fills up. It can't be a deep expert at everything at once. And doing things one step at a time is slow. Multi-agent systems answer all three: several specialized agents work together — in parallel, checking each other's work — the way a team beats a lone generalist.
Why teams beat soloists
Every problem in this chapter comes from asking a single agent to do too much. Name the limit and the fix becomes obvious: split the work across a team.
An agent can only hold so much in its working memory. On a long, sprawling task, early details get pushed out and the agent starts to lose the thread — like trying to keep an entire novel in your head at once.
One prompt can't make an agent world-class at research and writing and code review. Ask it to be everything and it's mediocre at all of it. Specialists, each with a sharp focus, go deeper.
A lone agent works in a line: finish A, then B, then C. If three parts don't depend on each other, doing them one by one is just wasted time. A team does them at once.
The gallery
Once you have more than one agent, the real question is how they're wired together. There are four core shapes — each moves work and information differently. Pick one to see its topology and where it fits.
an assembly line
Hierarchical. A manager agent breaks the job into pieces, hands each to a specialist, and stitches the results back together. It's flexible enough for messy real work and keeps any one agent's context small — which is exactly why it's the workhorse.
Putting it together
Picture a team of agents building a piece of software. No single agent could hold the whole job in its head — but a hierarchy of specialists can, because each one only worries about its own slice.
Notice that 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 — and that cross-checking is what makes a team more trustworthy than any single agent.
Specialized agents that check each other beat one generalist trying to do everything — 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.
Chapter 12 in one breath
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 to do independent pieces at once, in a hierarchy so a manager delegates to specialists, or in a debate so they sharpen each other. Hierarchical is the one you'll reach for most. Next: the frameworks that make building these teams practical.
A matching slide deck with speaker notes — press S for notes, F for fullscreen.