# Multi-agent systems in practice: supervisors, handoffs, swarms and subagents compared

Multi-agent systems split one job across several model-driven workers. This guide explains the five main patterns step by step, runs a supervisor and a handoff system offline with LangGraph 1.2 and LangChain 1.5, and counts the model calls and tokens each pattern costs.

A multi-agent system is a program in which more than one model-driven agent works on a task, each with its own instructions, tools and context. The agents pass work to each other through tool calls or through shared state. The idea is old, but in 2026 it has become the default shape of many coding and research agents, which now spawn subagents for search, testing or review.

More agents are not automatically better. Each extra agent adds model calls, latency and new ways to fail. The LangChain documentation puts it plainly: a single agent with the right tools and prompt can often do the job. This article explains when splitting helps, the five patterns teams use, and what each one costs, with two small systems you can run offline.

## What happened

### LangChain 1.5.2 and LangGraph 1.2.24 are the current releases (18 to 20 November 2026)

LangChain 1.5.2 reached PyPI on 18 November 2026 and LangGraph 1.2.24 on 20 November 2026. In these versions the LangChain multi-agent guide describes five patterns: subagents, handoffs, skills, router and custom workflow. The building blocks are `create_agent`, tools that wrap other agents, and tools that return a LangGraph `Command` to move control between graph nodes. Both demos below run against these exact versions.

### The older supervisor library now points to plain tool calling (current guidance)

The `langgraph-supervisor` package (latest version 0.0.31) now opens its README with a note: the maintainers recommend using the supervisor pattern directly through tools rather than the library for most use cases, because tool calling gives more control over context engineering. The `langgraph-swarm` package (0.1.0) still provides swarm-style handoffs where the last active agent is remembered between turns.

### OpenAI Agents SDK 0.25.0 and Google ADK 2.15.0 (18 and 20 November 2026)

Other frameworks ship the same ideas under their own names. OpenAI Agents SDK 0.25.0 was published on 18 November 2026; its `Agent` has a `handoffs` field, a `handoff()` helper that creates a tool named like `transfer_to_billing_agent`, and an `as_tool()` method that turns an agent into a callable tool. Google ADK 2.15.0 followed on 20 November 2026. Microsoft Agent Framework 1.26.0 (12 November 2026) ships orchestration builders named `SequentialBuilder`, `ConcurrentBuilder`, `GroupChatBuilder`, `HandoffBuilder` and `MagenticBuilder`.

## Why split one agent into several

The LangChain guide lists three reasons teams reach for multiple agents:

- **Context management.** Each agent sees only the instructions, tools and documents for its domain, so a large tool catalogue does not confuse one model.
- **Distributed development.** Separate teams can own separate agents with clear boundaries.
- **Parallelism.** Independent subtasks can run at the same time.

A kitchen is a fair analogy. One cook can make a whole meal, and for a small dinner that is fastest. For a restaurant, a head chef hands out tickets to stations (grill, salads, pastry), each station works with only its own ingredients, and the head chef plates the result. The cost is coordination: tickets get lost, and stations wait for each other.

Anthropic reported a measured version of this trade-off for its research feature. On its internal research evaluation, a system with a Claude Opus 4 lead agent and Claude Sonnet 4 subagents outperformed a single Claude Opus 4 agent by 90.2%. The same write-up reported that agents typically used about 4 times more tokens than chat, and multi-agent systems about 15 times more. Parallel exploration helped mostly on broad, breadth-first questions, and the gain was paid for in tokens.

## The five patterns step by step

| Pattern | Who decides the next step | Talks to the user | Parallel work | Typical use |
|---|---|---|---|---|
| Subagents (supervisor) | A main agent calling agents as tools | Main agent only | Yes | Research, multi-domain assistants |
| Handoffs (swarm) | The active agent, by a transfer tool | Whichever agent is active | No | Support desks, staged workflows |
| Skills | One agent loading prompts on demand | The one agent | Limited | Many small specialities |
| Router | A classification step | Usually the routed agents | Yes | Clear request categories |
| Custom workflow | Your graph code | Any | Yes | Fixed business processes |

