Intermediate · 20 min read · updated 2026-07-14

Multi-Agent Systems: When Many Agents Beat One

A practical guide to multi-agent systems: when coordination pays off, when it wastes tokens, and how to design hand-offs that don't break.

Multi-AgentAI AgentsClaudeOrchestrationLLM Engineering
Who this is for: engineers and technical founders who already built one working AI agent and are now wondering whether splitting the work across several agents will make things faster, cheaper, or just more confusing. It usually starts confusing before it gets better.

Multi-agent systems are not a magic upgrade over a single well-prompted agent. They are a distributed systems problem wearing an LLM costume, complete with the same failure modes: race conditions, stale state, retries that duplicate work, and one slow node that stalls everything else. If you understand when the split actually pays for itself, you can build something that ships faster and costs less than one giant agent trying to do everything in a single context window. If you don't, you'll build a system that argues with itself.

What "multi-agent systems" actually means in 2026

Strip away the marketing and a multi-agent system is just this: more than one LLM-driven process, each with its own context window and tool access, working toward a shared goal, coordinated by either a fixed pipeline, a orchestrator agent, or a shared piece of state (a queue, a file, a ticket).

Three shapes cover almost every real deployment:

  • Pipeline (sequential hand-off). Agent A researches, hands a structured artifact to Agent B, which drafts, which hands to Agent C, which reviews. No agent talks back to an earlier one. Cheapest to reason about, cheapest to debug.
  • Orchestrator-worker (hub and spoke). One "lead" agent decomposes a task, dispatches subtasks to specialized workers (a coder, a tester, a researcher), collects results, and decides what happens next. This is what Claude Code's Task tool and subagents implement — see Claude Code subagents for the concrete mechanics.
  • Peer-to-peer / blackboard. Agents read and write to shared state (a database, a shared doc, a message bus) without a strict hierarchy. Powerful, but the hardest to keep from stepping on itself. Reserve this for cases where a hub genuinely can't scale.

Anthropic's own multi-agent research system (the one behind Claude's deep-research mode) is publicly documented as an orchestrator-worker design, not a peer-to-peer swarm — and that choice was deliberate: peer-to-peer coordination without a clear owner tends to burn tokens re-litigating decisions.

When multiple agents actually beat one

The honest answer is: less often than the hype suggests. Split when at least one of these is true.

  1. The task decomposes into genuinely independent subtasks. Researching five competitors in parallel, then merging findings, is embarrassingly parallel — five agents finish in the time of one. Writing a single coherent 3,000-word article is not; splitting it into "intro agent" and "body agent" usually produces a worse, seamed document than one agent with a good outline.
  2. Different subtasks need different tools or permissions. A "read the codebase" agent can run read-only. A "write the migration" agent needs write access. Keeping those separate is a security win as much as an architecture one — see Claude Code permissions and safety.
  3. Context would otherwise blow the window. A single agent reading 40 files, running tests, and writing a report will spend most of its context on transcripts of its own tool calls. A researcher-subagent that reads the 40 files and returns a 200-word summary keeps the orchestrator's context clean. This is the single best argument for subagents in coding tools today.
  4. You need a second opinion, not a faster opinion. A separate reviewer agent, with no attachment to the code it's reviewing, catches things the author agent won't. This is the basis of most working "AI code review" setups — see AI code review tools.
  5. Failure isolation matters. If one worker crashes or hallucinates, you want to retry that one subtask, not restart the whole job. A monolithic agent has no such boundary.
When it's not worth it: if the task is a single coherent piece of reasoning — writing one function, one landing page, one SQL query — splitting it into agents adds coordination overhead (serialization, hand-off prompts, merge conflicts) with no parallelism benefit. Anthropic's own writeup on their research system notes multi-agent setups can burn roughly 4x the tokens of a single agent for comparable single-thread tasks. Use one agent until you have a concrete reason not to.

Coordination patterns that hold up in production

The orchestrator pattern

One agent owns the plan and the final answer; workers never talk to each other, only to the orchestrator. This is the pattern to default to because it has one clear owner for state and for mistakes.

# pseudocode: orchestrator dispatching independent research workers
def run_research(topic, subquestions):
    orchestrator_plan = plan_subtasks(topic, subquestions)
    results = []
    for task in orchestrator_plan:
        # each worker gets its own fresh context window
        worker_result = spawn_agent(
            role="researcher",
            prompt=task.prompt,
            tools=["web_search", "fetch_url"],
            max_turns=8,
        )
        results.append(worker_result)
    return synthesize(orchestrator_context, results)

Keep worker prompts self-contained — a worker should never need to ask the orchestrator a clarifying question mid-task, because that round-trip is where systems stall. Overspecify the worker's brief instead.

The pipeline pattern

Fixed order, one hand-off artifact per stage, no backtracking. Good for content pipelines: outline agent to draft agent to fact-check agent to SEO-pass agent. If stage 3 needs stage 1's output, pass it forward explicitly in the prompt — don't rely on the agent "remembering" a previous conversation, because each stage should run in its own clean context.

The blackboard / shared-state pattern

Agents read and write to a shared resource — a Postgres table of tasks, a shared markdown file, a Linear board — instead of talking directly. Good when the number of agents or the order of operations isn't known in advance (e.g., a swarm of monitoring agents each watching a different service). Requires real concurrency control: row-level locks or optimistic versioning, or two agents will both "claim" the same ticket. This is exactly the class of bug that shows up first in code review — worth running eval-driven AI development against your orchestration logic itself, not just the model outputs.

PatternBest forFailure mode to watchCoordination cost
Orchestrator-workerParallel independent subtasksOrchestrator becomes a bottleneckLow-medium
Sequential pipelineContent/build pipelines with clear stagesBad hand-off artifact poisons every downstream stageLow
Blackboard/shared stateUnknown agent count, long-running swarmsRace conditions, duplicate workHigh
Single agent + subagent callsMost coding and research tasksNone of the above — but no parallelismLowest

Shared state: the part everyone underestimates

The hard part of multi-agent systems is never the LLM calls — it's what happens between them. Three failure modes recur constantly:

  • Stale reads. Agent B reads a file that Agent A is still editing. Solve with explicit stage gates: B doesn't start until A's write is confirmed committed, not just "probably done."
  • Silent duplicate work. Two workers pick up the same task because the queue wasn't locked. Solve with a claim/lease pattern (worker marks a task "in progress" with a timestamp before starting, and a timeout releases it back to the pool if the worker dies).
  • Context drift. The orchestrator's summary of a worker's output loses a critical constraint (a deadline, a budget, a "do not touch this file" rule) because summarization is lossy by nature. Solve by passing structured data, not prose, between agents wherever the value matters — see structured outputs and LLM tool calling for how to make hand-offs schema-checked instead of vibes-checked.
Tip: log every hand-off artifact (the literal JSON or markdown passed between agents) to disk or to a trace store. When something goes wrong three stages downstream, you need to see exactly what stage 1 handed to stage 2 — not what you assume it handed over.

Cost: the number nobody puts on the slide

Every agent-to-agent hand-off re-sends context. A 5-worker orchestrator pattern where each worker gets a 2,000-token brief plus a 500-token system prompt is 12,500 tokens of input before any work happens — and that's before the workers' own tool-call transcripts. Multi-agent research setups commonly run 3-5x the token cost of an equivalent single-agent pass, per Anthropic's published multi-agent research post. That's a real budget line, not a rounding error, especially at Opus-class pricing.

Two levers that actually move the number:

  • Use a cheaper model for workers, a stronger one for the orchestrator. The orchestrator's decomposition and synthesis quality matters more than any single worker's. Route workers to Haiku-class or Sonnet, keep Opus for the planning/review seat. See Claude model pricing and Claude Opus 4 guide for current tiers.
  • Cache the system prompt and shared context. If five workers share the same 3,000-token brief on how to format their output, prompt caching turns that into a near-free repeat cost instead of paying full input price five times. See prompt caching.

For teams watching spend closely, token cost control is worth reading before you scale from 1 agent to 5 — the multiplier is real and it compounds with every added stage.

A minimal working example: a review pipeline

Here's a pattern that reliably earns its complexity: a writer agent and a separate, independently-prompted reviewer agent, with no shared context between them except the artifact.

async function writeAndReview(brief) {
  const draft = await callAgent({
    role: "writer",
    system: WRITER_SYSTEM_PROMPT,
    prompt: brief,
  });

  // Reviewer gets a FRESH context — it never saw the writer's reasoning,
  // only the final artifact. That's what makes it a real second opinion.
  const review = await callAgent({
    role: "reviewer",
    system: REVIEWER_SYSTEM_PROMPT,
    prompt: `Review this draft against the brief.\nBrief: ${brief}\nDraft: ${draft}`,
  });

  if (review.verdict === "reject") {
    return writeAndReview(`${brief}\n\nPrevious attempt was rejected: ${review.reason}`);
  }
  return draft;
}

The key design decision is the fresh context for the reviewer. If the reviewer inherits the writer's conversation, it inherits the writer's blind spots too.

Failure modes to design around from day one

  • The orchestrator hallucinates a worker's result. If a worker times out or errors, make sure the orchestrator treats "no result" as an explicit failure state in its prompt, not something it papers over by inventing a plausible-sounding answer.
  • Infinite delegation loops. Orchestrator spawns a worker that decides the task needs sub-delegation, which spawns another worker... Cap delegation depth explicitly (most production systems hard-limit to one or two levels).
  • Cascading errors. A wrong fact from stage 1 gets treated as ground truth by every downstream stage, because nothing downstream questions it. Add a lightweight fact-check or sanity-check stage before anything expensive happens downstream, especially in RAG for SMB pipelines where a bad retrieval poisons the whole chain.
  • No human circuit-breaker. For anything customer-facing or irreversible (sending an email, charging a card, deploying code), keep a human-approval gate between the agent system's decision and the action. Multi-agent doesn't mean multi-autonomous.

FAQ

What's the difference between multi-agent systems and just using function calling?

Function calling (tool use) is a single agent extending its own capability by calling external functions — it's still one context window, one line of reasoning. A multi-agent system involves multiple independent LLM calls, each with its own context and often its own model, coordinated toward a shared goal. You can have tool calling without multi-agent, and you rarely have multi-agent without some tool calling inside each agent.

Do multi-agent systems reduce hallucinations?

Sometimes, if you design a genuine independent reviewer step with no shared context. They do not reduce hallucinations automatically just by adding more agents — an orchestrator that blindly trusts a hallucinating worker just amplifies the error faster. The gain comes specifically from independence, not from headcount.

Should I use LangChain, CrewAI, or just build the orchestration myself?

For a first production system, hand-rolling orchestration with plain function calls is usually easier to debug than adopting a heavyweight framework, because you can see exactly what's being passed between stages. Frameworks earn their keep once you have several similar pipelines and want shared infra for retries, tracing, and agent registries — see LangChain vs LlamaIndex for where each framework's abstractions actually help versus add ceremony.

How many agents is too many?

There's no fixed number, but complexity grows faster than agent count. Past 4-5 coordinating agents in a single flow, most teams find debugging and cost tracking get disproportionately harder. If you're past that, you likely need a real workflow engine (a queue plus a state machine) rather than more prompt-based coordination.

Can Claude Code's subagents be considered a multi-agent system?

Yes — Claude Code's subagent feature is a practical orchestrator-worker implementation: the main agent (orchestrator) dispatches focused subtasks to subagents that run in their own context and report back a summary. It's a good template to study because it's a production system solving exactly the context-window and tool-isolation problems this guide describes. See Claude Code subagents for setup details.

What's the simplest multi-agent pattern to start with?

A two-stage pipeline: one agent produces a draft, a second agent with fresh context reviews it against explicit criteria. It requires no framework, no shared database, and no orchestrator logic beyond an if-statement, and it already captures most of the benefit — independent review — that justifies going multi-agent in the first place.

Get it built right the first time

If you're deciding whether your product needs one agent or five, it's worth 30 minutes to map the actual task boundaries before you write orchestration code that you'll have to unwind later. Book a free call through the contact form or message directly on WhatsApp.

Sources