AutoGen is an open-source programming framework from Microsoft Research for building applications in which several language model agents converse with each other, call tools, run code and involve humans to complete a task. Among AI frameworks & tools, it is best known for popularizing the multi-agent conversation pattern, where a problem is solved through structured message exchange rather than a single long prompt.
The framework is written primarily in Python, with a .NET implementation, and is also referred to as Microsoft AutoGen. It occupies the same space as agent orchestration libraries such as LangGraph, CrewAI and Semantic Kernel, but its defining idea is that agents are conversational participants whose roles, turn order and termination rules the developer configures.
How AutoGen organizes agents into conversations
AutoGen models every participant as an agent that sends and receives messages. An agent can be backed by a language model, by a tool executor, by a code runner or by a human, and the framework routes messages between them until a termination condition is met.
The original design, known as AutoGen 0.2, centered on the ConversableAgent class and two common specializations: the AssistantAgent, which drafts answers and code, and the UserProxyAgent, which executes code and can stand in for a human. A group chat manager selected the next speaker among several agents, either in a fixed rotation or by asking a model to choose.
The AutoGen 0.4 redesign, released in early 2025, rebuilt the framework around an asynchronous, event-driven architecture. Agents became actors that exchange typed messages through a runtime, which allows distributed deployment, better observability and agents written in different languages.
The table below summarizes the main building blocks a developer works with in current versions.
| Component | Role | Typical use |
|---|---|---|
| Core API | Low-level actor runtime with typed messages | Custom event-driven and distributed agent systems |
| AgentChat API | High-level preset agents and team patterns | Rapid prototyping of conversational workflows |
| Extensions | Model clients, tools and code executors | Connecting to model providers and sandboxes |
| AutoGen Studio | Low-code graphical interface | Designing and testing teams without writing code |
| AutoGen Bench | Benchmarking harness | Measuring agent performance on repeatable tasks |
Team patterns and conversation control
AutoGen expresses collaboration through team patterns that decide who speaks next. Choosing the right pattern matters more than prompt wording, because it determines cost, latency and reliability of the whole system.
The following table compares the most common patterns available in the AgentChat layer.
| Pattern | How the next speaker is chosen | Best suited for |
|---|---|---|
| Round-robin group chat | Fixed rotation among agents | Predictable review loops such as writer and critic |
| Selector group chat | A model picks the next agent from descriptions | Open-ended tasks with specialized roles |
| Swarm | Agents hand off control explicitly | Customer service flows with clear handoffs |
| Magentic-One | An orchestrator plans and delegates | Complex web and file tasks needing planning |
| Two-agent chat | Assistant and executor alternate | Code generation with automatic execution |
Every team needs an explicit stopping rule, such as a maximum number of messages, a keyword like TERMINATE or a token budget. Without one, agents can loop indefinitely, repeating polite acknowledgments while consuming tokens.
How AutoGen compares with related frameworks
AutoGen differs from neighboring tools mainly in its conversation-first abstraction. Graph-based frameworks describe workflows as nodes and edges, while role-based frameworks describe crews of agents with tasks; AutoGen describes who talks to whom and when the talking stops.
| Framework | Central abstraction | Main strength |
|---|---|---|
| AutoGen | Agents exchanging messages in teams | Flexible multi-agent dialogue and code execution |
| LangGraph | Stateful graph of nodes and edges | Explicit control flow and checkpointing |
| CrewAI | Crews of role-based agents with tasks | Simple setup for role-driven pipelines |
| Semantic Kernel | Plugins and planners in an SDK | Enterprise integration in .NET and Python |
| OpenAI Agents SDK | Agents with handoffs and guardrails | Lightweight orchestration around one provider |
The project lineage is also worth knowing. In late 2024, several original creators continued the 0.2 line as a community fork called AG2, while Microsoft pursued the 0.4 architecture. In 2025, Microsoft announced the Microsoft Agent Framework, which combines ideas from AutoGen and Semantic Kernel, and positioned AutoGen itself for maintenance and research use rather than new feature development.
Using AutoGen in practice
A typical AutoGen application starts with a model client, a set of agents with system messages and tool definitions, a team pattern and a termination condition. Developers then stream the conversation, inspect each message and refine agent descriptions until the team behaves predictably.
The decision table below helps match project needs with the appropriate AutoGen layer or an alternative.
| Situation | Recommended choice | Reason |
|---|---|---|
| Quick multi-agent prototype | AgentChat with a round-robin team | Minimal code and readable message logs |
| Distributed or cross-language agents | Core API with a distributed runtime | Actors communicate through typed events |
| Non-developers designing workflows | AutoGen Studio | Visual configuration and live testing |
| New long-lived production system | Evaluate Microsoft Agent Framework | AutoGen receives limited new features |
| Strict, auditable process steps | A graph-based framework | Explicit edges are easier to verify |
Code execution deserves special care. AutoGen can run generated code locally or in a Docker-based executor, and the container option should be the default whenever agents write and execute code, because model-generated scripts can delete files or reach the network.
Limitations and common mistakes
Multi-agent systems built with AutoGen inherit the weaknesses of the underlying models and add coordination overhead. Each extra agent multiplies token usage and latency, and errors made early in a conversation tend to propagate.
| Symptom | Likely cause | Fix |
|---|---|---|
| Endless polite exchanges | Missing or weak termination condition | Add message limits and explicit stop keywords |
| Wrong agent keeps speaking | Vague agent descriptions in a selector team | Write distinct, task-specific descriptions |
| High cost per task | Too many agents for a simple problem | Merge roles or use a single agent with tools |
| Unsafe file changes | Local code execution | Use a sandboxed container executor |
| Code breaks after upgrade | API changes between 0.2 and 0.4 | Pin versions and follow migration guidance |
- More agents is not automatically better; a single well-instructed agent often matches a team on narrow tasks.
- Version confusion is common, because tutorials for 0.2, 0.4 and AG2 use different class names.
- Evaluation is essential, since conversational behavior varies between runs with the same input.
A plain-language summary
AutoGen is a toolkit that lets programmers set up a small team of AI assistants that talk to each other. One assistant might write a plan. Another might write code. A third might check the result, much like colleagues passing a document around a table.
The programmer decides who is on the team and what each member does. The programmer also decides when the discussion must end. The work happens through conversation. Good rules for that conversation matter as much as the skill of each assistant.
An example from practice
A data analytics team at a mid-sized retailer wants weekly sales summaries without manual spreadsheet work. A developer builds an AutoGen team with three agents: a planner that breaks the request into steps, a coder that writes Python to query a sales database and draw charts, and a reviewer that checks figures against simple sanity rules.
The team runs in a Docker-based code executor with read-only database credentials, a limit of 20 messages and a stop keyword issued by the reviewer. In early tests, the selector pattern sometimes let the coder answer twice in a row, so the developer switched to a round-robin team with clearer descriptions.
After two weeks of tuning, the system produces a complete summary in about four minutes instead of roughly an hour of analyst time, and the analyst now only reviews the final report and its charts before sending it to management.