### Subagents: the supervisor pattern

The main agent, often called the supervisor or orchestrator, sees each specialist as a tool. It decides which to call, passes a query, and receives only the specialist's final answer. The specialist's own intermediate messages never enter the supervisor's context. This isolation is the pattern's main strength, because a specialist can read 20,000 tokens of documentation and hand back a 50-token answer.

Here is a runnable supervisor with two specialists. The scripted model replaces a real LLM so the run is repeatable; it also counts model calls.

```python
# fake.py  (pip install langchain==1.5.2 langgraph==1.2.24)
from langchain_core.language_models.fake_chat_models import GenericFakeChatModel

class ScriptedModel(GenericFakeChatModel):
    """Replays scripted AIMessages, counts calls, accepts bind_tools (offline only)."""
    calls: int = 0
    def bind_tools(self, tools, **kwargs):
        return self
    def _generate(self, messages, stop=None, run_manager=None, **kwargs):
        self.calls += 1
        return super()._generate(messages, stop=stop, run_manager=run_manager, **kwargs)
```

```python
# subagents_demo.py
import warnings; warnings.filterwarnings("ignore")
from langchain_core.messages import AIMessage
from langchain.agents import create_agent
from langchain.tools import tool
from fake import ScriptedModel

flights_model = ScriptedModel(messages=iter([AIMessage("Cheapest IST-LIS flight: 189 EUR, 4h40.")]))
hotels_model = ScriptedModel(messages=iter([AIMessage("Hotel near Rossio: 96 EUR per night.")]))
flights_agent = create_agent(flights_model, tools=[], system_prompt="You find flights.")
hotels_agent = create_agent(hotels_model, tools=[], system_prompt="You find hotels.")

@tool
def ask_flights(query: str) -> str:
    """Ask the flights specialist. Returns only its final answer."""
    return flights_agent.invoke({"messages": [("user", query)]})["messages"][-1].content

@tool
def ask_hotels(query: str) -> str:
    """Ask the hotels specialist. Returns only its final answer."""
    return hotels_agent.invoke({"messages": [("user", query)]})["messages"][-1].content

supervisor_model = ScriptedModel(messages=iter([
    AIMessage("", tool_calls=[
        {"name": "ask_flights", "args": {"query": "Istanbul to Lisbon, 12 Dec"}, "id": "f1"},
        {"name": "ask_hotels", "args": {"query": "Lisbon centre, 12-15 Dec"}, "id": "h1"}]),
    AIMessage("Flight 189 EUR plus 3 nights at 96 EUR = 477 EUR in total."),
]))
supervisor = create_agent(supervisor_model, tools=[ask_flights, ask_hotels],
                          system_prompt="Plan trips. Delegate to specialists.")
out = supervisor.invoke({"messages": [("user", "Plan 3 nights in Lisbon from Istanbul on 12 Dec.")]})
for m in out["messages"]:
    print(type(m).__name__, "|", m.content or [c["name"] for c in m.tool_calls])
print("model calls: supervisor", supervisor_model.calls, "flights", flights_model.calls, "hotels", hotels_model.calls)
```

```text
HumanMessage | Plan 3 nights in Lisbon from Istanbul on 12 Dec.
AIMessage | ['ask_flights', 'ask_hotels']
ToolMessage | Cheapest IST-LIS flight: 189 EUR, 4h40.
ToolMessage | Hotel near Rossio: 96 EUR per night.
AIMessage | Flight 189 EUR plus 3 nights at 96 EUR = 477 EUR in total.
model calls: supervisor 2 flights 1 hotels 1
```

Step by step:

1. The supervisor's first call emits two tool calls in one message.
2. The agent's tool step runs both. In a separate timing test with two tools that each sleep for one second, the step finished in 1.01 seconds, so the calls ran concurrently.
3. Each specialist runs its own loop and returns only its last message. The supervisor's history gains two short tool messages, not the specialists' full transcripts.
4. The supervisor's second call combines the answers: 189 + 3 × 96 = 477 EUR.

