Supervisor vs swarm: who routes work and who answers the user
Updated November 2026
A supervisor is one agent that sends each task to a specialist and collects the result, so it owns the reply. In a swarm, agents pass control directly to each other, and whichever specialist holds control talks to the user. Have your agents report to a supervisor when you want routing in one place and specialists kept away from the user. Let them hand off as a swarm when specialists should run the conversation themselves.
At a glance
| Supervisor | swarm | |
|---|---|---|
| What it is | A supervisor has a central supervisor agent coordinating specialized agents, and in the langgraph-supervisor library that agent controls all communication flow and task delegation. | A swarm, as the langgraph-swarm library defines it, lets agents dynamically hand off control to one another based on their specializations. |
| Languages | A supervisor can be built with langgraph-supervisor, a Python library for hierarchical multi-agent systems on LangGraph. | A swarm can be built with langgraph-swarm, a Python library for swarm-style systems on LangGraph. |
| How agents are coordinated | A supervisor corresponds to the OpenAI Agents SDK pattern where a manager agent keeps control of the conversation and calls specialist agents through Agent.as_tool(). | The SDK's handoffs pattern has a triage agent route the conversation to a specialist that becomes the active agent for the rest of the turn. |
| Who talks to the user | A supervisor suits work where sub-agents don't need to converse directly with users, according to LangChain's supervisor tutorial. | LangChain's handoffs pattern lets each agent hand off to others or respond directly to the user. |
| Context passed to the next agent | A supervisor built from LangChain's tutorial gives sub-agents only the request string by default, while the langgraph-supervisor library's default handoff tool passes full message history. | A swarm made with langgraph-swarm hands over the whole message history by default, plus a tool message marking the handoff. |
| State and memory | A supervisor using langgraph-supervisor gets out-of-box short-term and long-term memory from LangGraph. | A swarm on langgraph-swarm needs a checkpointer in multi-turn use, because without short-term memory it would forget which agent was last active. |
| Human-in-the-loop | A supervisor in LangChain's tutorial lets a reviewer decide on pending actions, and its example accepts the calendar event but edits the subject of the outbound email. | A swarm built on OpenAI Agents SDK handoffs keeps the SDK's tool approvals, since that approval surface is run-wide and also applies to an agent reached through a handoff. |
| License | A supervisor written with langgraph-supervisor uses code under the MIT license. | A swarm from langgraph-swarm also ships under the MIT license. |
How does each one coordinate agents?
A supervisor sits on every path between the user and the specialists. LangChain's multi-agent guide says that in the subagents pattern routing passes through the main agent, which decides when and how to invoke each subagent. In its one-shot example, subagents adds one extra call because results flow back through the main agent, and the guide says this overhead provides centralized control. The supervisor agent pattern page covers the design in more depth.
In the langgraph-supervisor library you can control how worker messages are added to the overall conversation history. A forwarding tool can also send a worker's last message straight to the final output of the graph. The README says forwarding saves tokens for the supervisor and avoids potential misrepresentation of the worker's response through paraphrasing.
In a swarm, control itself moves between agents. In LangChain's handoffs pattern, agents transfer control to each other via tool calls. The OpenAI Agents SDK represents handoffs as tools to the LLM, so a handoff to Refund Agent becomes a tool named transfer_to_refund_agent. After the handoff, the new agent takes over and sees the entire previous conversation history unless you set an input_filter.
When should you choose a supervisor?
- Your work splits into separate domains with their own tools. LangChain's tutorial recommends the pattern for multiple distinct domains when you also want centralized workflow control.
- One agent should own the final answer. The OpenAI Agents SDK points to agents as tools when you want one agent to own the answer, combine outputs from multiple specialists, or enforce shared SDK guardrails in one place.
- Specialists should stay away from the user. The SDK says to use agents as tools when a specialist should help with a bounded subtask but should not take over the user-facing conversation.
- You need teams of teams. The langgraph-supervisor README shows a supervisor that manages multiple supervisors to form multi-level hierarchies.
When should you choose a swarm?
- The specialist should answer the user. The OpenAI Agents SDK recommends handoffs when you want the specialist to respond directly without the manager narrating the result.
- Your flow has stages the user moves through. LangChain suggests handoffs when the agent converses with the user across states or when you build multi-stage conversational flows.
- Steps must happen in a fixed order. LangChain's example is collecting a warranty ID before processing a refund.
- Context per hop should stay small. LangChain suggests passing only the handoff pair so the parent graph's context stays focused on high-level coordination.
Can you use them together?
Yes, the two patterns compose inside one system. The OpenAI Agents SDK says a triage agent might hand off to a specialist, and that specialist can still call other agents as tools for narrow subtasks. When a nested Agent.as_tool() call needs approval, the interruption still surfaces on the outer run, so you approve or reject it on the outer RunState.
On the LangChain side, the multi-agent guide describes a custom workflow pattern that lets you embed other patterns as nodes. A workable split puts a supervisor in charge of routing between domains and lets specialists inside one domain pass a live conversation between themselves. The handoffs pattern page covers that inner layer.
What should you watch out for?
- langgraph-supervisor is archived. GitHub shows the repository was archived by the owner and is read-only, and the README recommends the supervisor pattern directly via tools for most use cases.
- Supervisor workers can drop their results. LangChain names a common failure mode in sub-agents that perform tool calls but leave the results out of their final response.
- Handoffs can break the message history. In LangChain's subgraph handoffs, a tool call without its paired ToolMessage means the receiving agent will see an incomplete conversation and may produce errors or unexpected behavior; our guide to agent handoffs that don't drop context shows how to keep the pair intact.
- The docs say handoffs stay within a single run, input guardrails apply only to the first agent in the chain, and output guardrails only to the agent that produces the final output.
What else should you know?
Can a supervisor's workers see the earlier conversation?
In LangChain's tool-based supervisor tutorial, only if you pass it along, because sub-agents receive only the request string by default. The tutorial's example of passing more context lets sub-agents see the full conversation context, which can help resolve references to earlier turns.
Do I need a checkpointer for a swarm?
For multi-turn conversations, yes. The langgraph-swarm README says to always compile the swarm with a checkpointer if you plan to use it across turns.
What happens to a handoff if the process crashes?
The OpenAI Agents SDK docs describe a DBOS integration for agents that preserve progress across failures and restarts, and it supports handoffs. Approval of a tool call does not guarantee exactly-once execution, so resuming from an older approved snapshot can run the tool again.
Does a handoff strip sensitive data from the history?
In the OpenAI Agents SDK, nested handoff history is an opt-in beta, disabled by default, and it does not redact sensitive data. The docs suggest an input_filter to select or redact the content the receiving agent may see.
Which sources does this page use?
- langchain-ai/langgraph-supervisor-py (GitHub), reviewed November 2026
- langchain-ai/langgraph-swarm-py (GitHub), reviewed November 2026
- Agent orchestration (openai.github.io), reviewed November 2026
- Build a personal assistant with subagents (docs.langchain.com), reviewed November 2026
- Multi-agent (docs.langchain.com), reviewed November 2026
- langchain-ai/langgraph-swarm-py: README.md (GitHub), reviewed November 2026
- Human-in-the-loop (openai.github.io), reviewed November 2026
- Handoffs (openai.github.io), reviewed November 2026
- langchain-ai/langgraph-supervisor-py: README.md (GitHub), reviewed November 2026
- Handoffs (docs.langchain.com), reviewed November 2026
- Running agents (openai.github.io), reviewed November 2026