VRSEN/agency-swarm
Python agent orchestration with explicit, directional delegation
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & 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.
communication_flows defines which agents can initiate contact through send_message.@function_tool, Pydantic-based BaseTool, and OpenAPI imports feed into the SDK's FunctionTool model.load_threads_callback and save_threads_callback let the host application supply history storage.get_response, synchronous get_response_sync, plus copilot_demo() and tui() for interactive use.openai-agents==0.22.3.API-backed workflows with several stable specialist roles, explicit delegation boundaries, and application-owned conversation history.
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.
Quick Start & Installation
pip install -U agency-swarm
Comparison vs. Top Agents & Frameworks Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| agency-swarm ★ | 4.6k | +5 | Python | MIT | Python agent orchestration with explicit, directional delegation |
| browser-use | 122.7k | +477 | Python | MIT | Python REPL and CDP for adaptive browser automation |
| langchain | 150.4k | +299 | Python | MIT | Modular Python framework for building agents across model providers |
| agentscope | 37.2k | +342 | Python | Apache-2.0 | Python ReAct SDK and FastAPI service for observable, interruptible agent workflo |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/VRSEN/agency-swarm.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about agency-swarm
How do I integrate an agency and control which agents can delegate?
Agency, declare allowed initiations with communication_flows, and call await agency.get_response(...). An edge such as lead > specialist lets the lead initiate contact through send_message; it does not grant the reverse direction. For history across sessions, provide load_threads_callback and save_threads_callback and manage storage in your application.Does Agency Swarm need a GPU, and how should I size the host?
Can we self-host it in a commercial product?
When should we pick Agency Swarm over the OpenAI Agents SDK directly?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy