/ AI, AI-AGENTS, AUTOMATION, PYTHON

AutoGen: Microsoft's framework for building AI agents and multi-agent applications

AutoGen is Microsoft’s open-source framework for building AI agents and multi-agent applications. It started as a Microsoft Research project and pioneered ideas like GroupChat orchestration and an event-driven agent runtime — concepts that have since spread across the whole agent-framework ecosystem.

This post walks through AutoGen’s current architecture, a quick start you can run today, and — since the framework has moved fast in 2026 — where it fits now that Microsoft has shipped a successor.


Architecture: four layers, pick your altitude

AutoGen is organized as a stack, and you choose the layer that matches how much control you need.

  • Core — an event-driven programming layer for building scalable, deterministic multi-agent systems. This is where you go for distributed runtimes and fine-grained control over message passing.
  • AgentChat — a task-driven, high-level API built on top of Core. It ships GroupChat, pre-built agents, code execution, and is the layer most people actually write code against (Python 3.10+).
  • Extensions — first-party and third-party integrations implemented against Core/AgentChat interfaces: AzureAIChatCompletionClient, DockerCommandLineCodeExecutor for sandboxed code execution, McpWorkbench for Model Context Protocol servers, and GrpcWorkerAgentRuntime for distributed agents.
  • Studio — a web-based, no-code UI for prototyping agents, rebuilt on the v0.4 AgentChat API. It adds a drag-and-drop team builder and lets you pause a run mid-execution to redirect agents or change team composition.

If you’re a Python developer, start with AgentChat. If you need serious multi-agent systems with custom runtimes, drop down to Core. If you just want to prototype without writing code, use Studio.

Quick start

Install AgentChat plus the OpenAI extension:

pip install -U "autogen-agentchat" "autogen-ext[openai]"

A minimal example: one assistant that can delegate to a specialist agent exposed as a tool.

import asyncio
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.tools import AgentTool
from autogen_agentchat.ui import Console
from autogen_ext.models.openai import OpenAIChatCompletionClient

async def main() -> None:
    model_client = OpenAIChatCompletionClient(model="gpt-4.1")

    math_agent = AssistantAgent(
        "math_expert",
        model_client=model_client,
        system_message="You are a math expert.",
        description="A math expert assistant.",
        model_client_stream=True,
    )
    math_agent_tool = AgentTool(math_agent, return_value_as_last_message=True)

    assistant = AssistantAgent(
        "assistant",
        system_message="You are a general assistant. Use expert tools when needed.",
        model_client=model_client,
        model_client_stream=True,
        tools=[math_agent_tool],
        max_tool_iterations=10,
    )
    await Console(assistant.run_stream(task="What is the integral of x^2?"))

asyncio.run(main())

Want a UI instead of code? pip install -U autogenstudio && autogenstudio ui --port 8080 gets you Studio running locally.

Human-in-the-loop

AgentChat gives you two patterns for keeping a person in the loop:

  • During execution — a UserProxyAgent hands control back to the user mid-run and blocks until they respond. Good for approvals that must happen before the agent continues.
  • Between runs — the team pauses after finishing its turns (via max_turns, TextMentionTermination, or HandoffTermination) and persists its state, so a human can review and resume asynchronously without holding a process open.

Tracing and observability

AutoGen’s Core runtime ships with built-in OpenTelemetry instrumentation following the emerging GenAI semantic conventions for agents and tools. It logs message metadata automatically and works with any OTel-compatible backend — the docs use Jaeger as the example, viewable at localhost:16686. If you don’t want the overhead, disable it with AUTOGEN_DISABLE_RUNTIME_TRACING or by passing a NoOpTracerProvider.

Where AutoGen fits in 2026

Here’s the update worth flagging if you’re picking a framework today: Microsoft has released the Agent Framework, built by the same AutoGen and Semantic Kernel teams, and describes it as “the new foundation for building AI applications going forward.” It keeps what worked in AutoGen — agents built around a model client with tools, streaming, async I/O — but replaces AutoGen’s Team-based orchestration with a typed, graph-based Workflow, infers tool schemas automatically via a @tool decorator, and adds hosted tools like a code interpreter and web search out of the box.

Practically:

  • Existing AutoGen systems — v0.4 still works and is documented; there’s no rug pull.
  • New projects — Microsoft’s own migration guide is a strong signal to evaluate Agent Framework first, especially if you need OpenAI’s Responses API or hosted tools.

Alternatives

The other framework worth comparing against is CrewAI, which takes a different split: Crews for role-based agent collaboration and Flows for deterministic, stateful orchestration around them, with a @persist() decorator for resumable state and a @human_feedback decorator for approval gates. CrewAI leans harder into being a standalone product (cloud, enterprise tooling) than AutoGen does.

If you’re choosing today: AgentChat/Core for tight OpenTelemetry-based observability and MCP support, Agent Framework if you want Microsoft’s forward-looking SDK and typed workflows, CrewAI if you want an opinionated, product-first orchestration layer.

Sources: AutoGen GitHub, AutoGen documentation, AutoGen to Agent Framework migration guide, CrewAI documentation.