Why the coordination model matters

In a multi-agent system the hard question is who holds control after each step. A supervisor keeps it: workers do a job and report back. A hierarchical handoff model passes it on: an agent (or a whole team) transfers the conversation to another node, possibly in a parent graph, and that node now owns the turn.

That one choice drives latency, token cost, who talks to the user, and how hard the system is to debug. LangGraph supports both, but the recommended APIs moved in 2026, so older tutorials are a poor guide:

  • The langgraph-supervisor package (create_supervisor, create_handoff_tool) is no longer actively maintained. The docs now point to the subagents pattern: a create_agent supervisor that calls workers wrapped as tools.
  • Handoffs are now a first-class LangChain pattern. They are built either as one agent whose prompt and tools change with state (middleware), or as separate agent subgraphs that jump with Command(goto=..., graph=Command.PARENT).
  • create_react_agent has been replaced by create_agent in LangChain v1.

This article compares the two models using the current APIs. Each gets a diagram, working Python and the trade-offs that decide between them. The examples follow the official LangChain docs listed under References.

Two mental models at a glance

Two coordination models side by side. Left: a supervisor agent with two-way arrows to Worker A, Worker B and Worker C. Right: a hierarchical handoff graph where a front desk hands off to a billing team and a tech team inside an org graph.

the two coordination models · supervisor hub vs nested handoff graphs

On the left, every arrow runs both ways: the supervisor sends work out and gets the result back. On the right, arrows mostly run one way: the turn moves to the next agent, and a team escalates by jumping up to the org graph.

The supervisor model

A supervisor is a full agent that keeps the conversation and calls workers as tools. Every result comes back to it, and it decides the next step. LangChain's docs call this the subagents pattern, and its main traits are:

  • Centralized control. All routing passes through the main agent.
  • No direct user contact. Workers return results to the supervisor, not the user. A worker can still pause with interrupt() to ask for input.
  • Context isolation. By default each worker call starts with a clean context window, so the supervisor's history does not bloat.
  • Parallel fan-out. The supervisor can call several workers in one turn.

A supervisor is not a router. A router is usually a single classification step that dispatches once. A supervisor reasons over several turns and can call workers in sequence, each step shaped by the last result.

Example: a research-and-writing supervisor

from langchain.agents import create_agent from langchain.tools import tool from langgraph.checkpoint.memory import InMemorySaver MODEL = "anthropic:claude-sonnet-5" # 1. Specialist workers: each is an ordinary agent with its own tools and prompt research_agent = create_agent( model=MODEL, tools=[web_search, fetch_page], system_prompt=( "You are a research specialist. Return a bullet list of findings " "with a source URL for each. The supervisor only sees your final message." ), ) writer_agent = create_agent( model=MODEL, tools=[], system_prompt="You turn research notes into a clear 300-word brief.", ) # 2. Wrap each worker as a tool. The docstring is the routing signal. @tool("research", description="Find facts and sources on a topic.") def call_research(query: str) -> str: result = research_agent.invoke({"messages": [{"role": "user", "content": query}]}) return result["messages"][-1].content # last-message output mode @tool("write_brief", description="Write a brief from research notes.") def call_writer(notes: str) -> str: result = writer_agent.invoke({"messages": [{"role": "user", "content": notes}]}) return result["messages"][-1].content # 3. The supervisor: the only agent with a checkpointer supervisor = create_agent( model=MODEL, tools=[call_research, call_writer], system_prompt=( "You coordinate a research specialist and a writer. " "Research first, then hand the notes to the writer, then reply to the user." ), checkpointer=InMemorySaver(), ) config = {"configurable": {"thread_id": "brief-42"}} supervisor.invoke( {"messages": [{"role": "user", "content": "Brief me on LangGraph checkpointers"}]}, config, ) 

Shaping what flows back

The old output_mode argument (full_history or last_message) now lives in the tool wrapper. Return the last message for a lean supervisor context, or return a Command to send extra state keys back as well:

