LangGraph Multi-Agent Swarm

Coordinate specialized agents through dynamic handoffs and persistent conversational state.

Stars
★ 1.6k
Last updated
1mo ago langgraph-swarm==0.1.0
FARS reviewed
Nov 08, 2026
License
MIT
Primary language
Python

At a glance

How it runs
Library / SDKFramework
Works with
Portable with changesOpenAI API
Cost
Free software; you pay for model usage
Setup effort
Low · running in minutes
You'll need
Pythonlanggraph-swarmLangGraphlangchain-openaiShell / CLINetwork access
Typical use
A Python team building customer support can route a conversation among billing and technical specialists while retaining the currently responsible agent across turns.
Not a fit if
  • Teams wanting a managed service or standalone server
  • Those needing per-agent context isolation by default
Website
langchain-ai.github.io ↗ set on GitHub
Maintenance
Commits in the last 6 monthslast commit 2026-10-28latest release langgraph-swarm==0.1.0 (2025-12-04)+0.6 ★/day over 7 days

What does this agent do, and when should you use it?

LangGraph Multi-Agent Swarm is a Python library for building swarm-style multi-agent applications. It combines specialized agents into a LangGraph StateGraph with create_swarm, while create_handoff_tool lets those agents transfer control and context to one another. The router tracks the last active agent so a later turn can resume with that agent when checkpointing is configured. The graph must be compiled before invocation and can use LangGraph checkpointers, stores, streaming, and human-in-the-loop facilities. This is an application-level orchestration library rather than a hosted service: adopters remain responsible for model access, agent definitions, persistence, and deployment.

A developer creates individual agents with langchain.agents.create_agent or custom StateGraph implementations, assigning each its own tools and system prompt. create_handoff_tool adds callable transfers between agents; by default, a handoff forwards the complete swarm message history and appends a successful-handoff ToolMessage. create_swarm([alice, bob], default_active_agent="Alice") assembles the parent StateGraph and tracks its current controller through active_agent. The developer compiles it with workflow.compile(checkpointer=..., store=...) to add short-term or long-term memory, then sends messages through app.invoke({"messages": [...]}, config) and receives the resulting workflow state. For isolated histories or specialized schemas, developers can wrap child graphs with state transformations and construct routing explicitly through add_active_agent_router.

  1. A Python team building customer support can route a conversation among billing and technical specialists while retaining the currently responsible agent across turns.
  2. An application developer can give math, language, or other domain agents distinct prompts and tools, then let the model initiate handoffs according to specialization.
  3. A team that cannot expose every agent's internal history can define separate message keys and transform state at each parent-to-child graph boundary.
  4. Existing LangGraph users can add a checkpointer for resumable conversations and a store for memory that persists across threads.
  5. Engineers designing structured delegation can customize a handoff tool so the calling model supplies a task description or other context for the next agent.

Key setup facts

Pulled from the install and usage notes below. The project README has the current values.

Install / run
  • pip install langgraph-swarm
  • pip install langgraph-swarm langchain-openai
Environment variables
OPENAI_API_KEY

How do you install or deploy this agent?

A Python environment is required. Install the library with:

pip install langgraph-swarm

To run the documented OpenAI example, install its adapter and provide an API key:

pip install langgraph-swarm langchain-openai
export OPENAI_API_KEY=<your_api_key>

How do you use this agent?

Instantiate ChatOpenAI(model="gpt-4o"), then define named agents with create_agent, adding a create_handoff_tool for each allowed transfer. Build the workflow with create_swarm([alice, bob], default_active_agent="Alice"). For a multi-turn application, compile it with InMemorySaver or another checkpointer: app = workflow.compile(checkpointer=checkpointer). Invoke it using a stable thread configuration such as config = {"configurable": {"thread_id": "1"}}, followed by app.invoke({"messages": [{"role": "user", "content": "i'd like to speak to Bob"}]}, config). Reuse that thread_id on later turns so the saved conversation and active-agent state can be restored.

Safety boundaries, hardening & integrations

Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.

Declared capability surface (blast radius)

Local shell command execution

Can run terminal commands; pair with approval gates or container/OS sandboxing.

Outbound network access

Makes outbound requests; verify telemetry settings and model data routing on private repos.

FARS trust-control audit