That is four model calls in total. The [multi-agent supervisor simulation](/ai-simulations/multi-agent-supervisor) lets you step through the same flow with more workers.

### Handoffs: passing the conversation on

In a handoff system, agents are nodes in a graph and the active agent can transfer control. The transfer is a tool that returns a `Command` with `goto` (the next node), a state `update`, and `graph=Command.PARENT`, which tells LangGraph to route in the parent graph rather than inside the agent's own subgraph. A state key such as `active_agent` records who is in charge, so the next user message can go straight back to that agent. This is the "swarm" behaviour.

```python
# handoffs_demo.py
import warnings; warnings.filterwarnings("ignore")
from typing import Literal
from typing_extensions import NotRequired
from langchain.agents import AgentState, create_agent
from langchain.messages import AIMessage, ToolMessage
from langchain.tools import tool, ToolRuntime
from langgraph.graph import StateGraph, START, END
from langgraph.types import Command
from fake import ScriptedModel

class MultiAgentState(AgentState):
    active_agent: NotRequired[str]

def make_transfer(target: str):
    @tool(f"transfer_to_{target}")
    def transfer(runtime: ToolRuntime) -> Command:
        """Hand the conversation to another agent."""
        last_ai = next(m for m in reversed(runtime.state["messages"]) if isinstance(m, AIMessage))
        note = ToolMessage(content=f"Transferred to {target}", tool_call_id=runtime.tool_call_id)
        return Command(goto=f"{target}_agent", update={"active_agent": f"{target}_agent",
                       "messages": [last_ai, note]}, graph=Command.PARENT)
    return transfer

sales_model = ScriptedModel(messages=iter([
    AIMessage("", tool_calls=[{"name": "transfer_to_support", "args": {}, "id": "t1"}])]))
support_model = ScriptedModel(messages=iter([
    AIMessage("Reset link sent. Log in again within 15 minutes.")]))
sales = create_agent(sales_model, tools=[make_transfer("support")], system_prompt="Sales. Transfer tech issues.")
support = create_agent(support_model, tools=[make_transfer("sales")], system_prompt="Support. Transfer pricing.")

def route_after(state) -> Literal["sales_agent", "support_agent", "__end__"]:
    last = state["messages"][-1]
    if isinstance(last, AIMessage) and not last.tool_calls:
        return "__end__"
    return state.get("active_agent") or "sales_agent"

b = StateGraph(MultiAgentState)
b.add_node("sales_agent", sales)
b.add_node("support_agent", support)
b.add_conditional_edges(START, lambda s: s.get("active_agent") or "sales_agent", ["sales_agent", "support_agent"])
b.add_conditional_edges("sales_agent", route_after, ["sales_agent", "support_agent", END])
b.add_conditional_edges("support_agent", route_after, ["sales_agent", "support_agent", END])
graph = b.compile()

out = graph.invoke({"messages": [("user", "I cannot log in to my account.")]})
for m in out["messages"]:
    print(type(m).__name__, "|", m.content or [c["name"] for c in m.tool_calls])
print("active_agent:", out["active_agent"], "| model calls: sales", sales_model.calls, "support", support_model.calls)
```

```text
HumanMessage | I cannot log in to my account.
AIMessage | ['transfer_to_support']
ToolMessage | Transferred to support
AIMessage | Reset link sent. Log in again within 15 minutes.
active_agent: support_agent | model calls: sales 1 support 1
```

Note what the transfer tool passes on: only the last AI message and a short tool message, not the sales agent's whole history. The documentation warns that subgraph handoffs need this kind of explicit context engineering, or the next agent receives malformed or bloated history. A tool call without a matching tool result is a common cause of provider errors.

### Skills, routers and custom workflows

