What Is AutoGen?
AutoGen is Microsoft Research's framework for building multi-agent AI systems through structured agent conversation. The core metaphor is dialogue: agents talk to each other, request things from each other, and iteratively produce outputs through back-and-forth exchange.
This distinguishes AutoGen from frameworks like CrewAI, where tasks flow sequentially from one agent to the next. In AutoGen, agents can challenge each other's outputs, request revisions, and converge on answers through genuine multi-turn dialogue.
The Two-Agent Pattern
The most common AutoGen pattern pairs an AssistantAgent with a UserProxyAgent:
import autogen
config_list = [{"model": "gpt-4o", "api_key": "YOUR_KEY"}]
assistant = autogen.AssistantAgent(
name="assistant",
llm_config={"config_list": config_list},
)
user_proxy = autogen.UserProxyAgent(
name="user_proxy",
human_input_mode="NEVER", # fully automated
max_consecutive_auto_reply=10,
code_execution_config={
"work_dir": "coding",
"use_docker": False,
},
)
user_proxy.initiate_chat(
assistant,
message="Plot a chart of AAPL stock price over the past year using yfinance.",
)
The AssistantAgent writes Python code. The UserProxyAgent executes it in a sandbox, sends back the output, and the loop continues until the task is complete or the reply limit is reached.
Group Chat
For more complex tasks, GroupChatManager orchestrates conversations between multiple specialized agents:
groupchat = autogen.GroupChat(
agents=[user_proxy, coder, reviewer, planner],
messages=[],
max_round=12,
)
manager = autogen.GroupChatManager(groupchat=groupchat, llm_config={"config_list": config_list})
user_proxy.initiate_chat(manager, message="Build and test a REST API for a todo list")
The manager decides which agent speaks next based on context.
AutoGen Studio
AutoGen Studio is a no-code web interface for building and testing agent workflows. You define agents, tools, and workflows through a GUI and test them interactively. It's useful for prototyping before committing to code.
The v0.4 Actor Model Rewrite
AutoGen v0.4 is a ground-up rewrite using an actor-based concurrency model. Agents run as independent processes and communicate via message passing, enabling true parallelism. The API changed significantly — check the v0.4 migration guide before upgrading existing projects.