VRSEN / agency-swarm
Reliable Multi-Agent Orchestration Framework
AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing VRSEN/agency-swarm in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler view🐝 Agency Swarm .jpg?alt=media&token=8c681331-2a7a-4a69-b21b-3ab1f9bf1a23) Overview The **Agency Swarm** is a framework for building multi-agent applications. It leverages and extends the OpenAI Agents SDK, providing specialized features for creating, orchestrating, and managing collaborative swarms of AI agents. This framework continues the original vision of Arsenii Shatokhin (aka VRSEN) to simplify the creation of AI agencies by thinking about automation in terms of real-world organizational structures, making it intuitive for both agents and users. **Migrating from v0.x?** Please see our Migration Guide for details on adapting your project to this new SDK-based version. Key Features • **Customizable Agent Roles**: Define distinct agent roles (e.g., CEO, Virtual Assistant, Developer) with tailored instructions, tools, and capabilities within the Agency Swarm framework, leveraging the underlying OpenAI Agents SDK. • **Full Control Over Prompts/Instructions**: Maintain complete control over each agent’s guiding prompts (instructions) for precise behavior customization. • **Type-Safe Tools**: Develop tools using Pydantic models for automatic argument validation, compatible with the OpenAI Agents SDK’s format. • **Orchestrated Agent Communication**: Agents communicate via a dedicated tool, with interactions governed by explicit, directional defined on the . • **Flexible State Persistence**: Manage conversation history by providing and to the , enabling persistence across sessions (e.g., DB/file storage). • **Multi-Agent Orchestration**: Build agent workflows on the OpenAI Agents SDK foundation, enhanced by Agency Swarm’s structured orchestration layer. • **Production-Ready Focus**: Built for reliability and designed for easy deployment in real-world environments. Installation > **v1.x note:** The framework targets the OpenAI Agents SDK + Responses API. > Migrating from v0.x? See the Migration Guide. Compatibility • **Python**: 3.12+ • **Model backends:** • **OpenAI (native):** GPT-5 family, GPT-4o, etc. • **Via LiteLLM (router):** Anthropic (Claude), Google (Gemini), Grok (xAI), Azure OpenAI, **OpenRouter (gateway)**, etc. • **OS**: macOS, Linux, Windows If you hit environment issues, see the Installation guide. Getting Started > **Recommended**: Start with the Agency Starter Template before you customize anything. • **Set Your OpenAI Key**: • Create a file with (auto-loaded), or export it in your shell: • **Create Tools**: Define tools using the modern decorator (recommended), or extend (compatible): or with : or convert from OpenAPI schemas: • **Define Agent Roles**: Start by defining the roles of your agents. For example, a CEO agent for managing tasks and a developer agent for executing tasks. Working from examples: • Browse for runnable demos and patterns you can adapt. • Use the file at the repo root with your AI coding agent (Cursor, Claude Code, etc.). • Follow the Cursor IDE guide: https://agency-swarm.ai/welcome/getting-started/cursor-ide • **Define Agency Communication Flows**: Establish how your agents will communicate with each other. In Agency Swarm, communication flows are directional. The operator defines allowed initiations (left can initiate a chat with right). • **Run a Demo** Web UI: Terminal: Programmatic (async): Need sync? exists, but async is recommended. Folder Structure Recommended agent folder structure: This structure ensures that each agent has its dedicated space with all necessary files to start working on its specific tasks. The can be customized to include tools and functionalities specific to the agent's role. Learn More • Installation: https://agency-swarm.ai/welcome/installation • From Scratch guide: https://agency-swarm.ai/welcome/getting-started/from-scratch • Cursor IDE workflow: https://agency-swarm.ai/welcome/getting-started/cursor-ide • Tools overview: https://agency-swarm.ai/core-framework/tools/overview • Agents overview: https://agency-swarm.ai/core-framework/agents/overview • Agencies overview: https://agency-swarm.ai/core-framework/agencies/overview • Communication flows: https://agency-swarm.ai/core-framework/agencies/communication-flows • Running an agency: https://agency-swarm.ai/core-framework/agencies/running-agency • Agency Code example: https://github.com/VRSEN/Agency-Code • Observability: https://agency-swarm.ai/additional-features/observability Contributing For details on how to contribute to Agency Swarm, please refer to the Contributing Guide. License Agency Swarm is open-source and licensed under MIT. Need Help? If you need help creating custom agent swarms for your business, check out our Agents-as-a-Service subscription, or schedule a consultation with me at https://calendly.com/vrsen/ai-readiness-call