Skip to content
AgentAgent framework

agency-swarm

Python framework for orchestrating teams of AI agents built on the OpenAI Agents SDK

agency-swarm is an open-source agent framework for multi-agent frameworks. It is available on API, CLI, Self-hosted, macOS, Linux and Windows.

Pricing
Open source
Platforms
API, CLI, Self-hosted
GitHub stars
4.6K
Last commit
Language
Python
License
MIT

Similar agents

About agency-swarm

Agency Swarm lets developers model a group of AI agents the way a company is organized, with each agent given its own role, instructions, and tools. Agents hand work to one another through a send_message tool, and the allowed directions of contact are declared explicitly with a simple arrow-style syntax, so a CEO-style agent can delegate to a developer agent without the developer reaching back unless permitted.

Under the hood it extends the OpenAI Agents SDK and the Responses API, adding a structured orchestration layer, Pydantic-validated tools, tools generated from OpenAPI schemas, and hooks for saving and restoring conversation threads to a database or file store. Models can also be reached through LiteLLM, which covers Claude, Gemini, Grok, Azure OpenAI and OpenRouter.

The framework suits Python developers who want to build multi-agent applications such as virtual assistants or internal automation teams, and who prefer editing plain instruction files over hard-coding prompts. A command-line helper scaffolds new agent folders, and a web or terminal demo runner is included for trying out an agency.

What it does

Role-based agent design
Each agent gets its own name, description, instructions, files and tools, mirroring a real organizational role.
Directional communication flows
Agents can only initiate conversations along explicitly declared links between them.
Typed tool definitions
Tools are written as decorated Python functions or Pydantic-based classes with automatic argument validation.
OpenAPI tool generation
Tools can be created directly from OpenAPI schemas loaded from a file or URL.
Conversation persistence hooks
Load and save callbacks let threads survive across sessions in a database or file store.
Multiple model backends
Works with OpenAI models natively and reaches other providers through LiteLLM.

Good for

  • Building a multi-agent assistant where a planner agent delegates coding or admin tasks to specialist agents
  • Turning an existing REST API into agent-callable tools using its OpenAPI specification
  • Prototyping an internal workflow of cooperating agents with a terminal or web chat interface
  • Adding session memory to agent conversations by storing threads in your own database

Pricing

Open source

Free and open source under MIT; a separate Agents-as-a-Service subscription is offered for custom builds.

Prices change. Check agency-swarm.ai before you buy.

agency-swarm FAQ

What language is Agency Swarm written in?

It is a Python framework and requires Python 3.12 or newer.

Which license does agency-swarm use?

The project is open source under the MIT license.

Can agency-swarm use models other than OpenAI's?

Yes, through LiteLLM it supports providers such as Anthropic, Google Gemini, xAI Grok, Azure OpenAI and OpenRouter.

How do agents decide who they can talk to?

You define communication_flows on the Agency; each arrow lets the left agent initiate a chat with the right one.

Is agency-swarm free?

Yes. agency-swarm is open source, so you can use and self-host it for free.

What are the best alternatives to agency-swarm?

The closest alternatives to agency-swarm are swarms, swarm, swarmclaw, crewAI and atomic-agents.

Where this comes from

  • Description: written from the project's README and the project's website.