Repolode
VRSEN

VRSEN/agency-swarm

A Python framework for building multi-agent systems where AI agents with defined roles hand off work to each other through explicit communication flows.

Stars
4,629
Forks
1,063
Open issues
9
Last commit
5 days ago

What is it?

Agency Swarm is a Python framework for building applications made of several AI agents that work together, organized like a real team. Each agent gets its own role, instructions, and tools, and the developer defines which agents may start conversations with which others. The framework is built on the OpenAI Agents SDK and adds an orchestration layer on top of it.

Agents communicate through a dedicated send_message tool, and the directional communication_flows set on an Agency determine who can contact whom. Tools can be written as Python functions with the @function_tool decorator, as BaseTool subclasses using Pydantic fields, or generated from OpenAPI schemas. Conversation history can be persisted through load and save callbacks, for example to a database or file store.

The project targets Python 3.12+ and supports OpenAI models natively, with other providers such as Anthropic, Gemini, and Azure OpenAI reachable through LiteLLM. It provides a web demo and a terminal interface for running an agency.

Key features

  • 01Defines agent roles with their own instructions, tools, and model settings.
  • 02Restricts agent-to-agent communication with directional communication flows.
  • 03Creates type-safe tools from Python functions, BaseTool classes, or OpenAPI schemas.
  • 04Persists conversation history through load and save callbacks.
  • 05Runs through a web demo, a terminal UI, or the async get_response API.

Use cases

  • Prototyping a team of specialized agents such as a CEO agent delegating to developer and assistant agents.
  • Building internal automation where agents call existing APIs described by OpenAPI schemas.
  • Running multi-agent workflows that need saved conversation state across sessions.

Quick start

  1. 1

    Install the framework with pip

    pip install -U agency-swarm
  2. 2

    Set your OpenAI API key in a .env file or shell

    export OPENAI_API_KEY="YOUR_API_KEY"
  3. 3

    Start from the Agency Starter Template and follow the README to define agents and communication flows

Things to know

  • Requires Python 3.12 or newer.
  • Needs an OpenAI API key or another supported model provider to run agents.
  • Migrating from v0.x requires adapting projects to the new SDK-based version.

In collections

Topics

FAQ

What is agency-swarm?
A Python framework for building multi-agent systems where AI agents with defined roles hand off work to each other through explicit communication flows. Agency Swarm is a Python framework for building applications made of several AI agents that work together, organized like a real team. Each agent gets its own role, instructions, and tools, and the developer defines which agents may start conversations with which others. The framework is built on the OpenAI Agents SDK and adds an orchestration layer on top of it.
Is agency-swarm free to use? What license does it have?
agency-swarm is open source under the MIT license. Check the license terms before using it in commercial products.
Is agency-swarm still maintained?
Actively maintained. The last commit to agency-swarm was on Nov 2, 2026.
What can I use agency-swarm for?
Prototyping a team of specialized agents such as a CEO agent delegating to developer and assistant agents. Building internal automation where agents call existing APIs described by OpenAPI schemas. Running multi-agent workflows that need saved conversation state across sessions.
How do I install agency-swarm?
Install the framework with pip: pip install -U agency-swarm Set your OpenAI API key in a .env file or shell: export OPENAI_API_KEY="YOUR_API_KEY" Start from the Agency Starter Template and follow the README to define agents and communication flows
Where can I get agency-swarm?
The source code and installation instructions are on GitHub: https://github.com/VRSEN/agency-swarm

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects