Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
For your multi-agent needs
| Date | Stars |
|---|---|
| 2026-07-31 | 1544 |
| 2026-08-01 | 1544 |
| 2026-08-02 | 1548 |
| 2026-08-03 | 1549 |
| 2026-08-04 | 1549 |
| 2026-08-05 | 1550 |
| 2026-08-06 | 1550 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# 🤖 LangGraph Multi-Agent Swarm
A Python library for creating swarm-style multi-agent systems using [LangGraph](https://github.com/langchain-ai/langgraph). A swarm is a type of [multi-agent](https://langchain-ai.github.io/langgraph/concepts/multi_agent) architecture where agents dynamically hand off control to one another based on their specializations. The system remembers which agent was last active, ensuring that on subsequent interactions, the conversation resumes with that agent.

## Features
- 🤖 **Multi-agent collaboration** - Enable specialized agents to work together and hand off context to each other
- 🛠️ **Customizable handoff tools** - Built-in tools for communication between agents
This library is built on top of [LangGraph](https://github.com/langchain-ai/langgraph), a powerful framework for building agent applications, and comes with out-of-box support for [streaming](https://langchain-ai.github.io/langgraph/how-tos/#streaming), [short-term and long-term memory](https://langchain-ai.github.io/langgraph/concepts/memory/) and [human-in-the-loop](https://langchain-ai.github.io/langgraph/concepts/human_in_the_loop/)
## Installation
```bash
pip install langgraph-swarm
```
## Quickstart
```bash
pip install langgraph-swarm langchain-openai
export OPENAI_API_KEY=<your_api_key>
```
```python
from langchain_openai import ChatOpenAI
from langgraph.checkpoint.memory import InMemorySaver
from langchain.agents import create_agent
from langgraph_swarm import create_handoff_tool, create_swarm
model = ChatOpenAI(model="gpt-4o")
def add(a: int, b: int) -> int:
"""Add two numbers"""
return a + b
alice = create_agent(
model,
tools=[
add,
create_handoff_tool(
agent_name="Bob",
description="Transfer to Bob",
),
],
system_prompt="You are Alice, an addition expert.",
name="Alice",
)
bob = create_agent(
model,
tools=[
create_handoff_tool(
agent_name="Alice",
description="Transfer to Alice, she can help with math",
),
],
system_prompt="You are Bob, you speak like a pirate.",
name="Bob",
)
checkpointer = InMemorySaver()
workflow = create_swarm(
[alice, bob],
default_active_agent="Alice"
)
app = workflow.compile(checkpointer=checkpointer)
config = {"configurable": {"thread_id": "1"}}
turn_1 = app.invoke(
{"messages": [{"role": "user", "content": "i'd like to speak to Bob"}]},
config,
)
print(turn_1)
turn_2 = app.invoke(
{"messages": [{"role": "user", "content": "what's 5 + 7?"}]},
config,
)
print(turn_2)
```
> [!TIP]
> For developing, debugging, and deploying AI agents and LLM applications, see [LangSmith](https://docs.langchain.com/langsmith/home).
## Memory
You can add [short-term](https://langchain-ai.github.io/langgraph/how-tos/persistence/) and [long-term](https://langchain-ai.github.io/langgraph/how-tos/cross-thread-persistence/) [memory](https://langchain-ai.github.io/langgraph/concepts/memory/) to your swarm multi-agent system. Since `create_swarm()` returns an instance of `StateGraph` that needs to be compiled before use, you can directly pass a [checkpointer](https://langchain-ai.github.io/langgraph/reference/checkpoints/#langgraph.checkpoint.base.BaseCheckpointSaver) or a [store](https://langchain-ai.github.io/langgraph/reference/store/#langgraph.store.base.BaseStore) instance to the `.compile()` method:
```python
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.store.memory import InMemoryStore
# short-term memory
checkpointer = InMemorySaver()
# long-term memory
store = InMemoryStore()
model = ...
alice = ...
bob = ...
workflow = create_swarm(
[alice, bob],
default_active_agent="Alice"
)
# Compile with checkpointer/store
app = workflow.compile(
checkpointer=checkpointer,
store=store
)
```
> [!IMPORTANT]
> Adding [short-term memory](https://langchain-ai.github.io/langgraph/concExcerpt of 10,033 characters
Read on GitHubVadym Barda · United States
25
Lance Martin
11
7
Eugene Yurtsev · @langchain-ai · United States
7
Sydney Runkle · @langchain-ai · Morocco
1
William FH · LangChain
1
Mason Daugherty · United States
1
John Kennedy · @langchain-ai
1
Naomi Pentrel · @viamrobotics · Netherlands
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:6410e0c2b175080f, topic:agents, topic:langgraph, desc:multi-agent