AutoGen

Build autonomous and human-in-the-loop multi-agent AI systems with a layered, event-driven Python and .NET framework pioneered at Microsoft Research.

59.5Kstars
9Kforks
MIT License
Python

AutoGen is an open source framework for creating multi-agent AI applications where individual agents can communicate, collaborate, and delegate tasks autonomously or with human oversight. Originally developed at Microsoft Research, it introduced orchestration patterns that became foundational to the modern agentic AI ecosystem.

The framework is organized into three composable layers: a Core API built on event-driven message passing and an async runtime, an AgentChat API that provides high-level agent types and team orchestration, and an Extensions API with first- and third-party integrations for LLM providers, code executors, and external tools. This separation of concerns lets developers work at whatever level of abstraction their use case demands — from low-level custom runtimes to high-level declarative team configurations.

AutoGen ships with multiple built-in orchestration patterns including RoundRobin, Selector (LLM-driven speaker selection), Swarm (handoff-driven routing), and Magentic-One (a state-of-the-art general-purpose team for web browsing and code execution). The framework also includes AutoGen Studio, a no-code GUI for prototyping multi-agent workflows, and AgentBench for evaluating agent performance.

Note: As of early 2026, AutoGen entered maintenance mode. New users are directed to Microsoft Agent Framework (its enterprise successor), while existing AutoGen deployments continue to receive community support.

What You Get

  • A Core API with event-driven message passing, topic-based pub/sub subscriptions, and a single-threaded or distributed gRPC runtime for agent execution
  • AgentChat agents including AssistantAgent, CodeExecutorAgent, UserProxyAgent, and SocietyOfMindAgent for common interaction patterns
  • Team orchestration modes: RoundRobinGroupChat, SelectorGroupChat (LLM-driven), Swarm (handoff-based routing), DiGraph (DAG-based conditional workflows), and Magentic-One
  • An Extensions package with model clients for OpenAI, Azure OpenAI, Anthropic, Ollama, LlamaCpp, and Semantic Kernel, plus MCP tool integration
  • AutoGen Studio — a no-code web GUI for visually building, testing, and running multi-agent workflows backed by a FastAPI server and SQLite state store
  • Built-in code execution sandboxes (Docker, local process) and file-surfing agents for autonomous task completion
  • Declarative component configuration via ComponentModel and Pydantic schemas, enabling agents and teams to be serialized to JSON and reconstructed
  • Cross-language support with parallel Python and .NET implementations sharing the same protocol via protobuf and gRPC

Common Use Cases

  • Research automation — Deploy a team of specialized agents that search the web, execute code, and synthesize findings into structured reports without constant user input
  • Software development assistance — Combine a coding agent with a reviewer agent and a test-runner agent to iterate on code, catch bugs, and validate outputs in a closed loop
  • Customer support triage — Build a Swarm-based handoff system where a router agent delegates tickets to specialist agents for billing, technical, or escalation workflows
  • Data analysis pipelines — Chain a data-fetching agent, a code-writing agent, and a visualization agent in a SelectorGroupChat so an LLM decides the next step at each stage
  • No-code agent prototyping — Use AutoGen Studio to drag-and-drop agent definitions, configure LLM models, and run experiments without writing Python
  • Enterprise agentic orchestration — Leverage the gRPC worker runtime to distribute agents across multiple processes or machines for scalable, long-running tasks

Under The Hood

Architecture AutoGen’s design follows a strict three-layer hierarchy where each layer has clearly scoped responsibilities and communicates upward only through defined interfaces. The Core layer provides an event-driven pub/sub runtime where agents register subscriptions by topic type and receive messages asynchronously via decorated handler methods — enabling true decoupling between message producers and consumers. The AgentChat layer builds on top of Core by introducing synchronous team abstractions (GroupChat) that manage speaker selection, message threading, and termination conditions, effectively translating high-level conversational state into lower-level topic publishes. The Extensions layer adds pluggable components — model clients, code executors, memory backends, MCP workbenches — that conform to abstract interfaces defined in Core, ensuring that swapping providers requires no changes to application logic. The result is an architecture that can run a two-agent conversation in a single process or scale to distributed agent fleets behind gRPC, with the same application code.

