Overview
AutoGen is a Python framework from Microsoft Research for building applications where one or more AI agents act on tasks. An agent wraps a language model and can call tools, talk to other agents, and work alongside a human. The core building block is the AssistantAgent, which you give a model client and then ask to run a task.
It fits the multi-agent systems category: instead of a single prompt-and-response, you compose several specialized agents (for example a math expert and a chemistry expert) and let a coordinating agent route work to them. AutoGen also connects to external tools through the Model Context Protocol (MCP), and ships AutoGen Studio, a no-code GUI for prototyping workflows.
Note: AutoGen is now in maintenance mode and is community-managed. It still works, but Microsoft points new users to its successor, the Microsoft Agent Framework, and provides a migration guide for existing AutoGen projects.
What it does
- AssistantAgent: a model-backed agent you call with run() or stream output with run_stream()
- Pluggable model clients via autogen-ext, such as OpenAIChatCompletionClient
- MCP support through McpWorkbench and StdioServerParams to connect external tool servers
- Multi-agent orchestration using AgentTool to expose one agent as a tool for another
- AutoGen Studio: a no-code GUI to prototype and run multi-agent workflows
- Async-first API built on asyncio for streaming responses and tool iterations
Getting started
AutoGen requires Python 3.10 or later. Install the AgentChat package with the OpenAI extension, set your API key, then run a minimal assistant agent.
Install AutoGen
Install AgentChat and the OpenAI client from Extensions with pip.
pip install -U "autogen-agentchat" "autogen-ext[openai]"Set your OpenAI API key
The quickstart calls the OpenAI API, so export your key first.
export OPENAI_API_KEY="sk-..."Run a Hello World agent
Create an assistant agent, run a task, and close the model client.
import asyncio
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient
async def main() -> None:
model_client = OpenAIChatCompletionClient(model="gpt-4.1")
agent = AssistantAgent("assistant", model_client=model_client)
print(await agent.run(task="Say 'Hello World!'"))
await model_client.close()
asyncio.run(main())Try AutoGen Studio (optional)
Install the no-code GUI and run it locally to prototype workflows in the browser.
pip install -U "autogenstudio"
autogenstudio ui --port 8080 --appdir ./my-appCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Orchestrating several specialized agents (for example domain experts) behind one coordinating assistant
- Building a tool-using agent that browses the web or calls external services via an MCP server
- Prototyping multi-agent workflows visually in AutoGen Studio before writing code
- Maintaining or migrating an existing AutoGen project toward the Microsoft Agent Framework
How AutoGen compares
AutoGen alongside other open-source multi-agent systems tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| MetaGPT | ★ 68.9k | A multi-agent framework that models a software company, assigning roles like product manager, architect, and engineer to generate code from a single prompt. |
| AutoGen | ★ 59.1k | Build multi-agent AI apps where agents converse with each other, tools, and humans |
| CrewAI | ★ 54k | A framework for assembling teams ('crews') of role-playing agents that divide tasks and collaborate to complete a goal. |
| OpenAI Agents SDK | ★ 27.3k | OpenAI's lightweight Python SDK for building multi-agent workflows using explicit handoffs, tools, and guardrails. |
| AgentScope | ★ 27k | A framework for building multi-agent applications with message passing, visual debugging tools, and distributed execution. |
| OpenAI Swarm | ★ 21.7k | An educational, lightweight framework from OpenAI for experimenting with multi-agent coordination through handoffs and routines. |
| PentAGI | ★ 17.8k | PentAGI is a self-hosted AI security platform that plans and runs penetration tests autonomously using a team of agents and 20+ built-in pentesting tools. |
| CAMEL | ★ 17.2k | A research-oriented framework for studying and building communicating agents that cooperate through role-playing conversations. |