AutoGen (Microsoft): Multi-Agent Conversations for Data
What it is: AutoGen is Microsoft Research's framework for building multi-agent applications where agents solve tasks by talking to each other โ one agent proposes Python code, another executes it and reports results, and the loop continues until the task is done. That conversation-plus-code-execution pattern made it an early favorite for automated data analysis.
Quick answer: AutoGen is Microsoft's open-source multi-agent framework built around conversations between agents, including code-execution agents that write and run Python โ a strong fit for data analysis. Know the ecosystem before adopting: Microsoft is folding AutoGen's ideas into the unified Microsoft Agent Framework, and AG2 is the community fork continuing the original 0.2-style API.
What is the conversation-pattern model?
Instead of a fixed pipeline, AutoGen models work as messages exchanged between agents until a termination condition. The classic pair is an assistant agent (writes analysis and code) plus a user-proxy or code-executor agent (runs the code, returns output or errors). Errors feed back into the conversation, so the assistant self-corrects โ a natural loop for exploratory data work. Group chats extend this to several specialists with a manager choosing who speaks next, and termination can be a message pattern (like "TERMINATE"), a turn limit, or a custom condition.
pip install autogen-agentchat "autogen-ext[openai]"
# AgentChat API (v0.4+ style, simplified)
from autogen_agentchat.agents import AssistantAgent, CodeExecutorAgent
from autogen_agentchat.teams import RoundRobinGroupChat
coder = AssistantAgent("analyst", model_client=client,
system_message="Write Python to analyze sales.csv and report trends.")
executor = CodeExecutorAgent("executor", code_executor=docker_executor)
team = RoundRobinGroupChat([coder, executor], max_turns=10)
result = await team.run(task="Which region grew fastest last quarter?")
Why are code-execution agents good for data analysis?
Because pandas is more reliable than an LLM doing arithmetic. AutoGen's executor agents run generated code in a subprocess or Docker container, so the model writes df.groupby("region")["revenue"].sum() and the real numbers come from real execution, not token prediction. Failed code produces a traceback the assistant sees and fixes. Always prefer the Docker executor for anything beyond toy scripts โ you are running LLM-generated code.
Practical tips from real use: set a hard max_turns limit or the pair can loop expensively on a stubborn bug; pin package versions inside the execution environment so generated code doesn't break on API drift; and log every executed snippet, because the conversation transcript is your only audit trail when a number looks wrong. For long analyses, ask the assistant to save intermediate DataFrames to disk so a crashed turn doesn't restart from zero.
What's happening with AutoGen, AG2, and the Microsoft Agent Framework?
An honest status check, accurate as of mid-2026 but moving fast: the original AutoGen team's work is being folded into the Microsoft Agent Framework, which merges AutoGen's research ideas with Semantic Kernel into one supported product โ Microsoft points new production projects there. Meanwhile AG2 (ag2ai/ag2) is the community fork by AutoGen's original creators, continuing the familiar 0.2-style ConversableAgent API under the AG2 name. The microsoft/autogen repo remains available in maintenance mode. Verify current guidance in the repos before committing a new project.
AutoGen vs CrewAI vs LangGraph: which fits your data workflow?
AutoGen shines at conversational, self-correcting code execution โ "figure it out by writing Python" tasks like exploratory analysis. CrewAI is higher-level and faster to prototype role-based teams with defined task sequences. LangGraph gives the most explicit control โ typed state, checkpoints, human-in-the-loop โ and is the safest bet for production pipelines. Given AutoGen's transition, many teams starting today choose LangGraph or CrewAI unless they're committed to the Microsoft stack.
Author & links
Author: Microsoft (Research); community fork by AG2
Repo: github.com/microsoft/autogen ยท github.com/ag2ai/ag2
License: MIT (code)
Related skills
Compare role-based teams in CrewAI or explicit graph control in LangGraph.
โ Back to Agent Frameworks