# Repository Briefing: VRSEN/agency-swarm
> Source: https://repoforai.com/repo/VRSEN/agency-swarm (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/VRSEN/agency-swarm
- **Official Docs / Website**: https://agency-swarm.ai/
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: A+ (92/100 · Maintenance 35/35 · Adoption 23/25 · Releases 14/20 · License 20/20)
- **Latest Release**: v1.11.0 (2026-08-03) — https://github.com/VRSEN/agency-swarm/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: API
- **Momentum**: 4,646 ★ total (+1 24h / +5 7d) · 1,062 forks
- **When to Use**: Best for: API-backed workflows with several stable specialist roles, explicit delegation boundaries, and application-owned conversation history. Skip if: A single agent or fixed Python workflow is enough, inference must run offline, or you need a turnkey hosted service rather than an embedded SDK.

## Overview
```text
### Architecture & Core Mechanics
Agency Swarm is a Python orchestration layer over the OpenAI Agents SDK. An `Agency` exposes a user-facing entry agent and a directed communication graph. On a programmatic call to `get_response`, agents act under their role-specific and shared instructions, using `send_message` to contact permitted peers. An edge such as `lead > specialist` controls who can initiate a conversation, not which branch will execute on every request.

Tool integration centers on the SDK's `FunctionTool` format: register a decorated Python function, adapt a Pydantic-based `BaseTool`, or import an OpenAPI schema through `ToolFactory.from_openapi_schema`. Conversation history crosses an application-defined boundary through load/save callbacks rather than a prescribed database. The 2.0 beta manifest includes Pydantic 2.11–2.x, MCP 2, and FastMCP 4, and pins `openai-agents==0.22.3` because the framework patches private SDK interfaces.

### Key Capabilities & Differentiators
Agents can have independent instructions, tools, model settings, and file and schema directories, while sharing agency-wide instructions. Native inference uses the OpenAI Responses API; the 2.0 beta defaults to `gpt-6-luna`. LiteLLM provides a route to Claude, Gemini, Grok, Azure OpenAI, and OpenRouter. Treat provider routing as distinct from feature parity: validate the tool calls and any model-specific features your application depends on against the backend you choose.

The API surface includes async `get_response` and synchronous `get_response_sync`; `copilot_demo()` and `tui()` are interactive entrypoints for trying an agency. The v1.11.0 release adds realtime voice, per-user OAuth for MCP servers, and system reminders. The 2.0 beta adds OpenAI-side conversation compaction so later turns send only the portion after compaction. That optimization targets repeated history transmission; it is not a general guarantee of lower cost for every workload or backend.

### Trade-offs & Limitations
Compared with using the OpenAI Agents SDK directly, Agency Swarm provides explicit delegation topology and shared conventions for role instructions, tools, and history. That pays off when several specialists need clearly scoped communication. For a single agent or a fixed sequence of steps, direct SDK calls or ordinary Python control flow are simpler. The graph constrains who may delegate to whom; it neither makes routing deterministic nor substitutes for authorization on an external tool.

Delegation can add model round trips and token usage. History callbacks leave session isolation, retention, and storage behavior to the application; schema-generated tools still need authorization and input review. The beta's private SDK patches also narrow the safe upgrade window, so upgrade the framework and its pinned SDK together and rerun integration tests. MIT permits commercial use with its notice requirements, but model API and external-service terms still apply.

### Hardware & Deployment Guide
The documented runtime is Python 3.12+ on macOS, Linux, or Windows. Use `pip install -U agency-swarm` for the regular release track or `pip install -U --pre agency-swarm` to opt into prereleases. For native OpenAI access, supply `OPENAI_API_KEY` via the environment or a `.env` file. The Node.js 16+ requirement belongs to the v1.x agent generator, not the Python orchestrator. For a production API, run the SDK inside your application and provide your own request handling and history storage.

You can self-host the orchestration code, but the described inference path is API-backed, not an offline deployment. It does not require local GPU or VRAM for model inference. Size the host for concurrent runs, history serialization, and local tools, and budget for network latency and downstream API limits. Separate the v1.11.0 stable release from the 2.0.0-beta.1 dependency migration; test session continuity, tool behavior, and provider compatibility before promoting the beta.
```

## Key Capabilities
```text
- Delegation topology: `communication_flows` defines which agents can initiate contact through `send_message`.
- Tool integration: `@function_tool`, Pydantic-based `BaseTool`, and OpenAPI imports feed into the SDK's `FunctionTool` model.
- Session persistence: `load_threads_callback` and `save_threads_callback` let the host application supply history storage.
- Application entrypoints: async `get_response`, synchronous `get_response_sync`, plus `copilot_demo()` and `tui()` for interactive use.
- Model backends: native OpenAI Responses API and a LiteLLM route to providers including Anthropic, Google, Azure OpenAI, and OpenRouter.
- Upgrade boundary: the 2.0 beta adopts OpenAI SDK 3, MCP 2, and FastMCP 4 while pinning `openai-agents==0.22.3`.
```

## Quick Start / Clone
```bash
pip install -U agency-swarm
```
