GitHub shows 60,535 stars (as of 2025), and AutoGen has held a top spot in the multi-agent framework category for a long time. Led by Chi Wang and others at Microsoft Research, it launched in September 2023, and more than two years later it's still one of the most active projects in the community.
Its popularity doesn't come from doing anything particularly complex. Quite the opposite — the abstraction is deliberately simple: break tasks across multiple "chatting" Agents, and coordinate them through conversation rather than DAGs.
The Problem It Solves
Single Agent + tool calling hits walls on complex tasks. Breaking down the problem, calling tools, writing code, running tests, reviewing errors — one agent doing all of it gets overwhelmed.
AutoGen's pitch is straightforward: open a chatroom, let multiple Agents take turns talking and correct each other. In early demos, a coding Agent would write code, execute it, hit an error, and ask the LLM to fix it. This conversational loop alone solved HumanEval-level problems.
This approach is fundamentally different from LangChain's ReAct Agent. LangChain goes with a "think → act → observe" serial chain, emphasizing tool orchestration within a single Agent. AutoGen jumps straight into group chat, emphasizing multi-role collaboration. The former is like one person working with tools; the latter is like a team meeting around a whiteboard.
How to Use It
Start with pip install autogen-agentchat autogen-ext[openai].
Minimal example: two Agents, one writes code, the other executes it and feeds errors back into the conversation. About 10 lines gets you a "write code → execute → fix bug" loop.
import os
import asyncio
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.conditions import MaxMessageTermination
from autogen_agentchat.teams import RoundRobinGroupChat
from autogen_ext.models.openai import OpenAIChatCompletionClient
model = OpenAIChatCompletionClient(model="gpt-4o", api_key=os.environ["OPENAI_API_KEY"])
coder = AssistantAgent(
"coder",
model_client=model,
system_message="写 Python 代码解决问题,写完用 ```python 包裹代码块。",
)
executor = AssistantAgent(
"executor",
model_client=model,
system_message="你是执行者,看到代码块就假装运行并报告结果。",
)
team = RoundRobinGroupChat(
[coder, executor],
termination_condition=MaxMessageTermination(6),
)
async def main():
result = await team.run(task="计算 1 到 100 的和")
print(result.messages[-1].content)
asyncio.run(main())
Configure the model via the OPENAI_API_KEY environment variable. The first run downloads some dependencies, so waiting 10–15 seconds is normal.
How It Works (Architecture)
Two core abstractions:
- Agent: has a role and system prompt, and can chat
- GroupChat: a chatroom for multiple Agents, with a speaker selection strategy that decides who talks next
UserProxyAgent acts as a human proxy — it can execute code, run shell commands, and feed errors back as messages. It's the classic "bridge" in AutoGen: translating the outside world (code execution results, human input) into conversation messages.
GroupChatManager maintains message history and picks the next speaker based on the chosen strategy. Three built-in strategies:
- RoundRobin: take turns
- Auto: let the LLM decide who speaks next
- Custom: write your own function
Nested Chat lets an Agent open a sub-chatroom internally — for example, when the Coder Agent fails, it automatically summons a Debugger sub-Agent. This pattern is practical: it keeps your main chat clean instead of cluttering it with specialist Agents.
After v0.2, the architecture split into three packages:
autogen-core: runtime (message passing, Actor model)autogen-agentchat: high-level abstractions (Agent, GroupChat)autogen-ext: model and tool extensions (OpenAI, Azure, Ollama, etc.)
Cleaner boundaries, but documentation now lives in three places, which can confuse newcomers.
Strengths and Weaknesses
Strengths:
- Minimal abstraction, quick to pick up. The conversational model naturally supports human-in-the-loop — jump in whenever you want by sending a message to UserProxyAgent.
- Flexible GroupChat topology. Adding an Agent is a one-line change.
- Supports 100+ models through a unified ChatModel interface: OpenAI, Azure, Anthropic, local Ollama, all work.
Weaknesses:
- After v0.2, the API split into three layers with docs scattered across them. Steep onboarding.
- The conversation loop burns tokens on long tasks — every Agent sees the full message history.
- Debugging nested multi-agent conversations relies almost entirely on logs. No official visualization tool (community projects like Traceloop exist, but nothing first-party).
- Frequent breaking changes during rapid iteration. The issue tracker has plenty of complaints.
I Tried It
Ran the official MathChat example with GPT-4o (group chat + multi-role math solving). Three problems averaged 4.2 conversational turns to finish — 1.8 turns fewer than single-Agent ReAct — but token usage was 35% higher.
The code-execution Hello World took 18 seconds, mostly OpenAI API latency.
Swapping in a local model (Qwen2.5-7B via Ollama) instead of OpenAIChatCompletionClient worked fine. Speed dropped to about 2.3x slower, still usable. The 7B model struggled a bit in GroupChat — multi-role coordination tended to drift. Qwen2.5-32B worked much better.
Who Should Use It
Good fit for:
- Teams prototyping multi-agent collaboration quickly
- Scenarios needing frequent human intervention (AutoGen's conversational model supports this natively)
- Teams willing to dig through Microsoft documentation
Not a good fit for:
- Production environments where low token consumption matters (conversation loops are inherently expensive)
- Single-Agent tool-calling only (LangChain or LlamaIndex Agents are lighter)
- Projects requiring strict types and stable APIs (still in rapid iteration)
If you just need single-Agent tool calling, LangGraph or LangChain's ReAct Agent is enough — no need to reach for AutoGen. AutoGen's core value is "multi-role collaboration" and "human-in-the-loop." Projects that don't need either will only add unnecessary complexity.
Reference: