Multi-Agent Patterns

Single-agent systems hit a ceiling. Context windows fill up, tool sets conflict, and latency compounds when one model tries to do everything. Multi-agent architectures break problems into scoped responsibilities, each handled by an agent with its own context, tools, and constraints.


Orchestration Patterns

Every multi-agent system is a variation or composition of these four patterns.

PatternHow it worksBest forKey implementations
Orchestrator/WorkersCentral agent decomposes a task, delegates subtasks to specialists, synthesizes results. Workers are stateless from the orchestrator’s perspective.Complex task decomposition, nested problems, hierarchical delegationClaude Code Task tool; OpenAI agent-as-tool; Google ADK AgentTool
Handoff ChainAgent A completes its portion, then transfers full control and conversation history to Agent B. No central coordinator.Pipeline workflows: intake, processing, validation, delivery; content generation; complianceOpenAI handoffs parameter (first-class); ADK transfer_to_agent; LangGraph conditional edges with shared State
Parallel Fan-OutMultiple agents execute simultaneously on independent subtasks. A gather step collects and merges outputs.Multi-source search, independent test generation, broad analysisClaude Code --background agents; ADK ParallelAgent; CrewAI Process.parallel; LangGraph parallel branches with join node
Peer MeshAgents communicate directly without a central orchestrator. Each agent discovers, invokes, and responds to others. Most flexible, hardest to debug.Cross-team, cross-org, or cross-platform interoperabilityGoogle A2A protocol (framework-agnostic, HTTP-based Agent Cards)

Higher-level architectures compose from these primitives:

Start with the simplest pattern that solves the problem. A single orchestrator with two workers handles most cases. Add complexity only when you observe bottlenecks, not in anticipation of them.

Orchestrator/Workers

sequenceDiagram
    participant U as User
    participant O as Orchestrator
    participant W1 as Research Agent
    participant W2 as Code Agent
    participant W3 as Review Agent

    U->>O: "Add OAuth to the API"
    O->>W1: Explore auth patterns in codebase
    W1-->>O: Found: session-based auth in src/auth/
    O->>W2: Implement OAuth flow
    W2-->>O: Created 3 files, updated 2
    O->>W3: Review changes for security
    W3-->>O: LGTM, 1 suggestion
    O->>W2: Apply suggestion
    W2-->>O: Done
    O-->>U: OAuth implemented, PR ready

Parallel Fan-Out

sequenceDiagram
    participant O as Orchestrator
    participant A as Search Agent
    participant B as Test Agent
    participant C as Docs Agent

    O->>A: Search for all usages of deprecated API
    O->>B: Generate tests for new endpoint
    O->>C: Update API reference docs

    Note over A,C: All three run simultaneously

    A-->>O: Found 14 usages across 8 files
    B-->>O: 6 tests written, all passing
    C-->>O: Docs updated with new endpoint
    O->>O: Merge results into plan

Cross-Platform Comparison

CapabilityClaude CodeOpenAI Agents SDKGoogle ADKCrewAILangGraph
Orchestrator/WorkersSubagent Task toolAgent-as-toolAgentTool wrapping sub-agentsProcess.sequential with managerSupervisor node with tool-call edges
Handoff ChainSequential subagent invocationhandoffs parameter (first-class)transfer_to_agent toolProcess.sequential task orderingConditional edges with shared State
Parallel Fan-OutBackground agents (--background)Async agent invocationParallelAgent (native)Process.parallelParallel branches with join node
Peer MeshNot built-in (use A2A)Not built-in (use A2A)A2A protocol supportNot built-inNot built-in
State ManagementFilesystem + shared contextRunContext objectSession.state dictShared crew memoryGraph State annotation

Memory Over Messaging

This is the single most important architectural insight for multi-agent systems: shared state outperforms agent-to-agent messaging. The instinct is to design chatty agent networks that mirror human collaboration — agents sending messages, negotiating, clarifying. This is slow, token-expensive, and brittle. The better pattern: agents read from and write to shared state (filesystem, session dict, graph state, or database). They do not talk to each other; they talk to the state. Design around data flow, not conversation flow. Memory engineering — deciding what state to expose, when to persist it, and how to scope access — matters more than optimizing inter-agent prompts.

FactorMessagingShared State
Token costDuplicates context across every exchangeEach agent reads only what it needs
LatencySequential round-trips between agentsAgents operate independently on latest state
DebuggingReconstruct from scattered conversation logsSingle source of truth, inspectable at any point
Fault toleranceLost message breaks the chainAgent retries by re-reading current state
ScalabilityO(n^2) message pathsO(n) state readers/writers

Delegation with Isolation

Each sub-agent in a production system requires strict boundaries. Sharing a single context window, tool set, and permission level across agents defeats the purpose of decomposition. Every delegated agent needs four things defined at spawn time:


Communication Protocols

ProtocolScopeMechanismWhen to use
MCPAgent to toolStandardized tool discovery and invocation. Supported natively by Claude Code, OpenAI Agents SDK, Google ADK, LangChain.Giving any agent access to any tool. Does not handle agent-to-agent communication.
A2AAgent to agentAgents publish Agent Cards (JSON capabilities); others discover and invoke via HTTP + SSE. Framework-agnostic.Peer Mesh pattern, cross-framework interoperability, long-running tasks with progress.
Shared StateImplicit coordinationKey-value store, filesystem, database, or in-memory state. Agents react to state changes.Most multi-agent architectures (memory-over-messaging). Decoupled, easy to extend.
Agent-as-ToolParent to childOne agent calls another as a tool: sends a prompt, receives a result. Called agent has no autonomy.Orchestrator/Workers within the same framework. Familiar tool-call interface.

Performance Data

Multi-agent architectures show 45% faster problem resolution and 60% more accurate outcomes compared to equivalent single-agent implementations, driven by specialization (scoped agents outperform general ones), parallelism (fan-out reduces wall-clock time), and review loops (catching errors without human intervention). Caveat: these gains are task-dependent — on sequential reasoning tasks, multi-agent decomposition can degrade performance by 39-70%, so multi-agent is not universally better. Token efficiency improves 30-50% from smaller per-agent context windows.


Choosing a Pattern

If your problem…Use…
Has independent subtasksParallel Fan-Out
Requires sequential stagesHandoff Chain
Needs centralized controlOrchestrator/Workers
Spans multiple frameworks or organizationsPeer Mesh (A2A)
Requires quality assuranceReview/Critique Loop
Has nested complexityHierarchical Decomposition