**Skills** keep one agent in control and load a specialised prompt or document only when needed. It is the cheapest pattern for many small specialities, but loaded skill text stays in the context for every later call. See [agent skills](/tools/skills).

**Routers** classify the request first, then send it to one or more agents and merge the answers. They are stateless, so each new request pays for the routing call again.

**Custom workflows** are LangGraph graphs where you hard-code some steps and let agents handle others. Use them when the business process is fixed, for example "extract, validate, then ask a human". [Orchestrator-workers](/tools/orchestrator-workers) is the common name for the dynamic version of this layout.

### The same patterns in other frameworks

The vocabulary differs between frameworks, but the mechanics map closely. In the [OpenAI Agents SDK](/tools/openai-agents-sdk), `Agent(handoffs=[...])` gives the model transfer tools, and `agent.as_tool(tool_name, tool_description)` turns a specialist into a subagent that returns its output to the caller. The `handoff()` helper also takes an `input_filter`, which plays the same role as the message selection in the LangGraph transfer tool above. In [Microsoft Agent Framework](/tools/microsoft-agent-framework), the orchestration builders cover sequential, concurrent, group chat, handoff and Magentic-style (planner-led) layouts. [Google ADK](/tools/google-adk) composes agents as sub-agents of a parent agent, and [CrewAI](/tools/crewai) organises agents into crews with tasks. If you think in terms of "who decides the next step" and "what context does each agent see", you can move a design between these frameworks with little change. The [agentic patterns simulation](/ai-simulations/agentic-patterns) shows the layouts side by side, and the [multi-agent systems page](/tools/multi-agent-systems) collects the terminology.

## What the patterns cost

The LangChain guide works through the same requests under each pattern. For a one-shot request ("buy coffee"), subagents take 4 model calls while handoffs, skills and router take 3, because the supervisor adds a final summarising call. For a repeat request in the same conversation, the stateful patterns win: handoffs and skills need 5 calls in total against 8 for subagents. For a multi-domain question, comparing three languages with about 2,000 tokens of documentation each, the numbers flip:

| Pattern | Model calls | Total tokens (approx.) |
|---|---|---|
| Subagents | 5 | 9K |
| Router | 5 | 9K |
| Handoffs | 7+ | 14K+ |
| Skills | 3 | 15K |

Skills makes the fewest calls but every call after loading carries all 6,000 tokens of skill text. Subagents isolate each 2,000-token context in its own worker, which is why they process about 40% fewer tokens than skills here (9K against 15K). Handoffs cannot run the three domains in parallel, so they are both slower and larger.

A simple rule falls out of these numbers. If tasks repeat inside one conversation, prefer a stateful pattern. If tasks fan out into independent heavy domains, prefer subagents or a router.

## What it means in practice

Start with one agent and a good tool set. Split only when you see one of the three symptoms: the model picks the wrong tool from a long list, one domain's documents crowd out the others, or independent subtasks run one after another when they could run together. When you do split, the isolation is the point. Pass each worker a precise query, return a short structured result, and keep raw transcripts in traces, not in the supervisor's context.

Observability matters more than in single-agent systems. When a final answer is wrong, you need to see which worker produced the bad intermediate result, what query it was given and how many tokens it spent. Name every agent, propagate one trace ID through all of them, and record each subagent run as a child span of the supervisor's tool call. See [tracing](/tools/tracing) for the span model most tools now share.

Plan for failure modes that single agents do not have. Supervisors can delegate the same subtask twice, specialists can return confident answers to the wrong question, and handoff loops can bounce a user between two agents. Each needs a guard: a call budget per worker, a schema for results, and a maximum number of transfers. For how coding agents adopted these ideas, see [subagents in coding agents](/articles/subagent-orchestration-coding-agents), and for protocol-level agent-to-agent calls see [A2A](/tools/a2a).

## What to do now

