# agency-swarm

> agency-swarm is an open-source agent framework for multi-agent frameworks. Python framework for orchestrating teams of AI agents built on the OpenAI Agents SDK. It is available on API, CLI, Self-hosted, macOS, Linux and Windows.

- **Kind:** Agent
- **Pricing:** Open source
- **Platforms:** API, CLI, Self-hosted, macOS, Linux, Windows
- **Website:** https://agency-swarm.ai
- **Repository:** https://github.com/vrsen/agency-swarm
- **GitHub stars:** 4,645
- **License:** MIT
- **Categories:** [multi-agent frameworks](https://ai-powered.com/categories/multi-agent-frameworks)
- **Listing updated:** 2026-12-01

## About

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.

## Features

- **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

## 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.

## Alternatives

- [swarms](https://ai-powered.com/agents/swarms): swarms is an open-source agent framework for ai models and llm tooling.
- [swarm](https://ai-powered.com/agents/swarm-3): swarm is an open-source agent framework for multi-agent frameworks.
- [swarmclaw](https://ai-powered.com/agents/swarmclaw): swarmclaw is an open-source agent for ai models and llm tooling.
- [crewAI](https://ai-powered.com/agents/crewai): crewAI is an open-source agent framework for multi-agent frameworks.
- [atomic-agents](https://ai-powered.com/agents/atomic-agents): atomic-agents is an open-source agent framework for ai models and llm tooling.
- [AgentForge](https://ai-powered.com/agents/agentforge-3): AgentForge is an open-source agent framework for multi-agent frameworks.
- [OpenProgram](https://ai-powered.com/agents/openprogram): OpenProgram is an open-source agent framework for ai models and llm tooling.
- [agentfield](https://ai-powered.com/agents/agentfield): agentfield is an open-source agent framework for multi-agent frameworks.

---
Source: https://ai-powered.com/agents/agency-swarm
