LibreAI / AI Agents / Swarm
// agents · openai/swarm

Swarm

Swarm is an open-source ai agents project by openai (openai/swarm on GitHub). It has 22,080 GitHub stars and 2,345 forks, is released under the MIT license, and was last updated on GitHub on 15 April 2026.

Swarm — OpenAI's experimental framework for lightweight multi-agent orchestration with agents and handoffs, MIT

★ 22.1k stars⑂ 2.3k forksMITupdated 2026-04
▦ visual — this project's README ships no embeddable screenshot,
so here's a placeholder. The guide below is complete regardless.
// project facts

Project facts

Repository
openai/swarm
GitHub stars
22,080
Forks
2,345
License
MIT
Last updated on GitHub
15 April 2026
Category
AI Agents
Listing
Full install guide
// how it works

How it works

  1. Install from GitHub with pip

    Swarm needs Python 3.10+ and installs directly from the repository.

  2. Define agents and a handoff

    Create agents with instructions and tools, and let one agent's function return another agent to hand the conversation over.

  3. Run the conversation

    Start a client, run with an agent and messages, and read the final response.

// features

Why people love it

Just two primitives

Agents and handoffs express rich multi-agent dynamics without a heavy framework to learn.

Lightweight and testable

Coordination stays explicit and controllable, so agent behaviour is easy to test and debug.

Functions as tools

Agents call Python functions directly, and returning another agent is how handoffs work.

Streaming and evaluations included

Streaming runs and evaluation helpers come with the framework, plus worked examples.

Advertisement
// run it

Run it yourself

  1. Install

    The README install route (HTTPS form).

    pip install git+https://github.com/openai/swarm.git
  2. Define two agents

    The README example: agent A hands off to agent B.

    from swarm import Swarm, Agent
    client = Swarm()
    def transfer_to_agent_b():
        return agent_b
    agent_a = Agent(name="Agent A", instructions="You are a helpful agent.", functions=[transfer_to_agent_b])
    agent_b = Agent(name="Agent B", instructions="Only speak in Haikus.")
  3. Run

    The README run call for the handoff example.

    response = client.run(agent=agent_a, messages=[{"role": "user", "content": "I want to talk to agent B."}])
    print(response.messages[-1]["content"])
// use cases

What you can build

Advertisement
// faq

Questions, answered

Who makes Swarm?

OpenAI, as an experimental, educational multi-agent framework.

Is Swarm free?

Yes — MIT licensed.

Is Swarm production-ready?

No — OpenAI labels it experimental and educational. Use it to learn and prototype multi-agent patterns, not as a supported production platform.

What are the two primitives?

Agents (instructions plus tools) and handoffs (one agent returning another to take over the conversation).

How do I get started?

pip install from GitHub on Python 3.10+, define two agents with a handoff function, and run a conversation with the client.

// keep exploring

Similar tools

AI Agents

openai-agents-js

OpenAI's lightweight TypeScript framework for multi-agent workflows and voice agents.

★ 3.9k starsMIT
View guide →
AI Agents

Openai Agents Python

A lightweight, powerful framework for multi-agent workflows

★ 29.8k starsMIT
View guide →
AI Agents

CAMEL

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

★ 17.8k starsApache-2.0
View guide →
AI Agents

ruoyi-ai

Enterprise-grade AI agent framework with multi-provider LLM management, secure knowledge bases and high-precision RAG, visual workflow orchestration, and mul…

★ 5.7k starsMIT
View guide →
AI Agents

swarms

The Enterprise-Grade Multi-Agent Orchestration Framework. Website: https://swarms.ai

★ 7.2k starsApache-2.0
View guide →
AI Agents

agent-framework

A framework for building, orchestrating and deploying AI agents and multi-agent workflows with support for Python and .NET.

★ 13.9k starsMIT
View guide →
// alternatives

Alternatives in AI Agents

The most-starred other AI Agents projects in the LibreAI catalogue — the realistic shortlist if Swarm is not the right fit.

// more in agents

More in AI Agents

Nearby AI Agents projects in the catalogue, closest in stars to Swarm — keep exploring the shelf either side of it.

Get Swarm

Free and open — grab the source, star the repo, and start creating.