Swarm (Experimental, Educational)
A lightweight, ergonomic multi-agent orchestration framework focusing on agent coordination and handoffs.
- Source repo
- openai/swarm
- Stars
- ★ 22k
- Last updated
- 7mo ago
- FARS reviewed
- Nov 07, 2026
- License
- MIT
- Primary language
- Python
- FA score
- 58/100 · Major gaps
At a glance
- How it runs
- Works with
- Platform-specificOpenAI API
- Cost
- Free software; you pay for model usage
- Setup effort
- Low · running in minutes
- You'll need
- Typical use
- Developers learning to build multi-agent orchestration with function calling and handoffs.
- Not a fit if
- Teams needing a production-ready, maintained framework; this is deprecated
- Teams that must use non-OpenAI or local models
- Developers who need built-in session state and memory management
- Maintenance
- No commits for 6+ monthslast commit 2026-04-15+3.9 ★/day over 7 days
- Source review
- 58/100 · Major gaps 2 safety controls not found
What does this agent do, and when should you use it?
Swarm is an experimental, educational framework maintained by the OpenAI Solutions team that demonstrates how to build lightweight, highly controllable multi-agent orchestration systems. It is built on two primitive abstractions: Agent and handoffs. An Agent encapsulates instructions and tools, and can hand off a conversation to another Agent at any point. Swarm runs entirely on the client and is stateless between calls, powered entirely by the Chat Completions API. It provides a client.run() method to execute tool calls, handle agent switches, update context variables, and supports streaming responses. The project is deprecated in favor of the OpenAI Agents SDK for production use.
Swarm centers on the Swarm client and Agent class. The client.run() method takes an initial agent and messages, then loops over: getting a completion from the current agent, executing tool calls, switching agents if needed, and updating context variables. Agents can be defined with instructions and functions. Functions can be plain Python functions, and if they return an Agent, execution transfers to that Agent. Swarm automatically converts functions into JSON Schema for Chat Completions tools. It also supports updating context variables via a Result object, streaming via the stream=True parameter, and a demo REPL loop.
- Developers learning to build multi-agent orchestration with function calling and handoffs.
- Scenarios requiring many independent capabilities or instructions that are hard to encode in a single prompt.
- Building customer service bots, such as the airline support example with multiple specialized agents.
- Developers needing a lightweight, testable orchestration layer without fully-hosted threads.
- Educational or prototyping purposes to demonstrate agent transfer and tool invocation.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
pip install git+ssh://[email protected]/openai/swarm.gitpip install git+https://github.com/openai/swarm.git
- Runtime
- Python 3.10+
How do you install or deploy this agent?
Requires Python 3.10+. Install from GitHub with:
pip install git+ssh://[email protected]/openai/swarm.gitor with HTTPS:
pip install git+https://github.com/openai/swarm.gitHow do you use this agent?
Set your OpenAI API key. Then instantiate Swarm client, define agents with instructions and functions, and call client.run with the initial agent and messages. Example:
from swarm import Swarm, Agent
client = Swarm()
def transfer_to_agent_b():
return agent_b
agent_a = Agent(
name="Agent A",
instructions="You are a helpful agent.",
functions=[transfer_to_agent_b],
)
agent_b = Agent(
name="Agent B",
instructions="Only speak in Haikus.",
)
response = client.run(
agent=agent_a,
messages=[{"role": "user", "content": "I want to talk to agent B."}],
)
print(response.messages[-1]["content"])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)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
FARS trust-control audit
- dependency security — Pin versions and run a dependency audit (npm audit, pip-audit) before installing; prefer running it in a container.
- 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?
- Lightweight and stateless, using only the Chat Completions API, making it easy to integrate and test.
- Simple abstractions of Agent and handoffs allow flexible composition of workflows and agent networks.
- Supports streaming and a demo REPL for quick testing and debugging.
- Maintained by the OpenAI team with rich examples covering airline support, weather, and shopping agents.
- Experimental and deprecated; replaced by the OpenAI Agents SDK for production use.
- Locked into OpenAI's API; cannot be used with other model providers.
- Limited documentation and no built-in state management; developers handle session state.
- Requires git and Python 3.10+, and API usage may incur costs.
- Function schema generation may be incomplete, e.g., no per-parameter descriptions.
How does this agent compare with similar options?
Swarm is distinct from OpenAI's Assistants API, which offers fully-hosted threads and built-in memory management. Swarm runs entirely on the client, is stateless, and resembles the Chat Completions API. Officially, production users are advised to migrate to the OpenAI Agents SDK.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Swarm (Experimental, Educational) This agent | 58 · Major gaps | Library / SDKFree + model costs | ★ 22k | 7mo ago | Python | OpenAI API |
| Langroid | 72 · Some gaps | Library / SDKFree + model costs | ★ 4.2k | 5d ago | Python | Claude Code · OpenAI API |
| CaveAgent | 63 · Some gaps | Library / SDKFree + model costs | ★ 226 | 2mo ago | Python | OpenAI API · Claude API |
| Agent Craft | 52 · Major gaps | CLIFree + model costs | ★ 542 | 1mo ago | Python | OpenAI API |
How does FollowAgents rate this agent?
Why each dimension lost points
The README says Swarm uses Chat Completions, executes tools by default, and offers execute_tools=false to stop tool execution. This makes the main execution path reasonably visible, but per-tool authorization and per-action user confirmation are not described, so least privilege and confirmation receive only partial credit. The README describes function calls, handoffs, and context_variables flow, and SECURITY.md points to a disclosure policy; the files do not explain sensitive-data handling, control of external side effects, or rollback. The provided pyproject.toml lists no runtime dependencies or update constraints, leaving dependency security unsupported. Core contributors are listed in the README and copyright is stated in LICENSE, supporting attribution.
The README describes the run loop, messages, handoffs, response fields, and lack of persistent state. Test files show mock cases for a simple call, tool execution, disabled tool execution, and handoff, supporting ordinary behavioral consistency. The README requires Python 3.10+ and gives installation commands, but the provided pyproject.toml lists only a build backend and no runtime dependencies, so dependency availability is thinly documented. The README says missing functions, argument errors, and function errors are appended as error responses for agent recovery, providing some evidence of failure handling.
The README clearly positions Swarm as an educational and experimental framework, explains suitable scenarios, and points to examples across several domains, so audience and scenario coverage is strong. It describes direct function calls, handoffs, context transfer, and its Chat Completions basis with no cross-call state, but gives limited detail on capability boundaries or security limits. Routing depends mainly on the model selecting tools and on function definitions; the material does not show more precise trigger constraints. Python 3.10+, installation, and streaming and non-streaming usage are documented, while platform and deployment fit remain lightly covered.
The README has a table of contents, organized sections, parameter tables, a process outline, and multiple example entry points. Installation notes give a Python requirement and SSH/HTTPS commands, but the provided pyproject.toml has no project metadata or runtime dependency list, so the instructions are incomplete. Core terms such as Agent, handoff, functions, and Response are used consistently, but the files provide no compatibility policy. The README points to extensive examples and evaluation examples, though it has no FAQ section. It documents statelessness and handoffs, and warns that Swarm has been replaced by the Agents SDK and is not recommended for production, but does not provide a comprehensive limitations list. LICENSE explicitly grants MIT terms. No release history or changelog is present in the material, so versioning evidence is limited. The README identifies the OpenAI Solution team as maintainer, names core contributors, and points to the successor product, giving clear maintenance responsibility evidence.
The README shows tool calls, handoffs, context variables, streaming events, and response structure, making outputs usable by developers for follow-on handling; examples offer limited coverage of production safeguards or output-quality guarantees. The lightweight Agent and handoff abstractions and multiple examples demonstrate potential value for orchestration, but no comparative evaluation or measured benefit is provided, so the score is moderate. Installation and API guidance make initial experimentation understandable, but the files provide no dependency inventory, resource use, or production operations costs, limiting the cost-benefit evidence.
The README gives concrete API tables, code samples, and output examples; LICENSE, SECURITY.md, pyproject.toml, and mock tests provide some cross-source support. Claims about evaluation guidance and maintenance transition are documented, but the packet contains no evaluation results or release history, so actual outcomes cannot be confirmed. The README states the educational positioning, stateless behavior, and production-use recommendation explicitly; this assessment treats them as documented claims and does not infer execution results or independent verification.
- Not found in source: dependency securityPin versions and run a dependency audit (npm audit, pip-audit) before installing; prefer running it in a container.
- 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 README labels Swarm experimental and educational, and recommends migrating production use to the Agents SDK; examples are not evidence of production safety or validated results.
- Python functions execute as tools by default. Keep externally consequential actions within controlled functions and add confirmation and recovery mechanisms as needed for the application.
- The provided pyproject.toml has no runtime dependency list, and the packet has no changelog; check dependencies and compatibility before deployment.
FAQ
Is Swarm production-ready?
Do I need to pay or apply for access?
Does Swarm support streaming?
What happens if a function call fails?
Can I use Swarm with other model providers?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.