from typing import Annotated from langchain.messages import ToolMessage from langchain.tools import InjectedToolCallId from langgraph.types import Command @tool("research", description="Find facts and sources on a topic.") def call_research(query: str, tool_call_id: Annotated[str, InjectedToolCallId]) -> Command: result = research_agent.invoke({"messages": [{"role": "user", "content": query}]}) return Command(update={ "sources": result.get("sources", []), # extra state for the supervisor "messages": [ToolMessage(content=result["messages"][-1].content, tool_call_id=tool_call_id)], }) 

The docs flag one failure mode in particular: a worker does the tool calls but leaves the results out of its final message. The supervisor sees only that final message, so say so in the worker's prompt.

When workers are many or owned by different teams, use a single dispatch tool in place of one tool per worker. That is one task(agent_name, description) tool backed by a registry, so new workers do not change the supervisor.

The hierarchical handoff model

In a handoff model, an agent's tool call transfers control. The receiving agent takes over the conversation and answers the user directly. The term handoff comes from OpenAI's Agents SDK (tools such as transfer_to_sales_agent), and LangChain now uses it for the same idea.

The mechanism is a tool that returns a Command. It updates state (usually an active_agent key) and names the next node. Adding graph=Command.PARENT makes the jump target a node in the enclosing graph rather than the agent's own loop. Stack those graphs and you get a hierarchy: agents hand off laterally inside a team, and a team hands off upward to another team.

Its main traits:

  • Decentralized control. Whoever holds the turn decides the next hop. No central agent sees every step.
  • Direct user interaction. The active agent talks to the user, and the next user message goes back to it.
  • State-driven routing. active_agent persists across turns through the checkpointer.
  • Scoped jumps. Command.PARENT goes up exactly one level. Crossing two levels needs one Command per level.

Rule one: keep the message history valid

An LLM expects every tool call to be paired with its result. A handoff tool that jumps with Command.PARENT must therefore pass both the AIMessage holding the tool call and a ToolMessage acknowledging it. Pass only that pair, not the agent's whole internal history. The receiving agent otherwise inherits reasoning it cannot use, and token cost grows.

Example: a support org with two teams

A front desk triages, a billing team (invoices and refunds) and a tech team handle the work, and billing can escalate to tech.

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 langgraph.checkpoint.memory import InMemorySaver MODEL = "anthropic:claude-sonnet-5" class OrgState(AgentState): # messages already uses the add_messages reducer active_agent: NotRequired[str] # who owns the turn inside a team next_team: NotRequired[str] # set when a team escalates upward def handoff_pair(runtime: ToolRuntime, note: str) -> list: """The AIMessage that made the call + the ToolMessage that answers it.""" last_ai = next(m for m in reversed(runtime.state["messages"]) if isinstance(m, AIMessage)) return [last_ai, ToolMessage(content=note, tool_call_id=runtime.tool_call_id)] # --- Level 2: lateral handoffs inside the billing team ----------------------- @tool def transfer_to_refunds(runtime: ToolRuntime) -> Command: """Hand the customer to the refunds specialist.""" return Command( goto="refunds_agent", update={"active_agent": "refunds_agent", "messages": handoff_pair(runtime, "Transferred to refunds")}, graph=Command.PARENT, # parent of this agent = the billing team graph ) @tool def transfer_to_invoices(runtime: ToolRuntime) -> Command: """Hand the customer to the invoices specialist.""" return Command( goto="invoices_agent", update={"active_agent": "invoices_agent", "messages": handoff_pair(runtime, "Transferred to invoices")}, graph=Command.PARENT, ) @tool def escalate_to_tech(runtime: ToolRuntime) -> Command: """The problem is technical, not billing. Leave the billing team.""" return Command( goto="exit_team", # a team-level node does the second hop update={"next_team": "tech_team", "messages": handoff_pair(runtime, "Escalating to tech support")}, graph=Command.PARENT, ) invoices_agent = create_agent(MODEL, tools=[lookup_invoice, transfer_to_refunds, escalate_to_tech], system_prompt="You explain invoices.", name="invoices_agent") refunds_agent = create_agent(MODEL, tools=[issue_refund, transfer_to_invoices, escalate_to_tech], system_prompt="You process refunds.", name="refunds_agent") def as_node(agent): def node(state: OrgState): return agent.invoke(state) return node BILLING = ("invoices_agent", "refunds_agent") def billing_entry(state: OrgState) -> str: active = state.get("active_agent") return active if active in BILLING else "invoices_agent" def after_billing_agent(state: OrgState) -> str: last = state["messages"][-1] if isinstance(last, AIMessage) and not last.tool_calls: return END # the agent answered the user: turn over return billing_entry(state) def exit_team(state: OrgState) -> Command[Literal["tech_team"]]: """Second hop: from the team graph up to the org graph.""" return Command(goto=state["next_team"], update={"active_agent": None}, graph=Command.PARENT) billing = StateGraph(OrgState) billing.add_node("invoices_agent", as_node(invoices_agent)) billing.add_node("refunds_agent", as_node(refunds_agent)) billing.add_node("exit_team", exit_team) billing.add_conditional_edges(START, billing_entry, list(BILLING)) for name in BILLING: billing.add_conditional_edges(name, after_billing_agent, [*BILLING, END]) billing_team = billing.compile() # no checkpointer: inherits the parent's tech_team = build_tech_team() # same shape: its own agents and handoff tools # --- Level 1: the org graph --------------------------------------------------- @tool def transfer_to_billing_team(runtime: ToolRuntime) -> Command: """Invoices, charges and refunds.""" return Command(goto="billing_team", update={"messages": handoff_pair(runtime, "Routed to billing")}, graph=Command.PARENT) @tool def transfer_to_tech_team(runtime: ToolRuntime) -> Command: """Bugs, outages and login problems.""" return Command(goto="tech_team", update={"messages": handoff_pair(runtime, "Routed to tech support")}, graph=Command.PARENT) front_desk = create_agent(MODEL, tools=[transfer_to_billing_team, transfer_to_tech_team], system_prompt="Greet the customer and route them to the right team.") org = StateGraph(OrgState) org.add_node("front_desk", as_node(front_desk)) org.add_node("billing_team", billing_team) # compiled subgraph = a node (shared state keys) org.add_node("tech_team", tech_team) org.add_edge(START, "front_desk") # No static edges out of the team nodes: they route with Command, and the docs warn # that static edges from the same node would still run alongside it. graph = org.compile(checkpointer=InMemorySaver()) 

Escalation takes two hops, one Command.PARENT per level: front_desk jumps to billing_team (1), invoices_agent calls escalate_to_tech (2), Command.PARENT climbs into exit_team (3), and exit_team returns Command.PARENT again into the org graph's tech_team (4).

escalation path in the support-org example · 3 graph levels, 4 steps

The escalation path, hop by hop: the tool can only reach its own team graph, so exit_team exists to carry the turn up the second level.

Three details make this work. Each Command.PARENT climbs exactly one level, so escalation is two hops: the tool jumps to exit_team, and exit_team jumps to the org graph. Shared keys that a subgraph writes into its parent need a reducer on the parent; messages has one already. And only the outermost graph gets a checkpointer.

The lighter alternative: one agent, many configurations

The docs recommend a single agent with middleware for most handoff cases. One create_agent keeps a current_step key, and a @wrap_model_call middleware swaps the system prompt and tool list for each step. Tools move the step forward with Command(update={"current_step": ...}). Keep separate subgraphs for agents that are complex graphs in their own right, such as one with a reflection or retrieval loop.

Head to head

The supervisor buys control, isolation and parallelism with an extra model call on every request. Handoffs buy conversational speed with weaker isolation and no parallel fan-out.

Dimension Supervisor (subagents as tools) Hierarchical handoff (Command.PARENT)
Who holds control The supervisor, always Whichever agent holds the turn
Who talks to the user Supervisor only (workers via interrupt()) The active agent, directly
Context per agent Isolated: each call starts clean Shared message history; you filter at each handoff
Parallel work Yes, several tool calls per turn No, one agent at a time
Multi-hop chains Yes, the supervisor sequences them Yes, agents pass the turn along
State across turns Kept by the supervisor; workers stateless by default active_agent persists, so the next turn skips re-routing
Adding an agent One new tool (or a registry entry) New node, plus handoff tools in every agent that may reach it
Debugging One decision point to trace Control path spread across agents and levels
Typical fit Research, analysis, multi-domain synthesis Support desks, intake flows, step-gated processes

In LangChain's own scoring, the subagents pattern rates five of five on distributed development, parallelization and multi-hop, but one of five on direct user interaction. Handoffs rate five of five on multi-hop and user interaction and offer no parallelization.

Bar chart of LLM calls per request. One-shot request: supervisor 4, handoffs 3. Repeat request over 2 turns: supervisor 8, handoffs 5. Multi-domain, 3 domains: supervisor 5, handoffs 7 or more.

LangChain multi-agent overview, performance comparison · 3 scenarios, model calls (tokens for multi-domain)

Stateful handoffs skip re-routing on a repeat request because the active agent is still in place. The supervisor repeats its full flow every time, but in parallel, isolated calls it processes about a third fewer tokens on multi-domain work.

State, persistence and interrupts across levels

Both models follow one rule: compile only the outermost graph with a checkpointer and pass a thread_id on every call. Inner agents and team subgraphs are compiled without one. They then use per-invocation persistence: each call starts fresh but inherits the parent's checkpointer, which is what lets interrupt() and durable execution work inside them.

Subgraph checkpointer= Mode Behaviour Use it for
None (default) Per-invocation Fresh each call; supports interrupts within the call Most workers and teams
True Per-thread History accumulates on the thread A worker that must remember earlier calls
False Stateless Plain function call, no interrupts Pure, fast transforms

Three consequences differ by model:

  • Interrupts propagate in both. An interrupt() deep inside a worker tool bubbles up through every create_agent layer and surfaces as __interrupt__ on the outer graph. Resume it with graph.invoke(Command(resume=value), config).
  • State inspection differs. A supervisor calls workers inside tool functions, so LangGraph cannot discover them statically and get_state(..., subgraphs=True) will not show their state. Team subgraphs added as nodes in a handoff hierarchy are discoverable, with a checkpoint namespace per level.
  • Per-thread workers need care. A checkpointer=True worker must not be called in parallel, because both calls write to the same namespace. Cap it with ToolCallLimitMiddleware, and give each distinct per-thread worker its own namespace.
config = {"configurable": {"thread_id": "ticket-981"}} result = graph.invoke({"messages": [{"role": "user", "content": "Refund order 5521"}]}, config) if "__interrupt__" in result: # e.g. refunds_agent asked for approval graph.invoke(Command(resume={"approved": True}), config) # Handoff hierarchy only: inspect each level's state state = graph.get_state(config, subgraphs=True) 

How to choose

Start from one question: does a specialist need to hold a conversation with the user? If not, use a supervisor. If yes, use handoffs, and add levels only when teams need their own internal routing.

Decision flow. Must a specialist talk to the user? No: supervisor. Yes: are agents just different prompts and tools? Yes: single agent with handoff middleware. No: does each team need its own routing? No: flat handoffs. Yes: hierarchical handoffs.

choosing a coordination model · 3 questions, 4 outcomes

Read it top down: each "yes" to user contact pushes you toward handoffs, and only teams with their own routing justify a second level.

Hybrids are normal

The two models compose, because a whole graph can be a tool and a whole agent can be a node:

  • Handoffs at the edge, a supervisor inside. A front desk hands the customer to a "research desk" agent. That agent is itself a supervisor that fans out to three workers in parallel, then answers the user.
  • A supervisor over handoff teams. Wrap a compiled handoff team in a @tool that invokes it and returns the final message. The supervisor sees one tool; the team keeps its own lateral routing.
  • A custom StateGraph around both. Put deterministic steps such as validation, fixed routing or an API call beside agent nodes. The migration guide recommends this when you need shared state keys between levels or per-tier checkpoint namespaces.

Before any of these, check whether you need more than one agent at all. A single agent with the right tools, or with skills loaded on demand, often matches a multi-agent design at lower cost.

Advantages and disadvantages

The supervisor trades speed for control; the handoff hierarchy trades control for a natural conversation. Each one's strengths are the other's weaknesses.

Supervisor (subagents as tools)

Advantages Disadvantages
One place to reason and trace. Every decision is a supervisor tool call, so a single LangSmith trace shows the whole plan. An extra model call on every request. The result passes back through the supervisor before the user sees it: 4 calls against 3 for a one-shot request.Source:https://dev.to/ahsanfarooq210/multi-agent-architectures-supervisor-vs-hierarchical-handoff-models-in-langgraph-565a

Related posts