Not found in source — apply before daily use
  • confirmation before acting — Turn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
  • rollback or recovery path — Back up first, or work on a git branch or snapshot, so its changes can be undone.

What are this agent's strengths and limitations?

Pros
  • create_handoff_tool and create_swarm provide concrete primitives for context transfer, agent switching, and active-agent routing.
  • Compiled workflows can use LangGraph's documented streaming, short-term and long-term memory, and human-in-the-loop capabilities.
  • Handoff tools can be customized with different names, descriptions, model-populated arguments, and transferred state.
  • Custom child schemas and state-conversion wrappers allow applications to isolate agent histories instead of sharing one global message list.
Limitations
  • Multi-turn operation requires a checkpointer; without one, the swarm loses conversation history and forgets which agent was last active.
  • The default handoff exposes the full accumulated message history to the next agent, so privacy or context isolation requires custom implementation.
  • A custom handoff returning Command needs a compatible tool-calling node, and both the parent and destination graphs must declare every updated state key.
  • The only runnable provider setup shown uses langchain-openai, an OpenAI API key, and network access; no ready-to-run configuration for another provider is documented.
  • The repository documents an embeddable Python workflow, not a standalone server, container image, or managed deployment.

How does this agent compare with similar options?

Compared with manually assembling a LangGraph StateGraph, create_swarm and create_handoff_tool supply prebuilt active-agent routing and transfer behavior. Applications needing isolated message state or custom transformations can instead assemble nodes themselves and add routing with add_active_agent_router.

Key facts side by side with the most closely related agents.

Agent Source review Form / cost Stars Updated Language Full support on
LangGraph Multi-Agent Swarm This agent 46 · Major gaps Library / SDKFree + model costs ★ 1.6k 1mo ago Python OpenAI API
Generative AI with LangChain 41 · Major gaps Library / SDKFree + model costs ★ 1.5k 3mo ago Jupyter Notebook OpenAI API · Claude API
OpenBot 59 · Major gaps Web appFree + model costs ★ 48 15d ago Python Claude Code · OpenAI API · Claude API
AG2: Open-Source AgentOS 75 · Good Library / SDKFree + model costs ★ 5.1k 1d ago Python OpenAI API

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Major gaps
46/ 100 5-point scale 2.3 / 5
Trust 10/29
Reliability 5/14
Adaptability 10/18
Convention 10/18
Effectiveness 7/13
Verifiability 4/8
Why each dimension lost points
Trust10 / 29 · 1.7/5

The README says the default handoff passes the full message history and shows how to customize the data passed. This makes the main state flow reasonably clear, but sharing all history by default broadens exposure, so least privilege and sensitive-data handling score 1. The supplied files do not show user confirmation before handoff, control of external side effects, or rollback, so those criteria score 0 or 1. The quickstart calls for an API key, project metadata lists dependencies, and the MIT license names a copyright holder; there is no evidence of credential protection or dependency security controls, while source attribution scores 2 based on the file-level attribution and references.

Reliability5 / 14 · 1.8/5

The README's descriptions of graph compilation, persistence, and resuming across turns broadly align with the in-memory checkpoint and two-handoff flow in the test file, supporting a self-consistency score of 2. The project specifies a Python range and bounds its main dependencies, but the packet shows no lock file or availability guarantees, so dependency availability scores 1. The supplied files do not explain how runtime failures are surfaced, so failure messages score 0; no execution outcome is inferred.

Adaptability10 / 18 · 2.8/5

The README targets Python developers building multi-agent applications and covers shared state, memory, and custom agent implementations, scoring 2. It describes the need for Command-capable tools and matching state schemas, and notes that shared message history may be undesirable, supporting a score of 2 for capability boundaries. Handoffs are triggered through agent tools, but the packet gives no routing conditions or guidance to prevent unintended transfers, so trigger precision scores 1. The minimum Python version, install command, and LangGraph interface examples provide basic environment-fit guidance, scoring 2.

Convention10 / 18 · 2.8/5

The README is organized around features, installation, quickstart, memory, and customization, scoring 2. The install command, API-key variable, and concrete examples are reasonably clear, so those criteria score 2. The package name, import name, and project description are aligned, supporting naming stability at 2. The docs call out shared history, checkpoints, and custom-state considerations, but the limitations are incomplete, so known limitations score 1. The repository includes the full MIT license text, scoring 3. Version 0.1.0 appears in project metadata without a changelog, so versioning and changelog score 1. An individual author is named, but maintenance responsibility and an update path are not described, so that criterion scores 1.

Effectiveness7 / 13 · 2.7/5

Examples show agent handoffs, cross-turn resumption, and custom handoff patterns, making the framework usable for developers, scoring 2. Dynamic transfer and shared state provide a clear capability beyond a single-agent flow, scoring 2 for marginal value. No performance, cost, or resource-use guidance is supplied, so cost-benefit scores 1.

Verifiability4 / 8 · 2.5/5

README claims about core capabilities can be traced to examples, and the test file also covers basic handoffs and active-agent state, supporting scores of 2 for claim traceability and cross-source corroboration. The docs sometimes present behavior as fact without consistently separating guarantees, examples, and behavior delegated to the underlying framework; the supplied tests are not independent verification, so fact-inference separation scores 1.

Risks and how to mitigate them
  • Not found in source: confirmation before actingTurn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
  • Not found in source: rollback or recovery pathBack up first, or work on a git branch or snapshot, so its changes can be undone.
  • The default handoff passes the full message history to the next agent; assess and customize the transferred state when it may contain sensitive information.
  • This assessment uses only the supplied static file sample; code was not executed, and files not included in the packet are unknown.
Evidence confidence: Low Reviewed Nov 08, 2026 Reviewed revision 8956b138bbb4
See the full review method →
Maintain this project? Add the FARS badge to your README

The badge shows the current review score and verdict and links back to this page. It refreshes about once an hour after a re-review.

FARS

[![FARS review](https://followagents.com/badge/langgraph-swarm-py.svg)](https://followagents.com/en/agents/langgraph-swarm-py)
<a href="https://followagents.com/en/agents/langgraph-swarm-py"><img src="https://followagents.com/badge/langgraph-swarm-py.svg" alt="FARS review"></a>

Recent releases

Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.

  1. Release notes excerpt
    What's Changed * fix: migrate to langchain 1.0 by @philogicae in https://github.com/langchain-ai/langgraph-swarm-py/pull/110 New Contributors * @philogicae made their first contribution in https://github.com/langchain-ai/langgraph-swarm-py/pull/110 Full Changelog: https://github.com/langchain-ai/langgraph-swarm-py/compare/langgraph-swarm==0.0.15...langgraph-swarm==0.1.0
    View on GitHub ↗
  2. Release notes excerpt
    What's Changed * chore(bump): allow using with langchain 1.0 by @eyurtsev in https://github.com/langchain-ai/langgraph-swarm-py/pull/103 Full Changelog: https://github.com/langchain-ai/langgraph-swarm-py/compare/langgraph-swarm==0.0.14...langgraph-swarm==0.0.15
    View on GitHub ↗
  3. Release notes excerpt
    What's Changed * release: v0.0.14 and prep for langgraph v0.6 by @sydney-runkle in https://github.com/langchain-ai/langgraph-swarm-py/pull/92 New Contributors * @sydney-runkle made their first contribution in https://github.com/langchain-ai/langgraph-swarm-py/pull/92 Full Changelog: https://github.com/langchain-ai/langgraph-swarm-py/compare/langgraph-swarm==0.0.13...langgraph-swarm==0.0.14
    View on GitHub ↗

FAQ

Is a persistence component required for multi-turn conversations?
Yes. The documentation says to compile with a checkpointer, such as workflow.compile(checkpointer=checkpointer); otherwise the swarm forgets the last active agent and loses conversation history.
What information is passed during a handoff?
The default create_handoff_tool forwards the complete message history accumulated by the swarm and adds a tool message confirming the transfer. A custom handoff can change that payload.
Must every agent share the same conversation history?
No. Shared messages is the default, but developers can give child agents separate message keys and write wrappers that translate state between parent and child graphs.
What does it cost to operate?
No library pricing is stated. The example calls an OpenAI model, so model API charges may apply; rates are not specified in the supplied material.
Can it be deployed directly as a service?
The documented boundary is a Python library compiled and invoked inside an application. No standalone server, container, or hosted deployment procedure is provided.
Was this page helpful?
View on GitHub ↗ Install ↓

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related concepts