Skip to content

01 · Magazine

Agency Swarm: Agent Teams Modeled on an Org Chart

Agency Swarm builds agent teams with directed communication on the OpenAI Agents SDK. Concept, code example, strengths, limitations and comparison.

· Reviewed

Agency Swarm is an open-source Python framework for building multi-agent systems modeled on an organization: agents have roles such as CEO, developer or assistant, and you define who is allowed to communicate with whom. Since version 1.0, Agency Swarm has been built on the OpenAI Agents SDK and the Responses API. It is developed by VRSEN (Arsenii Shatokhin). This article explains the concept, how to get started, and its strengths and limitations.

Fact sheet (as of October 2026)

Attribute Details
License MIT
GitHub around 4,500 stars (as of October 2026)
Language Python 3.12 or later
Version 1.x (currently 1.11)
Foundation OpenAI Agents SDK, Responses API
Models OpenAI natively; Anthropic, Google, xAI, Azure OpenAI, OpenRouter and others via LiteLLM
Installation pip install -U agency-swarm

The concept

An agency is a group of agents with one entry point for user requests and defined communication flows. A flow ceo > dev means the CEO agent can send tasks to the developer agent, but not the other way around. Internally, communication runs through a send_message tool. The result is a traceable structure that resembles an org chart.

Each agent has:

  • a name and description that tell other agents what it is responsible for,
  • instructions that you define entirely yourself (no hidden framework prompts),
  • tools, typically Python functions with type hints,
  • a model, which can differ from agent to agent.

Getting started

import asyncio
from agency_swarm import Agent, Agency, function_tool

@function_tool
def projekt_anlegen(name: str) -> str:
    """Creates a new project directory and returns its path."""
    return f"/projekte/{name}"

ceo = Agent(
    name="CEO",
    description="Receives requests and assigns tasks",
    instructions="Break requests down into tasks and delegate them to the team.",
    model="<model-name>",
)

dev = Agent(
    name="Developer",
    description="Implements technical tasks",
    instructions="Carry out assigned tasks and report the result.",
    tools=[projekt_anlegen],
    model="<model-name>",
)

agency = Agency(ceo, communication_flows=[ceo > dev])

async def main():
    antwort = await agency.get_response("Create a project for a landing page.")
    print(antwort.final_output)

asyncio.run(main())

For development and testing, there is a terminal UI and a web UI; for production, you can deploy an agency as a FastAPI application. You store conversation histories in your own database through callbacks.

What Agency Swarm is good for

  • Agencies and service providers that build custom agent teams for clients
  • Workflows with clear ownership, such as sales (research, proposal, follow-up) or content (research, writing, review)
  • Teams in the OpenAI ecosystem that want to add an organizational structure to the Agents SDK building blocks

Strengths

  • Clear communication rules: Directed flows prevent agents from talking to each other arbitrarily.
  • Full control over prompts: The framework does not impose its own role prompts.
  • Typed tools with validation through Pydantic.
  • Close to the OpenAI Agents SDK: Guardrails, tracing and other SDK features are available.
  • MIT license with no mandatory paid components.

Limitations

  • Smaller community than CrewAI or LangGraph, and therefore fewer examples and integrations.
  • Focus on OpenAI: Other providers work through LiteLLM but are not the main focus.
  • Breaking changes between 0.x and 1.x: Many older tutorials refer to the earlier version based on the Assistants API and no longer apply. OpenAI shut down the Assistants API on 26 August 2026, so Agency Swarm 0.x no longer works.
  • Less built-in workflow control: For fixed, stateful workflows with approvals, LangGraph or CrewAI Flows offer more.

Agency Swarm compared

Agency Swarm CrewAI OpenAI Agents SDK
Mental model Organization with directed communication Crew with roles and tasks, flows Agents with handoffs
Foundation OpenAI Agents SDK Standalone Standalone
Community Small Large Large
License MIT MIT MIT

For a direct comparison, see Agency Swarm vs. CrewAI.

Frequently asked questions

Does Agency Swarm work without OpenAI?

Yes, you can use models from other providers through LiteLLM. However, some features that rely on OpenAI's Responses API may then only be partially available.

What changed with version 1.0?

Agency Swarm moved from the Assistants API, which OpenAI shut down on 26 August 2026, to the OpenAI Agents SDK and the Responses API. If you still use a 0.x version, you need to migrate. Since then, communication flows are written with the > operator, and responses run asynchronously via get_response. A migration guide is available for the switch.

Sources

Last reviewed:

Market notes

Get the next analysis by email

New articles and changes in the directory, at most once a week.