finds.dev

langchain-ai/langgraph-swarm-py

For your multi-agent needs

View on GitHubHomepage ↗

★ 1,588PythonMITupdated Oct 2026

// the take

A thin LangChain-ai library that wraps LangGraph's StateGraph into a swarm-style multi-agent pattern, where agents hand off control to each other via tool calls and the graph remembers which agent was last active. It's for teams already committed to LangGraph who want multi-agent handoff without hand-rolling the routing and state-tracking themselves.

The core abstraction is small and readable - create_swarm and create_handoff_tool cover the common case in two files, not a sprawling framework. Handoffs are implemented as LangGraph Command objects that update a shared active_agent key, so resuming a multi-turn conversation with the right agent is a built-in property of the graph rather than something you track yourself. Customization points are real, not cosmetic: you can swap in custom handoff tools with extra LLM-populated arguments (e.g. task_description) and give each agent its own state schema/message key instead of sharing one global history. Because it compiles to a normal LangGraph graph, you inherit streaming, checkpointing, and human-in-the-loop for free rather than having to reimplement them.

Memory is opt-in and easy to get wrong - forget to pass a checkpointer to .compile() and the swarm silently loses track of the active agent between turns, with no runtime warning. Default handoffs pass the entire shared message history to every agent, so context and token cost grow with each handoff unless you do the extra work of giving agents private message keys yourself. It's tightly coupled to LangGraph's internal Command/ToolNode mechanics - if you write a custom handoff tool you're reading LangGraph's subgraph-transform-state docs, not this library's. There's no cycle detection: nothing in the API stops Alice and Bob from handing off to each other indefinitely, so an infinite-loop guard is left entirely to the implementer.

We read the README, the directory tree and a key source file in November 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
1,588
Forks
226
Language
Python
License
MIT
Last commit
28 Oct 2026

// nearby

If langgraph-swarm-py isn't quite it.

All repos →