Swarm is an experimental framework for exploring ergonomic, lightweight multi-agent orchestration patterns using two primitive abstractions: Agents and handoffs. It runs almost entirely on the client without storing state between calls.
Project overview
Swarm demonstrates a minimal approach to multi-agent coordination by reducing complex orchestration to just two primitives, making agent coordination highly controllable and testable.
Project type
AI Agent · Workflow
Deployment
Refer to project documentation
License
MIT
Best for
Developers who want to explore lightweight, highly controllable multi-agent orchestration patterns without a steep learning curve.
AI engineers who need to prototype agent coordination with handoffs and context variables.
Key capabilities
Provides lightweight orchestration of agent coordination and execution that is highly controllable and testable.
Allows an Agent to hand off a conversation or execution to another Agent.
Enables Agents to call Python functions directly and automatically converts functions into a JSON Schema for the Chat Completions API.
Supports passing and updating context variables during agent execution.
Provides a utility to run a REPL on the command line to test out a swarm.
Limitations and risks
Swarm is not recommended for production use; users should migrate to the OpenAI Agents SDK.
Swarm runs almost entirely on the client and does not store state between calls.
Swarm is now replaced by the OpenAI Agents SDK and should be treated as a deprecated exploration framework.
Getting started
Requires Python 3.10 or later. Install by running 'pip install git+https://github.com/openai/swarm.git', then import Swarm from the swarm package. Setup involves writing Python code and configuring OpenAI API access. The default model is gpt-4o, and the OpenAI Chat Completions API is required for inference.