AutoGen — Microsoft Multi-Agent Conversation Framework
Framework by Microsoft Research for building multi-agent conversational AI systems. Agents chat with each other to solve tasks collaboratively. Supports human-in-the-loop and code execution. 40,000+ stars.
What it is
AutoGen is an open-source framework by Microsoft Research for building multi-agent conversational AI systems. Multiple agents chat with each other, divide work, execute code, and collaborate to solve complex tasks. It supports human-in-the-loop interaction where a human can join the conversation at any point.
AutoGen targets AI researchers and developers building systems where specialized agents (coder, reviewer, planner) work together through structured conversation.
How it saves time or tokens
AutoGen's multi-agent architecture distributes work across specialized agents, so each agent handles a focused subtask. This reduces the context each agent needs, lowering per-agent token consumption. The framework manages conversation flow, retries, and termination conditions automatically. Estimated token usage for this workflow is around 2,800 tokens.
How to use
- Install AutoGen:
pip install autogen-agentchat autogen-ext
- Create agents and a team:
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.teams import RoundRobinGroupChat
from autogen_ext.models.openai import OpenAIChatCompletionClient
model = OpenAIChatCompletionClient(model='gpt-4o')
coder = AssistantAgent('coder', model_client=model)
reviewer = AssistantAgent('reviewer', model_client=model)
team = RoundRobinGroupChat([coder, reviewer])
- Run the team with a task and agents collaborate through conversation rounds.
Example
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.teams import RoundRobinGroupChat
from autogen_ext.models.openai import OpenAIChatCompletionClient
model = OpenAIChatCompletionClient(model='gpt-4o')
coder = AssistantAgent('coder', model_client=model)
reviewer = AssistantAgent('reviewer', model_client=model)
team = RoundRobinGroupChat([coder, reviewer])
result = team.run(task='Write a Python function to merge two sorted lists')
print(result)
Related on TokRepo
- Multi-Agent Frameworks — AutoGen deep-dive and comparisons
- AI Tools for Agents — Browse agent frameworks and toolkits
Key considerations
When evaluating AutoGen for your workflow, consider the following factors. First, assess whether your team has the technical prerequisites to adopt this tool effectively. Second, evaluate the maintenance burden against the productivity gains. Third, check community activity and documentation quality to ensure long-term viability. Integration with your existing toolchain matters more than feature count alone. Start with a small pilot project before rolling out across the organization. Monitor resource usage during the initial adoption phase to identify bottlenecks early. Document your configuration decisions so team members can onboard independently.
Common pitfalls
- Agents can enter infinite conversation loops if termination conditions are not properly set; always define max rounds or stop criteria.
- Code execution happens locally by default; use Docker execution for safety when running untrusted code.
- The v0.2 and v0.4 APIs differ significantly; check which version your code targets.
Frequently Asked Questions
AutoGen 0.4 is a major rewrite with a new architecture. It introduces the autogen-agentchat and autogen-ext packages, replacing the monolithic autogen package. The APIs are not backward-compatible.
Yes. AutoGen supports any model through the model client abstraction. Use OpenAIChatCompletionClient for OpenAI-compatible APIs, or implement a custom client for other providers like Anthropic or local models.
You can add a human proxy agent to the conversation. When it is the human agent's turn, the framework pauses and waits for human input. The human can approve, reject, or modify the conversation direction.
Yes. Agents can write and execute Python code during conversation. By default, code runs locally. For safety, you can configure a Docker-based executor that runs code in an isolated container.
There is no hard limit. You can have two agents or dozens. The framework supports round-robin, selector-based, and custom conversation patterns. Performance depends on the number of conversation rounds and model latency.
Citations (3)
- AutoGen GitHub— Multi-agent conversational AI framework by Microsoft Research
- AutoGen Documentation— Supports human-in-the-loop and code execution
- AutoGen Tutorial— Multi-agent conversation patterns
Related on TokRepo
Source & Thanks
Created by Microsoft Research. Licensed under MIT.
autogen — ⭐ 40,000+
Thanks to Microsoft Research for pioneering multi-agent conversations.
Discussion
Related Assets
Moodle — Open-Source Learning Management System
The most widely used open-source learning platform, providing course management, assessments, and collaboration tools for educators and organizations worldwide.
Sylius — Headless E-Commerce Framework on Symfony
An open-source headless e-commerce platform built on Symfony and API Platform, designed for developers who need a customizable and API-first commerce solution.
Akaunting — Free Self-Hosted Accounting Software
A free, open-source online accounting application built on Laravel for small businesses and freelancers to manage invoices, expenses, and financial reports.