OpenAI has released a new open-source framework called "Swarm" on GitHub. The company describes it as an experimental tool for creating, orchestrating, and deploying multi-agent systems.
Swarm aims to make agent coordination and execution lightweight, highly controllable, and easily testable, according to OpenAI. It achieves this through two key concepts: routines and handovers.
A routine consists of instructions and tools. It can decide to hand over a conversation to another agent at any time. OpenAI says these basic building blocks can express complex dynamics between tools and agent networks.
The framework also demonstrates OpenAI's concept of "Agentic AI" - an abstraction that includes a language model, specific instructions (system prompts), and tools. These agents can interact, pass tasks to other agents, and use available tools.
OpenAI claims that Swarm allows developers to test scalable solutions to real-world problems without a steep learning curve. The framework runs mostly on the client side and doesn't store state between calls, similar to the Chat Completions API. The company stresses that Swarm is currently an experimental example framework to explore multi-agent system interfaces. It's not meant for production use and receives no official support.
Core concepts: Handoffs and routines
Swarm's main goal is to showcase handoffs and routines described in an OpenAI Cookbook. Handoffs let an agent transfer conversation control to another agent, like a phone transfer.
Routines are natural language sequences of steps defined with the tools necessary to execute them. They can be thought of as state machines that language models can handle robustly.
OpenAI argues this approach suits managing many independent capabilities and instructions that are hard to code in a single prompt.
Swarm offers a lightweight, scalable, and customizable alternative to the Assistants API. While Assistants provides fully hosted threads and integrated memory and call management, Swarm targets developers wanting full transparency and fine-grained control over context, steps, and tool calls.
Examples and documentation
OpenAI has published several examples of Swarm use cases on GitHub. These include a simple triage agent, a weather agent, and more complex setups like airline customer service and a personal shopping assistant.
The Swarm Cookbook explains core concepts and framework usage. This covers running Swarm, defining agents and functions, and handling streaming and evaluations.
OpenAI sees multi-agent systems as a path to improved AI reasoning capabilities, in line with the third tier of its five-tier scale for measuring progress toward AGI. The company is building a multi-agent research team working on two types of AI agents: one for automating complex tasks on devices, and another for web-based tasks such as data collection and flight booking.