{"slug": "multi-agent-architectures-supervisor-vs-hierarchical-handoff-models-in-langgraph", "title": "Multi-Agent Architectures: Supervisor vs. Hierarchical Handoff Models in LangGraph", "summary": "A developer compared two multi-agent coordination patterns in LangGraph — a supervisor that keeps control and calls workers as tools, versus a hierarchical handoff model where agents transfer the turn to other nodes, possibly in a parent graph — using the framework's 2026 APIs. The writeup includes working Python for both, noting that langgraph-supervisor's create_supervisor and create_handoff_tool are now built on create_agent, that create_react_agent has been replaced, and that the old output_mode argument now lives in the tool wrapper.", "body_md": "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.\n\nThat 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:\n\n`langgraph-supervisor` package (`create_supervisor`, `create_handoff_tool`) is `create_agent` supervisor that calls workers wrapped as tools.`Command(goto=..., graph=Command.PARENT)`.` create_react_agent` has been replaced by 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.\n\n*the two coordination models · supervisor hub vs nested handoff graphs*\n\nOn 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.\n\nA 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:\n\n`interrupt()` to ask for input.\nA 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.\n\n``` python\nfrom langchain.agents import create_agent\nfrom langchain.tools import tool\nfrom langgraph.checkpoint.memory import InMemorySaver\n\nMODEL = \"anthropic:claude-sonnet-5\"\n\n# 1. Specialist workers: each is an ordinary agent with its own tools and prompt\nresearch_agent = create_agent(\n    model=MODEL,\n    tools=[web_search, fetch_page],\n    system_prompt=(\n        \"You are a research specialist. Return a bullet list of findings \"\n        \"with a source URL for each. The supervisor only sees your final message.\"\n    ),\n)\n\nwriter_agent = create_agent(\n    model=MODEL,\n    tools=[],\n    system_prompt=\"You turn research notes into a clear 300-word brief.\",\n)\n\n# 2. Wrap each worker as a tool. The docstring is the routing signal.\n@tool(\"research\", description=\"Find facts and sources on a topic.\")\ndef call_research(query: str) -> str:\n    result = research_agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": query}]})\n    return result[\"messages\"][-1].content   # last-message output mode\n\n@tool(\"write_brief\", description=\"Write a brief from research notes.\")\ndef call_writer(notes: str) -> str:\n    result = writer_agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": notes}]})\n    return result[\"messages\"][-1].content\n\n# 3. The supervisor: the only agent with a checkpointer\nsupervisor = create_agent(\n    model=MODEL,\n    tools=[call_research, call_writer],\n    system_prompt=(\n        \"You coordinate a research specialist and a writer. \"\n        \"Research first, then hand the notes to the writer, then reply to the user.\"\n    ),\n    checkpointer=InMemorySaver(),\n)\n\nconfig = {\"configurable\": {\"thread_id\": \"brief-42\"}}\nsupervisor.invoke(\n    {\"messages\": [{\"role\": \"user\", \"content\": \"Brief me on LangGraph checkpointers\"}]},\n    config,\n)\n```\n\nThe 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:\n\n``` python\nfrom typing import Annotated\nfrom langchain.messages import ToolMessage\nfrom langchain.tools import InjectedToolCallId\nfrom langgraph.types import Command\n\n@tool(\"research\", description=\"Find facts and sources on a topic.\")\ndef call_research(query: str, tool_call_id: Annotated[str, InjectedToolCallId]) -> Command:\n    result = research_agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": query}]})\n    return Command(update={\n        \"sources\": result.get(\"sources\", []),          # extra state for the supervisor\n        \"messages\": [ToolMessage(content=result[\"messages\"][-1].content,\n                                 tool_call_id=tool_call_id)],\n    })\n```\n\nThe 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.\n\nWhen 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.\n\nIn 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.\n\nThe 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.\n\nIts main traits:\n\n`active_agent` persists across turns through the checkpointer.`Command.PARENT` goes up exactly one level. Crossing two levels needs one `Command` per level.\nAn 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.\n\nA front desk triages, a billing team (invoices and refunds) and a tech team handle the work, and billing can escalate to tech.\n\n``` python\nfrom typing import Literal\nfrom typing_extensions import NotRequired\n\nfrom langchain.agents import AgentState, create_agent\nfrom langchain.messages import AIMessage, ToolMessage\nfrom langchain.tools import tool, ToolRuntime\nfrom langgraph.graph import StateGraph, START, END\nfrom langgraph.types import Command\nfrom langgraph.checkpoint.memory import InMemorySaver\n\nMODEL = \"anthropic:claude-sonnet-5\"\n\nclass OrgState(AgentState):          # messages already uses the add_messages reducer\n    active_agent: NotRequired[str]   # who owns the turn inside a team\n    next_team: NotRequired[str]      # set when a team escalates upward\n\ndef handoff_pair(runtime: ToolRuntime, note: str) -> list:\n    \"\"\"The AIMessage that made the call + the ToolMessage that answers it.\"\"\"\n    last_ai = next(m for m in reversed(runtime.state[\"messages\"]) if isinstance(m, AIMessage))\n    return [last_ai, ToolMessage(content=note, tool_call_id=runtime.tool_call_id)]\n\n# --- Level 2: lateral handoffs inside the billing team -----------------------\n@tool\ndef transfer_to_refunds(runtime: ToolRuntime) -> Command:\n    \"\"\"Hand the customer to the refunds specialist.\"\"\"\n    return Command(\n        goto=\"refunds_agent\",\n        update={\"active_agent\": \"refunds_agent\",\n                \"messages\": handoff_pair(runtime, \"Transferred to refunds\")},\n        graph=Command.PARENT,          # parent of this agent = the billing team graph\n    )\n\n@tool\ndef transfer_to_invoices(runtime: ToolRuntime) -> Command:\n    \"\"\"Hand the customer to the invoices specialist.\"\"\"\n    return Command(\n        goto=\"invoices_agent\",\n        update={\"active_agent\": \"invoices_agent\",\n                \"messages\": handoff_pair(runtime, \"Transferred to invoices\")},\n        graph=Command.PARENT,\n    )\n\n@tool\ndef escalate_to_tech(runtime: ToolRuntime) -> Command:\n    \"\"\"The problem is technical, not billing. Leave the billing team.\"\"\"\n    return Command(\n        goto=\"exit_team\",              # a team-level node does the second hop\n        update={\"next_team\": \"tech_team\",\n                \"messages\": handoff_pair(runtime, \"Escalating to tech support\")},\n        graph=Command.PARENT,\n    )\n\ninvoices_agent = create_agent(MODEL, tools=[lookup_invoice, transfer_to_refunds, escalate_to_tech],\n                              system_prompt=\"You explain invoices.\", name=\"invoices_agent\")\nrefunds_agent = create_agent(MODEL, tools=[issue_refund, transfer_to_invoices, escalate_to_tech],\n                             system_prompt=\"You process refunds.\", name=\"refunds_agent\")\n\ndef as_node(agent):\n    def node(state: OrgState):\n        return agent.invoke(state)\n    return node\n\nBILLING = (\"invoices_agent\", \"refunds_agent\")\n\ndef billing_entry(state: OrgState) -> str:\n    active = state.get(\"active_agent\")\n    return active if active in BILLING else \"invoices_agent\"\n\ndef after_billing_agent(state: OrgState) -> str:\n    last = state[\"messages\"][-1]\n    if isinstance(last, AIMessage) and not last.tool_calls:\n        return END                     # the agent answered the user: turn over\n    return billing_entry(state)\n\ndef exit_team(state: OrgState) -> Command[Literal[\"tech_team\"]]:\n    \"\"\"Second hop: from the team graph up to the org graph.\"\"\"\n    return Command(goto=state[\"next_team\"], update={\"active_agent\": None},\n                   graph=Command.PARENT)\n\nbilling = StateGraph(OrgState)\nbilling.add_node(\"invoices_agent\", as_node(invoices_agent))\nbilling.add_node(\"refunds_agent\", as_node(refunds_agent))\nbilling.add_node(\"exit_team\", exit_team)\nbilling.add_conditional_edges(START, billing_entry, list(BILLING))\nfor name in BILLING:\n    billing.add_conditional_edges(name, after_billing_agent, [*BILLING, END])\nbilling_team = billing.compile()       # no checkpointer: inherits the parent's\n\ntech_team = build_tech_team()          # same shape: its own agents and handoff tools\n\n# --- Level 1: the org graph ---------------------------------------------------\n@tool\ndef transfer_to_billing_team(runtime: ToolRuntime) -> Command:\n    \"\"\"Invoices, charges and refunds.\"\"\"\n    return Command(goto=\"billing_team\",\n                   update={\"messages\": handoff_pair(runtime, \"Routed to billing\")},\n                   graph=Command.PARENT)\n\n@tool\ndef transfer_to_tech_team(runtime: ToolRuntime) -> Command:\n    \"\"\"Bugs, outages and login problems.\"\"\"\n    return Command(goto=\"tech_team\",\n                   update={\"messages\": handoff_pair(runtime, \"Routed to tech support\")},\n                   graph=Command.PARENT)\n\nfront_desk = create_agent(MODEL, tools=[transfer_to_billing_team, transfer_to_tech_team],\n                          system_prompt=\"Greet the customer and route them to the right team.\")\n\norg = StateGraph(OrgState)\norg.add_node(\"front_desk\", as_node(front_desk))\norg.add_node(\"billing_team\", billing_team)   # compiled subgraph = a node (shared state keys)\norg.add_node(\"tech_team\", tech_team)\norg.add_edge(START, \"front_desk\")\n# No static edges out of the team nodes: they route with Command, and the docs warn\n# that static edges from the same node would still run alongside it.\ngraph = org.compile(checkpointer=InMemorySaver())\n```\n\n*escalation path in the support-org example · 3 graph levels, 4 steps*\n\nThe 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.\n\nThree 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.\n\nThe 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.\n\nThe 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.\n\n| Dimension | Supervisor (subagents as tools) | Hierarchical handoff (Command.PARENT) | \n|---|---|---|\n| Who holds control | The supervisor, always | Whichever agent holds the turn | \n| Who talks to the user | Supervisor only (workers via `interrupt()` ) | The active agent, directly | \n| Context per agent | Isolated: each call starts clean | Shared message history; you filter at each handoff | \n| Parallel work | Yes, several tool calls per turn | No, one agent at a time | \n| Multi-hop chains | Yes, the supervisor sequences them | Yes, agents pass the turn along | \n| State across turns | Kept by the supervisor; workers stateless by default | `active_agent` persists, so the next turn skips re-routing | \n| Adding an agent | One new tool (or a registry entry) | New node, plus handoff tools in every agent that may reach it | \n| Debugging | One decision point to trace | Control path spread across agents and levels | \n| Typical fit | Research, analysis, multi-domain synthesis | Support desks, intake flows, step-gated processes | \n\nIn 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.\n\n*LangChain multi-agent overview, performance comparison · 3 scenarios, model calls (tokens for multi-domain)*\n\nStateful 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.\n\nBoth 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.\n\n| Subgraph `checkpointer=` | Mode | Behaviour | Use it for | \n|---|---|---|---|\n| `None` (default) | Per-invocation | Fresh each call; supports interrupts within the call | Most workers and teams | \n| `True` | Per-thread | History accumulates on the thread | A worker that must remember earlier calls | \n| `False` | Stateless | Plain function call, no interrupts | Pure, fast transforms | \n\nThree consequences differ by model:\n\n`__interrupt__` on the outer graph. Resume it with `graph.invoke(Command(resume=value), config)`.` get_state(..., subgraphs=True)` will not show their state. Team subgraphs added as nodes in a handoff hierarchy `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.\n\n```\nconfig = {\"configurable\": {\"thread_id\": \"ticket-981\"}}\n\nresult = graph.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"Refund order 5521\"}]}, config)\nif \"__interrupt__\" in result:            # e.g. refunds_agent asked for approval\n    graph.invoke(Command(resume={\"approved\": True}), config)\n\n# Handoff hierarchy only: inspect each level's state\nstate = graph.get_state(config, subgraphs=True)\n```\n\nStart 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.\n\n*choosing a coordination model · 3 questions, 4 outcomes*\n\nRead it top down: each \"yes\" to user contact pushes you toward handoffs, and only teams with their own routing justify a second level.\n\nThe two models compose, because a whole graph can be a tool and a whole agent can be a node:\n\n`@tool` that invokes it and returns the final message. The supervisor sees one tool; the team keeps its own lateral routing.`StateGraph` around both.\nBefore 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.\n\nThe supervisor trades speed for control; the handoff hierarchy trades control for a natural conversation. Each one's strengths are the other's weaknesses.\n\n| Advantages | Disadvantages | \n|---|---|\n| **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. | \n| **Clean context per worker.** Each call starts fresh, so a worker's long tool output never bloats the main conversation. | **Repeats work on follow-ups.** Workers are stateless by default, so \"do that again\" costs the full flow: 8 calls over two turns against 5 for handoffs. | \n| **Parallel fan-out.** Several workers run in one turn: about 9K tokens against 14K+ for handoffs on a three-domain task. | **The supervisor is a bottleneck.** If its prompt or routing is weak, every request suffers; it is a single point of failure for quality. | \n| **Easy to extend and to split across teams.** A new worker is one tool or one registry entry; teams can own and deploy workers independently. | **Workers cannot hold a conversation.** They reach the user only through`interrupt()` , and the supervisor rephrases everything they say. | \n| **Guardrails in one spot.** Approval, budgets and policy checks wrap the supervisor's tools. | **Lossy hand-back.** The supervisor sees only what the worker returns; a weak final message loses work. | \n| **Simple persistence.** One checkpointer on the supervisor; interrupts bubble up through any depth. | **Opaque worker state.** Workers called inside tools are invisible to`get_state(subgraphs=True)` . | \n\n| Advantages | Disadvantages | \n|---|---|\n| **Fewest calls in conversation.** The specialist answers the user directly, with no hop back through a coordinator. | **No parallelism.** One agent holds the turn at a time, so multi-domain work runs in series and costs more calls and tokens. | \n| **Sticky specialists.**`active_agent` persists, so the next user message goes straight to the right agent with no re-routing. | **Control is spread out.** Following a bug means tracing a path across agents and graph levels, not one decision point. | \n| **Natural, multi-turn dialogue.** The specialist keeps its own voice and can ask clarifying questions in-line. | **Context engineering is on you.** Every handoff must pass a valid`AIMessage` and`ToolMessage` pair, and you decide what history goes along. | \n| **Mirrors real organisations.** Teams own their internal routing, and escalation paths map to how support desks really work. | **Wiring grows with the graph.** Each new agent needs handoff tools in every agent that can reach it; cross-level jumps need one`Command` per level. | \n| **Enforces order.** Capabilities unlock only after a step completes, such as warranty checked before refund. | **Loops and ping-pong.** Two agents can bounce a user between them; you need guards such as a hop counter. | \n| **Inspectable levels.** Team subgraphs added as nodes are discoverable, with a checkpoint namespace per level. | **Shared-key pitfalls.** Keys written across levels need reducers on the parent, or updates collide. | \n\nUse a supervisor when the work is a *task* to complete. Use handoffs when the work is a *conversation* to hold. Read the request for these signals:\n\n| Signal in the requirements | Points to | Why | \n|---|---|---|\n| \"Research, compare, summarize, analyze across sources\" | Supervisor | Independent subtasks run in parallel with isolated context | \n| Several distinct domains or tool sets (calendar, email, CRM, database) | Supervisor | Tools split into focused workers; one agent stops choosing among dozens of tools | \n| Results must be combined, checked or ranked before the user sees them | Supervisor | Only a coordinator sees every result | \n| Workers built and shipped by different teams | Supervisor (single dispatch tool) | A registry adds workers without touching the coordinator | \n| Strict audit trail or one approval gate for all actions | Supervisor | Every action passes one decision point | \n| \"Transfer me to\", \"talk to billing\", departments, escalation | Handoffs | The specialist must own the conversation | \n| Steps must happen in order (verify, then act) | Handoffs, single agent + middleware | State unlocks tools only after the step completes | \n| Long multi-turn dialogue with one specialist | Handoffs | `active_agent` keeps the next turn with them, saving calls | \n| Departments with their own sub-specialists | Hierarchical handoffs | Teams own internal routing; escalation crosses levels | \n| A specialist is itself a complex graph (reflection, retrieval loop) | Handoffs, agent subgraphs | Bespoke graphs become nodes | \n| Fixed steps beside agents (validation, ETL, API calls) | Custom `StateGraph` wrapping either | Deterministic logic should not depend on an LLM's routing | \n\n**Use neither** when one agent with a handful of well-described tools does the job, or when skills loaded on demand cover the specialist knowledge. Multi-agent adds calls, latency and failure modes; add it when a single agent measurably starts picking the wrong tools or overflows its context.\n\nMost real systems sort along two questions: who talks to the user, and whether the work fans out or runs in steps. The map below places common use cases on those two axes. The catalogue then gives the architecture for each.\n\n*use-case map · 10 use cases from the catalogue below, placed by quadrant only*\n\nThe left half is supervisor territory and the right half is handoff territory. The top-right corner is where the two combine.\n\n| Use case | Model | Architecture | Key LangGraph pieces | \n|---|---|---|---|\n| Customer support desk (billing, tech, sales) | Hierarchical handoff | Front-desk triage agent in an org graph; each department a team subgraph; lateral handoffs inside a team; escalation through an exit node | `Command.PARENT` ,`active_agent` , team subgraphs,`interrupt()` for human takeover | \n| Warranty, refund or KYC intake | Handoff, single agent | One `create_agent` with a`current_step` key; middleware swaps prompt and tools at each step | `@wrap_model_call` ,`Command(update=...)` , checkpointer | \n| Research reports, due diligence, competitive analysis | Supervisor | Supervisor fans out search and analyst workers in parallel, then calls a writer worker; sources return as state | Parallel tool calls, stateless workers, `Command` with extra keys | \n| Personal or executive assistant (calendar, email, CRM) | Supervisor | One worker per domain; human approval before outbound actions such as sending email | Human-in-the-loop on worker tools, `interrupt()` | \n| Enterprise knowledge Q&A (GitHub, Notion, Slack) | Router, or supervisor for follow-ups | Classify the query, query source agents in parallel, synthesize; promote to a supervisor when answers need multi-step reasoning | Router step, tool-wrapped source agents | \n| Code review or PR pipeline | Custom `StateGraph` + supervisor | Deterministic fetch, lint and test nodes, then a supervisor runs security, performance and style reviewers in parallel; a merge node posts findings | `StateGraph` nodes, supervisor node, forked input to share the diff analysis | \n| IT helpdesk with departmental sub-specialists | Hybrid: hierarchical handoff + inner supervisor | Org graph routes to team subgraphs; each team's lead agent supervises its diagnostic workers | Team subgraph whose entry agent has tool-wrapped workers | \n| Sales assistant (qualify, demo, pricing, human closer) | Flat handoffs | One agent subgraph per stage; final handoff to a human | `active_agent` ,`interrupt()` | \n| Content pipeline (outline, draft, edit, SEO) | Supervisor, sequential | Supervisor sequences workers and loops the editor until it approves | Multi-hop tool calls, an iteration cap | \n| Data analytics or SQL assistant | Single agent + skills, or supervisor | Schema knowledge loaded as skills; a supervisor once questions span warehouse, BI and docs | Skills, a per-thread worker for session memory | \n\n**1. Support desk: hierarchical handoff**\n\n```\norg graph (StateGraph, checkpointer here only)\n├── front_desk          create_agent · tools: transfer_to_billing_team, transfer_to_tech_team\n├── billing_team        compiled StateGraph, no checkpointer\n│   ├── invoices_agent  ⇄ refunds_agent        lateral handoff, Command.PARENT\n│   └── exit_team       Command.PARENT → tech_team (second hop)\n└── tech_team           compiled StateGraph, no checkpointer\n    ├── diagnose_agent  ⇄ resolve_agent\n    └── human_takeover  interrupt() → resume with Command(resume=...)\n```\n\nAdd a hop counter in state so two agents cannot pass a customer back and forth forever.\n\n**2. Research report: supervisor with parallel workers**\n\n```\nsupervisor (create_agent, checkpointer)\n├── tool research(query)      → research_agent  [web_search, fetch_page]   called N times in one turn\n├── tool analyze(notes)       → analyst_agent   [python_repl]\n└── tool write_report(notes)  → writer_agent    []\nextra state returned through Command: sources[], open_questions[]\n```\n\nPrompt each worker to put its full results in its final message, since that is all the supervisor sees.\n\n**3. PR review: custom StateGraph wrapping a supervisor**\n\n```\nSTART → fetch_diff → run_linters → run_tests ──fail──→ report_failures → END\n                                       └──pass──→ review_supervisor (create_agent)\n                                                    ├── security_reviewer      (parallel)\n                                                    ├── performance_reviewer   (parallel)\n                                                    └── style_reviewer         (parallel)\n                                                  → merge_findings → post_comments (interrupt: approve) → END\n```\n\nThe deterministic steps never depend on an LLM's routing; agents only do the judgment work.\n\n| Symptom | Cause | Fix | \n|---|---|---|\n| Receiving agent errors or gives odd answers after a handoff | Tool call left without a matching result | Pass the `AIMessage` with the call plus a`ToolMessage` using the same`tool_call_id` | \n| Context balloons after a few handoffs | Whole internal history passed along | Pass only the handoff pair; summarize prior work in the `ToolMessage` text | \n| Supervisor \"forgets\" what a worker found | Results missing from the worker's final message | Tell the worker the supervisor only sees its final message, or return extra keys via `Command` | \n| `Command.PARENT` update overwrites or raises on a shared key | No reducer for that key on the parent | Add a reducer ( `messages` has one; define one for custom lists) | \n| A node runs twice or the graph will not end | `add_edge` from a node that also routes with`Command` | Route from that node with `Command` alone; static edges still run | \n| `interrupt()` is never surfaced, or resume fails | Inner agent has its own checkpointer, or no `thread_id` | Checkpointer on the outermost graph only; always pass `thread_id` | \n| Checkpoint conflicts on a stateful worker | Parallel calls to a `checkpointer=True` worker | Limit calls with `ToolCallLimitMiddleware` ; give each per-thread worker its own namespace | \n| Escalation lands in the wrong place | Expecting `Command.PARENT` to jump two levels | One `Command` per level, as in the`exit_team` node above | \n| Old tutorial code breaks | `create_supervisor` and`create_react_agent` are legacy | Move to `create_agent` with tool-wrapped workers (see the migration guide) | \n\nItems 1 to 12 are LangChain docs pages, researched through the LangChain docs MCP server on 25 November 2026; code examples follow pages 2, 3, 4, 7 and 9.", "url": "https://wpnews.pro/news/multi-agent-architectures-supervisor-vs-hierarchical-handoff-models-in-langgraph", "canonical_source": "https://dev.to/ahsanfarooq210/multi-agent-architectures-supervisor-vs-hierarchical-handoff-models-in-langgraph-565a", "published_at": "2026-11-28 17:36:54+00:00", "updated_at": "2026-11-28 17:44:08.741142+00:00", "lang": "en", "topics": ["ai-agents", "large-language-models", "ai-tools", "developer-tools"], "entities": ["LangGraph", "LangChain", "create_agent", "create_supervisor", "create_handoff_tool", "Command"], "also_reported_by": [], "takeaway": "In LangGraph's 2026 APIs, wrap each specialist worker as a tool returning only its last message for a lean supervisor context, or return a Command to pass extra state keys back, and use Command(goto=..., graph=Command.PARENT) for hierarchical handoffs.", "recommendation": {"advice": "Choose a supervisor when you need multi-turn reasoning with results returned each step, and hierarchical handoff when a team must escalate to a parent graph; wrap workers as tools and return last-message output to keep supervisor context lean.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/multi-agent-architectures-supervisor-vs-hierarchical-handoff-models-in-langgraph", "markdown": "https://wpnews.pro/news/multi-agent-architectures-supervisor-vs-hierarchical-handoff-models-in-langgraph.md", "text": "https://wpnews.pro/news/multi-agent-architectures-supervisor-vs-hierarchical-handoff-models-in-langgraph.txt", "jsonld": "https://wpnews.pro/news/multi-agent-architectures-supervisor-vs-hierarchical-handoff-models-in-langgraph.jsonld"}}