ScriptsApr 6, 2026·2 min read

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.

AG
Agent Toolkit · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

pip install autogen-agentchat autogen-ext
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.teams import RoundRobinGroupChat
from autogen_ext.models.openai import OpenAIChatCompletionClient

model = OpenAIChatCompletionClient(model="claude-sonnet-4-20250514", api_key="sk-ant-...")

coder = AssistantAgent("coder", model_client=model,
    system_message="You write Python code to solve tasks.")
reviewer = AssistantAgent("reviewer", model_client=model,
    system_message="You review code for bugs and improvements.")

team = RoundRobinGroupChat([coder, reviewer], max_turns=4)
result = await team.run(task="Write a function to find prime numbers up to N")

Intro

AutoGen is a framework by Microsoft Research for building multi-agent conversational AI systems with 40,000+ GitHub stars. Multiple AI agents with different roles chat with each other to collaboratively solve complex tasks — a coder writes code, a reviewer checks it, a planner coordinates, and a human approves. AutoGen v0.4 (latest) features an event-driven architecture, pluggable components, and first-class support for human-in-the-loop workflows. Best for teams building complex multi-agent systems where agents need to debate, iterate, and collaborate. Works with: Claude, GPT-4, any OpenAI-compatible model. Setup time: under 3 minutes.


Core Concepts

Agents

Each agent has a role and system message:

planner = AssistantAgent("planner", model_client=model,
    system_message="Break down complex tasks into steps. Coordinate with coder and reviewer.")
coder = AssistantAgent("coder", model_client=model,
    system_message="Write clean, tested Python code.")
reviewer = AssistantAgent("reviewer", model_client=model,
    system_message="Review code for bugs, edge cases, and improvements.")

Teams

Round Robin — agents take turns:

team = RoundRobinGroupChat([planner, coder, reviewer], max_turns=6)

Selector — a model picks who speaks next:

team = SelectorGroupChat([planner, coder, reviewer],
    model_client=model)  # Model decides speaking order

Human-in-the-Loop

from autogen_agentchat.agents import UserProxyAgent

human = UserProxyAgent("human")
team = RoundRobinGroupChat([coder, reviewer, human], max_turns=10)
# Pauses for human input when human's turn comes

Code Execution

Agents can write and run code in sandboxed environments:

from autogen_ext.code_executors.docker import DockerCommandLineCodeExecutor

executor = DockerCommandLineCodeExecutor()
coder = AssistantAgent("coder", model_client=model,
    code_executor=executor)

Tool Use

from autogen_core import FunctionTool

def search_web(query: str) -> str:
    'Search the web for information.'
    return tavily_search(query)

search_tool = FunctionTool(search_web, description="Search the web")
agent = AssistantAgent("researcher", model_client=model, tools=[search_tool])

Real-World Example: Research Paper

researcher = AssistantAgent("researcher", tools=[search_tool])
writer = AssistantAgent("writer", system_message="Write academic-style content")
editor = AssistantAgent("editor", system_message="Edit for clarity and accuracy")
human = UserProxyAgent("professor")

team = SelectorGroupChat([researcher, writer, editor, human])
result = await team.run(task="Write a literature review on LLM agents in software engineering")

Key Stats

  • 40,000+ GitHub stars
  • By Microsoft Research
  • Event-driven architecture (v0.4)
  • Human-in-the-loop support
  • Docker code execution sandbox

FAQ

Q: What is AutoGen? A: A Microsoft Research framework for building multi-agent AI systems where agents converse and collaborate to solve complex tasks, with human-in-the-loop support.

Q: Is AutoGen free? A: Yes, open-source under MIT license.

Q: How is AutoGen different from CrewAI? A: AutoGen focuses on agent conversations and debate. CrewAI focuses on role-based task delegation. AutoGen is more flexible for complex multi-turn interactions.


🙏

Source & Thanks

Created by Microsoft Research. Licensed under MIT.

autogen — ⭐ 40,000+

Thanks to Microsoft Research for pioneering multi-agent conversations.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets