langgraph swarm py

Report Abuse

Basic Information

This repository provides a Python library for building swarm-style multi-agent systems on top of LangGraph. It is intended for developers who want to create agent applications where specialized agents dynamically hand off control to one another based on their roles, and where the system remembers which agent was last active so conversations resume with that agent. The package exposes helpers like create_swarm, create_handoff_tool and patterns for creating react-style agents, and compiles to a StateGraph that must be compiled with optional checkpointers or stores for persistence. The README includes a quickstart using ChatOpenAI and examples that show how to set up agents, add memory with InMemorySaver or InMemoryStore, and configure a default_active_agent. The project documents how to customize handoff behavior and agent state schemas to integrate with LangGraph concepts such as tools, nodes and state routers.

Links

Categorization

App Details

Features
The library centers on multi-agent collaboration and handoff orchestration. It provides a create_swarm function to assemble agents into a StateGraph and tooling for customizable handoff tools that allow agents to transfer control and pass messages or task descriptions. Built-in support is documented for streaming, short-term and long-term memory, and human-in-the-loop flows through LangGraph integration. Examples show create_react_agent patterns, tool-calling nodes that return Command objects, and helpers like add_active_agent_router for routing and remembering the last active agent. The README shows how to compile with a checkpointer and store, and how to customize agent state schemas and wrappers so parent and child graphs can translate state keys such as shared messages.
Use Cases
This project helps developers orchestrate coordinated behavior among multiple LLM-driven agents by providing a reusable swarm pattern and tools for handoff and state management. It makes it straightforward to keep multi-turn conversations consistent by remembering the active agent and persisting short-term or long-term memory via checkpointers or stores. The handoff tool abstractions let teams define what data and messages are passed between agents and add tool call arguments like task descriptions. The ability to customize agent implementations and state schemas lets developers isolate internal agent histories or transform parent state to child agent state. Overall it reduces boilerplate for building specialized agent workflows that require routing, memory persistence, and controlled inter-agent communication.

Please fill the required fields*