← all repositories
openai/swarm

OpenAI’s Swarm demoed agent handoffs, then handed off itself

An educational Python framework for stitching together stateless LLM agents via function-call handoffs.

21.9k stars Python Agents
swarm
Velocity · 7d
+8.3
★ / day
Trend
accelerating
star history

What it does

Swarm is a minimal Python framework for coordinating multiple LLM agents by passing conversations between them. It treats an Agent as a bundle of instructions and tools, and uses ordinary Python functions to hand off control from one agent to another. The whole system is stateless: it runs almost entirely on the client, stores nothing between calls, and is built purely atop the Chat Completions API.

The interesting bit

The framework deliberately avoids the heavy infrastructure of the Assistants API—no hosted threads, no built-in memory, no retrieval. Instead, it explores how far you can get with just two primitives, Agent and handoffs, letting you compose networks of agents, workflows, or even single data-transformation steps from the same simple building block.

Key highlights

  • Stateless by design: each client.run() takes messages and returns messages, with no server-side memory.
  • Handoffs are just Python functions that return another Agent, making control flow explicit and testable.
  • instructions can be dynamic functions, not just static strings, so system prompts adapt to context variables on the fly.
  • Includes example projects like an airline customer-service router and a personal-shopping bot.
  • The OpenAI team has since replaced it with the production-ready Agents SDK.

Caveats

  • The project is explicitly experimental and educational; OpenAI recommends migrating to the Agents SDK for production use.
  • Because it is stateless, you must manually thread messages, agent, and context_variables between calls if you want continuity.

Verdict

Worth a skim if you are studying multi-agent patterns or want to see how little code is needed to coordinate LLMs. Skip it if you are looking for a maintained production framework.

Frequently asked

What is openai/swarm?
An educational Python framework for stitching together stateless LLM agents via function-call handoffs.
Is swarm open source?
Yes — openai/swarm is open source, released under the MIT license.
What language is swarm written in?
openai/swarm is primarily written in Python.
How popular is swarm?
openai/swarm has 21.9k stars on GitHub and is currently accelerating.
Where can I find swarm?
openai/swarm is on GitHub at https://github.com/openai/swarm.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.