1. **Prove you need it.** Build the single-agent baseline first and record its success rate and cost on the same test set.
2. **Pick the pattern from the workload.** Use subagents or a router for parallel heavy domains, and handoffs or skills for repeated requests within one conversation.
3. **Return summaries, not transcripts.** Make each subagent tool return only its final answer or a small structured object.
4. **Control handoff context.** Pass the last AI message and a matching tool message, as in the demo, rather than the whole history.
5. **Bound every loop.** Set model-call limits per agent and a maximum number of transfers per conversation.
6. **Use concurrent tool calls.** Let the supervisor emit several tool calls in one turn so independent workers run at the same time.
7. **Trace each agent separately.** Give each agent a name so traces show which worker spent which tokens.
8. **Evaluate the system and the parts.** Score the final answer and also each worker on its own subtask.

## Risks and open questions

**Costs grow quickly.** Anthropic's reported figure of about 15 times the tokens of a chat is a warning: a multi-agent design has to buy real gains in quality or speed to be worth it.

**Errors compound across agents.** If a worker returns a wrong fact with confidence, the supervisor will usually build on it. Structured outputs and spot checks help, but there is no complete fix.

**Context is easy to get wrong in handoffs.** Dropping or duplicating messages during a transfer causes subtle failures, including provider errors for unmatched tool calls.

**Library churn.** Older helper packages such as `langgraph-supervisor` are now a second choice to plain tool calling, so check current guidance before adopting a wrapper.

**Watch next:** how agent-to-agent protocols standardise handoffs across vendors, and whether frameworks add built-in budgets that span a whole multi-agent run rather than a single agent.

## Frequently asked questions

### What is the difference between a supervisor and a swarm?

In a supervisor (subagents) design, one main agent calls the others as tools and always gets control back. In a swarm (handoffs) design, the active agent transfers control to another agent, which then talks to the user directly until it hands off again. The swarm remembers the last active agent between turns.

### Do subagents run in parallel?

They can. If the main agent emits several tool calls in one message, the LangChain agent runs them in the same tool step. In the timing test for this article, two one-second tools finished in 1.01 seconds.

### Why does the supervisor pattern use more model calls on simple requests?

The supervisor makes a call to decide to delegate and another to write the final answer, on top of the worker's own call. For a one-shot request that adds up to 4 calls against 3 for handoffs or a router in the LangChain comparison.

### Should I still use langgraph-supervisor?

Its README now recommends implementing the supervisor directly with tools for most cases, because that gives more control over what each agent sees. Existing code can keep using it, but new projects can follow the plain tool-calling pattern shown in this article.

### How many agents is too many?

There is no fixed number. Add an agent only when it isolates a real body of context or enables real parallel work, and measure the effect on success rate, latency and tokens against the simpler design.

## Summary

Multi-agent systems split work so that each agent sees less context or so that independent tasks run in parallel. The five common patterns are subagents, handoffs, skills, routers and custom workflows. The offline demos showed a supervisor running two specialists concurrently in four model calls and a handoff moving a support request with a `Command` that updates `active_agent`. The LangChain comparison shows the trade-off in numbers: stateful patterns save calls on repeated requests, while subagents and routers save tokens on multi-domain work. Start with one agent, split only for a measured reason, and bound every loop.

## Sources

- [LangChain Docs: Multi-agent overview](https://docs.langchain.com/oss/python/langchain/multi-agent)
- [LangChain Docs: Subagents](https://docs.langchain.com/oss/python/langchain/multi-agent/subagents)
- [LangChain Docs: Handoffs](https://docs.langchain.com/oss/python/langchain/multi-agent/handoffs)
- [Anthropic Engineering: How we built our multi-agent research system](https://www.anthropic.com/engineering/multi-agent-research-system)
- [PyPI: langgraph-supervisor](https://pypi.org/project/langgraph-supervisor/)
- [PyPI: langgraph-swarm](https://pypi.org/project/langgraph-swarm/)
- [PyPI: openai-agents](https://pypi.org/project/openai-agents/)
- [PyPI: agent-framework](https://pypi.org/project/agent-framework/)
- [PyPI: langgraph](https://pypi.org/project/langgraph/)
