Multi-agent systems

In one sentence

Split work across several LLM agents, each with its own context and role, to gain parallelism and context isolation — paying ~15× chat tokens and coordination failures. Worth it for broad, parallel, read-heavy tasks.

Analogy: A newsroom editor sends three reporters after different angles, then writes the story from their notes. Great for coverage; a disaster if all three rewrite the same paragraph at once.

Each subagent explores in its own window and returns only condensed findings, so the lead's context stays small.

How it works

  • The dominant shape is orchestrator–worker: a lead plans, spawns subagents with briefs and synthesizes their results.
  • Context isolation: a subagent may read 50k tokens and return a 1–2k summary to the lead.
  • A subagent knows only its brief, so agents writing coupled code make conflicting decisions.
  • One bad brief poisons a whole branch, and failures are harder to trace and eval.
  • For write-heavy, coupled work, keep one agent and use subagents only as read-only scouts.

Check yourself

Answer to mark it learned; your answers aren't scored.

Your team wants to speed up a tightly coupled API refactor by giving three parallel subagents one module each to rewrite. What do you advise?

Go deeper

Full explanation

A multi-agent system splits one task across several LLM agents, each with its own context window, prompt, tools and often model. The dominant production shape is orchestrator–worker (Pattern: orchestrator–workers): a lead agent plans, spawns subagents with a written brief, and synthesizes their condensed results. Peer-to-peer "agent societies" exist but are rare in production.

What you buy:

  • Parallelism — subagents search at the same time; wall-clock drops even though total work rises.
  • Context isolation — a subagent may read 50k tokens exploring and return a 1–2k summary, so the lead's window stays clean (see Lost in the middle & context rot).
  • Specialization — per-role prompts, tools, permissions and cheaper models.

What you pay:

  • Tokens — Anthropic's research system used ~15× the tokens of a chat (a single agent ~4×).
  • Lost context — a subagent only knows its brief. Cognition's "Don't Build Multi-Agents" argues that actions carry implicit decisions; two agents writing coupled code make conflicting ones.
  • Compounding errors — one bad brief poisons a whole branch, and failures are harder to trace and eval.

Rule: multi-agent pays off for breadth-first, parallelizable, read-heavy work (research, due diligence, broad code search). For write-heavy, tightly coupled work, keep one agent with one context and use subagents only as read-only scouts.

Code Lead agent fans out to parallel subagents
pythonLead agent fans out to parallel subagents
import asyncio
from anthropic import AsyncAnthropic

client = AsyncAnthropic()
LEAD = "claude-opus-4-5"      # strong model: plans and synthesizes
WORKER = "claude-sonnet-4-5"  # cheaper model: runs each subtask

async def ask(model: str, system: str, prompt: str) -> str:
    r = await client.messages.create(
        model=model, max_tokens=4000, system=system,
        messages=[{"role": "user", "content": prompt}])
    return r.content[0].text

async def research(question: str) -> str:
    plan = await ask(LEAD, "Split into 1-5 INDEPENDENT subtasks, one per line: "
                     "objective | output format | tools | what to skip. "
                     "Use 1 subtask for simple questions.", question)
    briefs = [b for b in plan.splitlines() if b.strip()][:5]  # hard cap on fan-out

    # Each subagent starts fresh: its brief only, not the lead's transcript
    findings = await asyncio.gather(*[
        run_agent_loop(WORKER, task=b, tools=SEARCH_TOOLS, max_steps=15)
        for b in briefs])

    notes = "\n\n".join(f"## {b}\n{f}" for b, f in zip(briefs, findings))
    return await ask(LEAD, "Synthesize an answer with sources. "
                     "Flag contradictions between findings.",
                     f"Question: {question}\n\nFindings:\n{notes}")
Real example

A due-diligence agent must profile 12 competitors. A single agent reads ~40 pages per company in sequence: ~25 minutes, and by competitor 9 its window is full of stale pages and quality drops. A lead agent instead spawns 4 subagents with 3 companies each and a fixed output schema (pricing, funding, headcount, sources). Wall-clock falls to ~7 minutes and each profile is cleaner — but the run costs ~4× more tokens, and one vague brief sent a subagent after the wrong "Acme". Fix: briefs with objective, format, boundaries and disambiguating facts.

Trade-offs +3 · −3

+ You gain

  • Parallel subagents cut wall-clock on broad tasks; Anthropic saw research time drop up to ~90%.
  • Context isolation: each worker explores in a fresh window and returns only a summary.
  • Specialization: per-role prompts, tools, permissions and cheaper models.

− You pay

  • Token cost: ~15× a chat in Anthropic's system, so only high-value tasks justify it.
  • Subagents lack shared context and make conflicting implicit decisions.
  • Harder to debug and eval: branching, nondeterministic traces where errors compound.

Use it when

Breadth-first, parallelizable, read-heavy tasks whose value pays for the tokens: research, due diligence, broad codebase or document search, independent subtasks with a clear output schema.

Avoid it when

Tightly coupled, write-heavy work (one code change, one document) where every step depends on shared decisions, or tasks one agent with good context already solves.

Numbers to know 4
  • Anthropic research system: a single agent uses ~4× the tokens of a chat; multi-agent ~15×.
  • Anthropic: an Opus 4 lead with Sonnet 4 subagents beat single-agent Opus 4 by 90.2% on its internal research eval.
  • Anthropic: token usage alone explained ~80% of the performance variance on BrowseComp.
  • MAST (Cemri et al., 2025): 14 failure modes in 3 groups — specification, inter-agent misalignment, verification.
Common pitfalls 4
  • Vague briefs ("research chip shortages"): subagents duplicate work or chase the wrong entity.
  • Splitting coupled writes across agents: two subagents build parts that don't fit together.
  • Over-spawning: Anthropic's early lead agent launched 50 subagents for simple queries. Scale effort to complexity.
  • Routing every result through the lead (a game of telephone): let subagents write artifacts and return references.
Interview questions 2

Answer out loud first, then reveal.

When would you choose a multi-agent architecture over a single agent?Show answer

Only when the task is breadth-first and parallelizable and its value pays for the tokens — Anthropic measured ~15× chat tokens for their research system. So I start with one agent and good context engineering. I go multi-agent when a single window overflows with exploration, like researching 20 sources or scanning a large codebase, and the subtasks are independent and mostly read-only. If the work is coupled writes, like a refactor, one agent owns every decision and subagents are only read-only scouts that return summaries.

Cognition says "don't build multi-agents"; Anthropic built one. Who's right?Show answer

Both, for different workloads. Cognition's point is that actions carry implicit decisions: two agents writing coupled code without each other's full trace make conflicting choices. That's true for write-heavy coding. Anthropic's research task is read-heavy and parallel: subagents gather facts and the lead makes the decisions while synthesizing. My rule is: parallelize reading, centralize writing. Either way I give each worker the full context it needs, keep one owner per decision, and eval the system end to end.