Skip to content
Sign in
  • Browse all toolsFilter by category and pricing
  • Browse categoriesWriting, code, image, audio and more
  • Compare toolsPut up to three side by side
  • Read the blogGuides and comparisons

OpenAI Swarm

An experimental Python framework for learning multi-agent orchestration with tools, handoffs, and context variables.

OpenAI Swarm is a Python framework for educational multi-agent orchestration that coordinates agent instructions, tools, and conversation handoffs. OpenAI Swarm serves developers exploring agent workflows and is available as an open-source project under the MIT license. The repository recommends the OpenAI Agents SDK for production.

Updated 9 Nov 20266 sections

OpenAI Swarm website screenshot

What is OpenAI Swarm?

OpenAI Swarm is an experimental, open-source Python framework for developers learning how to coordinate multiple agents. Managed by the OpenAI Solution team, the project focuses on lightweight, controllable, and testable execution. OpenAI Swarm represents agent behavior through instructions and tools, while handoffs let a conversation move between agents with different responsibilities.

OpenAI Swarm is an educational resource rather than the recommended choice for production deployments. The repository states that the OpenAI Agents SDK has replaced OpenAI Swarm and describes the SDK as a production-ready evolution that will be actively maintained by the OpenAI team.

What OpenAI Swarm can do

OpenAI Swarm combines agent instructions, callable functions, and shared context into workflows that can involve multiple agents. An agent can represent a broader role or a specific task, such as a retrieval step or data transformation. The same execution interface handles tool calls, agent changes, and updates to context variables.

  • OpenAI Swarm transfers conversations between agents through functions that return an agent.
  • OpenAI Swarm calls Python functions and adds their results to the conversation.
  • OpenAI Swarm supplies context variables to agent instructions and functions.
  • OpenAI Swarm supports streaming responses and debug logging.
  • OpenAI Swarm converts function definitions into JSON Schema for Chat Completions tools.

How OpenAI Swarm works

OpenAI Swarm starts with a client that internally creates an OpenAI client. Developers define agents, provide instructions and functions, and call client.run() with an initial agent and message history. The execution loop obtains a completion, executes tool calls, switches agents when needed, updates context variables, and returns when there are no new function calls.

OpenAI Swarm runs almost entirely on the client and is powered by the Chat Completions API. Each completed run returns generated messages, the last active agent, and updated context variables. Applications continue an interaction by passing those values, along with new messages, into a subsequent run because OpenAI Swarm stores no state between calls.

Who OpenAI Swarm is for

OpenAI Swarm serves developers curious about multi-agent orchestration, particularly workflows with independent capabilities and instructions that are difficult to express in a single prompt. The examples directory provides learning material for setup, function calling, handoffs, and context variables, alongside domain-specific demonstrations of request routing and customer-facing agent interactions.

  • OpenAI Swarm demonstrates triage that hands requests to an appropriate agent.
  • OpenAI Swarm includes airline and support-bot customer-service examples.
  • OpenAI Swarm includes a personal shopping example covering sales and refunds.

OpenAI Swarm licensing and access

OpenAI Swarm is available as an open-source project under the MIT license through its public GitHub repository. Installation requires Python 3.10+ and uses pip with either the repository's SSH or HTTPS Git URL. The documented usage begins by importing Swarm and Agent, creating a client, and defining agents with instructions and optional functions.

OpenAI Swarm strengths and limitations

OpenAI Swarm provides a compact model for studying agent coordination without introducing a separate abstraction for every workflow type. Agents can represent tasks, workflows, or specialized roles, and execution returns inspectable conversation state. These educational strengths sit alongside explicit constraints around persistence, handoff behavior, and the repository's recommendation to use a successor for production.

  • OpenAI Swarm requires applications to carry state between calls.
  • OpenAI Swarm uses only the last handoff function when multiple handoffs are called.
  • OpenAI Swarm has been replaced by the OpenAI Agents SDK, which the repository recommends for production.

OpenAI Swarm FAQ

What is OpenAI Swarm?

OpenAI Swarm is an experimental, educational Python framework for multi-agent orchestration. OpenAI Swarm combines agents with instructions and tools, then uses handoffs to transfer conversations between agents. The project is managed by the OpenAI Solution team.

How can developers get OpenAI Swarm?

OpenAI Swarm is available from its public GitHub repository under the MIT license. OpenAI Swarm requires Python 3.10+ and can be installed with pip using the repository's SSH or HTTPS Git URL.

Is OpenAI Swarm recommended for production?

OpenAI Swarm is not the repository's recommended choice for production use. OpenAI Swarm has been replaced by the OpenAI Agents SDK, which the repository describes as a production-ready evolution and recommends for all production use cases.

Does OpenAI Swarm remember conversations between calls?

OpenAI Swarm does not store state between calls. OpenAI Swarm returns generated messages, the last active agent, and updated context variables after execution. Developers must pass these values into subsequent runs to continue an interaction.

What API does OpenAI Swarm use?

OpenAI Swarm is powered entirely by the Chat Completions API and runs almost entirely on the client. OpenAI Swarm agents are unrelated to Assistants in the Assistants API, despite the similar naming.

From the community

No reviews yet

Be the first to review this tool. What you write helps the next person choose.

More tools like OpenAI Swarm

CrewAI

www.github.com

Open-source Python framework for collaborative AI agents and event-driven automation workflows.

Free

OpenAI Agents SDK

www.github.com

Open-source Python framework for multi-agent workflows, sandbox tasks, realtime agents, and voice pipelines.

Free

BabyAGI

www.github.com

An open-source framework for managing Python functions and experimenting with self-building autonomous agents.

Free

AgentScope

www.github.com

Open-source Python framework for building AI agents, multi-agent teams, and agent applications.

Free