# swarm

> swarm is an open-source agent framework for multi-agent frameworks. Experimental Python library for lightweight multi-agent handoffs, built for learning. It is available on API, CLI and Self-hosted.

- **Kind:** Agent
- **Pricing:** Open source
- **Platforms:** API, CLI, Self-hosted
- **Repository:** https://github.com/openai/swarm
- **GitHub stars:** 22,195
- **License:** MIT
- **Categories:** [multi-agent frameworks](https://ai-powered.com/categories/multi-agent-frameworks)
- **Listing updated:** 2026-12-01

## About

Swarm is an open-source Python library from OpenAI that lets developers wire several AI agents together so a conversation can move from one agent to another. Each agent bundles its own instructions and Python functions, and any function can return a different agent to take over the chat.

The library runs almost entirely on the client side and is built on the Chat Completions API. It keeps no state between calls, so the calling code is responsible for passing messages and context variables back in on each turn. A built-in demo loop provides a command-line REPL for trying out an agent setup, with streaming support.

The project is marked experimental and educational, and its README says OpenAI has replaced it with the Agents SDK for production work. It suits developers who want to study multi-agent orchestration in a small, readable codebase.

## Features

- **Agent handoffs:** A function can return another agent, which transfers the conversation to that agent.
- **Python function tools:** Plain Python functions are converted automatically into Chat Completions tool schemas.
- **Context variables:** Shared values are passed into agent instructions and functions on every run.
- **Streaming responses:** Runs can stream events and emit a final aggregated response object.
- **Command-line demo loop:** A built-in REPL lets you test an agent setup from the terminal.
- **Stateless design:** No conversation state is stored between calls, so the caller manages history.

## Good for

- Prototyping a triage agent that routes customer questions to specialist agents
- Learning how multi-agent orchestration works in a small codebase
- Building a simple airline or support bot with several tool-equipped agents
- Adding function calling with handoffs to an existing Chat Completions integration

## FAQ

### Is Swarm meant for production use?

The README says it is experimental and educational, and recommends the OpenAI Agents SDK for production use cases.

### Does Swarm store conversation history?

No. It is stateless between calls, so the caller passes messages and context variables back in on each run.

### What Python version is required?

Python 3.10 or newer.

### Is Swarm related to the Assistants API?

No. The README states that Swarm agents are unrelated to Assistants and are built only on the Chat Completions API.

### Is swarm free?

Yes. swarm is open source, so you can use and self-host it for free.

### What are the best alternatives to swarm?

The closest alternatives to swarm are agency-swarm, swarms, swarmclaw, MiroShark and smolagents.

## Where this comes from

- Description: written from the project's README.

## Alternatives

- [agency-swarm](https://ai-powered.com/agents/agency-swarm): agency-swarm is an open-source agent framework for multi-agent frameworks.
- [swarms](https://ai-powered.com/agents/swarms): swarms is an open-source agent framework for ai models and llm tooling.
- [swarmclaw](https://ai-powered.com/agents/swarmclaw): swarmclaw is an open-source agent for ai models and llm tooling.
- [MiroShark](https://ai-powered.com/agents/miroshark): MiroShark is an open-source agent for multi-agent frameworks.
- [smolagents](https://ai-powered.com/agents/smolagents): smolagents is an open-source agent framework for multi-agent frameworks.
- [OpenProgram](https://ai-powered.com/agents/openprogram): OpenProgram is an open-source agent framework for ai models and llm tooling.
- [AgentK](https://ai-powered.com/agents/agentk): AgentK is an open-source agent for multi-agent frameworks.
- [atomic-agents](https://ai-powered.com/agents/atomic-agents): atomic-agents is an open-source agent framework for ai models and llm tooling.

---
Source: https://ai-powered.com/agents/swarm-3