Tech Stack The Python implementation runs on Python 3.10+ with asyncio as the concurrency backbone, using pytest-asyncio for test coroutines. Pydantic v2 provides runtime type validation and JSON serialization for all agent configurations and component models. The distributed runtime uses gRPC with protobuf message definitions shared between the Python and .NET implementations, enabling cross-language agent federation. Model integrations target the OpenAI, Azure OpenAI, Anthropic, Ollama, and Semantic Kernel APIs, with a unified ChatCompletionClient interface that abstracts provider differences. Code execution runs inside Docker containers or local subprocesses via a CodeExecutor abstraction. AutoGen Studio uses FastAPI and SQLite on the backend, and a React frontend bundled separately. Ruff provides linting, Pyright and mypy handle type checking, and uv manages the workspace of six interdependent Python packages.

Code Quality The codebase demonstrates a strong commitment to type safety, with full Pyright and mypy annotations across all packages and strict type checking enabled in the workspace configuration. Tests are comprehensive — each core package carries its own test suite covering runtime behavior, component serialization, message routing, and agent state persistence using pytest and pytest-asyncio. CI workflows on GitHub Actions run linting, type checking, and tests across the matrix. Error handling follows explicit async patterns with CancellationToken propagation and typed exception hierarchies (CantHandleException, MessageDroppedException). The declarative ComponentModel pattern ensures that configuration errors surface at deserialization time rather than runtime. AutoGen Studio includes dedicated test files for database management, team orchestration, and MCP integration.

What Makes It Unique AutoGen’s most distinctive contribution is its vocabulary of multi-agent orchestration patterns implemented as first-class primitives: handoff-driven Swarm routing, LLM-driven SelectorGroupChat speaker election, DiGraph-based conditional workflows, and the Magentic-One general-purpose team architecture. The declarative ComponentModel system — where every agent, model client, tool, and termination condition can be serialized to a provider string plus a JSON config blob and reconstructed at runtime — is a production-grade capability that most agentic frameworks treat as an afterthought. The cross-language parity between Python and .NET through shared protobuf definitions means teams can federate agents written in different languages in the same distributed runtime, an unusual capability in the open source AI tooling space.

Self-Hosting

AutoGen’s code is released under the MIT License (see LICENSE-CODE), while documentation is under CC-BY-4.0. The MIT License is permissive: it allows commercial use, modification, and distribution without requiring you to open-source your own application code. There are no copyleft implications for self-hosters — you can embed AutoGen in a proprietary product and ship it to customers without licensing obligations beyond attribution.

Running AutoGen yourself means managing Python package dependencies (six interdependent packages in a uv workspace), configuring LLM API keys for whichever model provider you choose, and optionally deploying a gRPC runtime host process for distributed workloads. AutoGen Studio requires a FastAPI server process with a SQLite database and a built React frontend. Code execution agents that use Docker sandboxes require a running Docker daemon with appropriate image management. Infrastructure complexity scales with your orchestration ambitions: a simple two-agent setup runs in a single Python process, while production Magentic-One deployments involve multiple networked agent processes, browser automation, file system access, and durable state management.

As of 2026, AutoGen is in maintenance mode, meaning the project no longer receives new features from Microsoft and is community-managed going forward. Microsoft’s successor, Microsoft Agent Framework (formerly known internally as the enterprise-ready evolution of AutoGen), now carries Microsoft’s official support commitment, SLA expectations, and long-term API stability guarantees. Existing AutoGen deployments will receive security patches from the community but not product roadmap investment. Organizations evaluating multi-agent frameworks for new greenfield projects should weigh the trade-off between AutoGen’s larger existing ecosystem and community resources versus Microsoft Agent Framework’s forward-looking enterprise support.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack

No spam. Unsubscribe anytime.

Join 750+ subscribers
No spam. Unsubscribe anytime.

Search