langgraph-swarm
An implementation of a multi-agent swarm using LangGraph
What it is and what it does
LangGraph Swarm is a Python library that layers multi-agent coordination on top of LangGraph, enabling specialized agents to collaborate by handing off control to one another based on their expertise. Instead of a single monolithic agent, you define multiple agents with distinct roles and tools, then let them route requests dynamically—the system remembers which agent was active last, so multi-turn conversations resume with the right agent in context.
The library provides factory functions to create agents and handoff tools, handles message passing and state management through LangGraph's graph compilation, and integrates with LangGraph's built-in memory (short-term via checkpointers, long-term via stores) and streaming. You customize it by either modifying handoff tool behavior (what data passes between agents, what arguments the LLM fills in) or by changing the agent state schema to isolate agent histories.
Use it for:
- Build a customer-support swarm where a routing agent directs queries to billing, technical, or sales specialists, each with domain-specific tools.
- Create a research assistant that hands off between a web-search agent, a data-analysis agent, and a report-writing agent based on task needs.
- Implement a coding assistant where a planner agent routes to a code-generation agent, a testing agent, and a documentation agent in sequence.
- Design a multi-domain chatbot where agents for math, writing, coding, and general knowledge collaborate and hand off mid-conversation.
- Orchestrate a workflow where agents with different LLM models or tool sets work together, each handling its specialization before passing to the next.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Builds multi-agent swarm systems where specialized agents hand off control to each other dynamically, with built-in support for memory and streaming via LangGraph.
Yes, if you are already committed to LangGraph and need multi-agent handoff orchestration. The library is straightforward and low-friction to install, with no security vulnerabilities. However, the aging maintenance status (253 days since last release) means you should verify compatibility with your LangGraph version and be prepared for slower bug fixes. Not a fit if you need active development or prefer a more mature multi-agent framework.
Install
langgraph-swarm on PyPI
pip
pip install langgraph-swarmuv
uv add langgraph-swarmpoetry
poetry add langgraph-swarmInstalling langgraph-swarm
Before you install
Low install friction; pure Python wheel with three runtime dependencies (langchain, langchain-core, langgraph). Maintenance status is aging—last release 253 days ago—so expect slower updates and potential compatibility drift with the LangGraph ecosystem.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open and closed projects with minimal obligations beyond attribution.
Quickstart
pip install langgraph-swarm
from langgraph_swarm import create_swarm, create_handoff_tool
from langchain.agents import create_agent
alice = create_agent(model, tools=[create_handoff_tool(agent_name="Bob", description="Transfer to Bob")], name="Alice")
bob = create_agent(model, tools=[create_handoff_tool(agent_name="Alice", description="Transfer to Alice")], name="Bob")
workflow = create_swarm([alice, bob], default_active_agent="Alice")
app = workflow.compile(checkpointer=checkpointer)
Requires Python >=3.10; requires a LangGraph-compatible LLM (e.g., langchain-openai) and a checkpointer for multi-turn conversation state.
Verify before relying
- Whether the aging maintenance status (253 days since last release) signals active development paused or stable maturity.
- Compatibility guarantees with newer LangGraph versions given the dependency on langchain and langchain-core.
- Performance characteristics and scalability limits for swarms with many agents or high-frequency handoffs.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — langchain, langchain-core, langgraph |
| Maintenance | aging — 253 days since the last release |
| First released | |
| Downloads | 153,770/month — #10,868 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: langgraph_swarm-0.1.0-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
langgraph-supervisorBuilds hierarchical multi-agent systems where a…
permissive · top 15,000 on PyPI
langgraph-prebuiltProvides high-level APIs for building and…
permissive · top 1,000 on PyPI
ag-ui-langgraphBridges LangGraph agent workflows to the AG-UI…
permissive · top 15,000 on PyPI
langmemLangMem provides memory management tools for…
permissive · top 15,000 on PyPI
langgraphLangGraph is a low-level orchestration…
permissive · top 1,000 on PyPI
langgraph-checkpointProvides the base interface and serialization…
permissive · top 1,000 on PyPI
agent-framework-coreBuild, orchestrate, and deploy AI agents and…
permissive · top 5,000 on PyPI
langgraph-apiRuns a local development server for LangGraph…
unclear · top 5,000 on PyPI
langgraph-sdkPython SDK for building and deploying agentic…
permissive · top 1,000 on PyPI
aegra-apiAegra API is a self-hosted Agent Protocol…
permissive · top 15,000 on PyPI