# OpenAI Swarm

> Canonical: https://skillalmanac.com/glossary/openai-swarm | Last verified: 2026-11-24 | Index status: not offered to search engines

OpenAI Swarm is an experimental, educational open-source Python library from OpenAI for learning multi-agent orchestration, where one AI agent hands a conversation to another. OpenAI's README says it has been replaced by the OpenAI Agents SDK.

Also called: Swarm, swarm openai, swarm agents, OpenAI Swarm framework, openai/swarm.

## In plain language

Swarm is a small teaching project published by OpenAI. It shows how several AI helpers, each with its own instructions and abilities, can pass a conversation between them: a general helper might hand a customer to a billing helper, then to a refunds helper. It is code you read and run to learn the idea, not a finished product. OpenAI's README says Swarm has been replaced by the OpenAI Agents SDK and recommends migrating to it for production use. If you copy Swarm into something real, you inherit a project the publisher describes as experimental, so check the README first. Running agents also means model calls that cost money.

## Technical definition

Swarm's README says an Agent encapsulates a set of instructions with a set of functions, and that an agent can hand off to another agent by returning it from a function. Its client.run() implements a loop: get a completion from the current agent, execute any tool calls, switch agents if a function returned one, update context variables, and return once there are no new function calls. The README labels the project experimental and educational and states that Swarm is now replaced by the OpenAI Agents SDK, which it calls a production-ready evolution of Swarm. The Agents SDK documentation likewise describes itself as an upgrade of the earlier experimentation, Swarm, and lists handoffs among its primitives.

## How it shows up when you use agents

Swarm turns up when you search for a simple way to see multi-agent handoffs in code. In its README, an agent is instructions plus functions, and a handoff happens when a function returns another agent. That makes it a readable demo of [agent orchestration](/glossary/agent-orchestration) inside a [multi-agent system](/glossary/multi-agent-system).

What goes wrong is treating it as a supported framework. OpenAI's README labels it experimental and educational and says the [OpenAI Agents SDK](/glossary/openai-agents-sdk) replaces it. If you are starting a project, read the SDK docs first and use Swarm as reading material.

Swarm is a Python library you call from your own code. If you use Claude Code, Codex or Cursor, you are unlikely to meet it in a session. The same idea, splitting work between agents with their own instructions, appears there as subagents. Next step: if you only want delegation in a coding session, read the [subagents guide](/learn/claude-code-subagents-guide) and the [subagent-design skill](/skills/skill-almanac/subagent-design).

## Common confusions

- **Swarm versus the Agents SDK.** Swarm is the experimental, educational predecessor. The README says the Agents SDK replaces it.
- **Handoff versus tool call.** In Swarm a handoff is a function that returns another agent, which switches who answers next. An ordinary [tool call](/glossary/tool-calling) returns data to the same agent.
- **Myth: OpenAI Swarm is a product for production use.** The README says it is experimental and educational and recommends the Agents SDK for production.

## Worked examples in this catalogue

### [subagent-design](https://skillalmanac.com/skills/skill-almanac/subagent-design)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A skill that helps decide what to delegate and then writes subagent definitions and briefs that work without the conversation.

Why it exercises the concept: Swarm's idea is dividing work between agents with separate instructions. This skill is about drawing that same boundary for a coding agent.

### [subagent-driven-development](https://skillalmanac.com/skills/obra/subagent-driven-development)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A skill that executes a plan by handing independent tasks to separate subagents.

Why it exercises the concept: It is a delegation pattern in the same family as handing work from one agent to another, in a coding-agent setting rather than Swarm's Python library.

### [Claude Code Subagents: When to Delegate and How to Scope Tools](https://skillalmanac.com/learn/claude-code-subagents-guide)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A guide to subagents in Claude Code.

Why it exercises the concept: Shows how a coding tool splits work across agents with their own instructions, which is the problem Swarm was written to teach.

### [Codex](https://skillalmanac.com/tools/codex)

```
codex
```

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Open a project directory and run `codex`.

Why it exercises the concept: A coding agent from the same publisher as Swarm. It is a separate product and does not use Swarm.

## Related terms

- [Multi-agent system](https://skillalmanac.com/glossary/multi-agent-system.md)
- [OpenAI Agents SDK](https://skillalmanac.com/glossary/openai-agents-sdk.md)
- [Agent orchestration](https://skillalmanac.com/glossary/agent-orchestration.md)
- [AI agent framework](https://skillalmanac.com/glossary/ai-agent-framework.md)
- [Tool calling (function calling)](https://skillalmanac.com/glossary/tool-calling.md)
- [AI agent](https://skillalmanac.com/glossary/ai-agent.md)

## Sources

- [openai/swarm: Educational framework exploring ergonomic, lightweight multi-agent orchestration](https://github.com/openai/swarm), OpenAI (GitHub) (accessed 2026-11-24)
- [OpenAI Agents SDK](https://openai.github.io/openai-agents-python/), OpenAI (accessed 2026-11-24)
- [Codex CLI](https://learn.chatgpt.com/docs/codex/cli), OpenAI (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-24. [Glossary index](https://skillalmanac.com/glossary.md).
