Skip to content
Agent Builder
Module 6Advanced

Multi-Agent Systems

Coordinate teams of agents

Learn when multiple agents beat one, and how to build orchestrator–worker systems, subagents, parallel runs, and clean handoffs.

Lessons
5
Reading time
52 min
Level
Advanced
Access
Full course

Lessons in this module

  1. 6.1

    When (and When Not) to Go Multi-Agent

    The real costs and benefits of multi-agent systems, and a checklist for deciding if your problem needs more than one agent.

    8 min
  2. 6.2

    The Orchestrator–Worker Pattern

    Build a lead agent that breaks work into subtasks, dispatches workers, and synthesizes results — the most useful multi-agent pattern.

    10 min
  3. 6.3

    Subagents and Delegation

    Use subagents to protect your main context, specialize behavior, and delegate well — with briefs that actually work.

    10 min
  4. 6.4

    Running Agents in Parallel

    Fan out work across many agents at once without conflicts: isolation, merging results, and controlling cost.

    13 min
  5. 6.5

    Handoffs and Shared State

    Pass work between agents reliably using artifacts, structured handoff notes, and shared files instead of giant transcripts.

    11 min

About this module

A multi-agent system is any setup where more than one model-driven agent works on a task, each with its own context and instructions. The most common shapes are an orchestrator that splits a goal into subtasks and hands them to worker agents, a main agent that delegates self-contained chunks of work to subagents, and pipelines where work passes from one specialized agent to the next.

Multiple agents help in specific ways: they keep each agent's context focused, let independent work run in parallel, and allow different steps to use different models, tools, and permissions. They also cost more, introduce new failure modes, and make results harder to debug. Many problems that seem to need several agents are better solved by one well-equipped agent with good context and good tools.

This part starts with that decision. You will learn what multiple agents really buy you, what they cost, which problems fit, and a checklist to apply before writing any orchestration code. Then you will build the orchestrator-worker pattern in TypeScript: a lead agent that plans with structured output, workers that run in parallel on a cheaper model, and a synthesis step that flags gaps and disagreements.

You will also build a delegate tool so an agent can spawn subagents with a fresh context, and learn to write briefs that subagents can act on. Then you will run agents in parallel safely with concurrency limits, a shared token budget, and one git worktree per agent for code changes. The part ends with handoffs: passing work between agents with artifacts and schema-checked notes rather than whole transcripts.

Questions about Multi-Agent Systems

What is a multi-agent system in AI?

A multi-agent system uses two or more AI agents, each with its own context and instructions, that cooperate on a task. Typical designs include an orchestrator directing workers, a main agent delegating to subagents, and pipelines that pass work between specialized agents.

When should you use multiple agents instead of one?

Use multiple agents when the work splits into independent parts that benefit from running in parallel, when one agent's context would overflow with exploration, or when steps need different tools or permissions. If the task is sequential and tightly coupled, a single agent is usually cheaper and more reliable.

What is the orchestrator-worker pattern?

In the orchestrator-worker pattern, a lead agent breaks a goal into subtasks, dispatches each one to a worker agent, and combines the workers' results into a single answer. It is the structure behind many deep research features and one of the most broadly useful multi-agent patterns.

What is a subagent?

A subagent is a helper agent that a main agent starts to handle a self-contained piece of work in a fresh context. The subagent returns a short report instead of its full transcript, which keeps the main agent's context clean. Tools such as Claude Code and the Claude Agent SDK support subagents directly.

Are multi-agent systems more expensive than a single agent?

Usually, yes. Each agent consumes its own tokens and coordination adds overhead, so a multi-agent run can use several times the tokens of a single-agent run. The extra cost is worth it only when parallelism or focused context produces clearly better or faster results.