SuperAPIAI Directory

Microsoft

learn.microsoft.com · AI developer platforms

This page is a migration guide officially provided by Microsoft that explains in detail how to migrate from AutoGen to the Microsoft Agent Framework Python SDK. The content covers model client creation and configuration, single-agent feature mapping (including basic creation, session state management, streaming support, message types, tool integration, hosted tools, MCP support, agent-as-tool pattern, middleware, custom agents), multi-agent feature mapping (programming model, workflow vs. GraphFlow comparison, nested patterns, group chat patterns, human-in-the-loop, checkpointing and resumption), observability, and more. Through side-by-side code comparisons and runnable examples, the guide helps developers complete the migration step by step.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsWeb · API

About this tool

This page is a migration guide officially published by Microsoft, intended to help developers migrate AI agent applications built on AutoGen to the Microsoft Agent Framework Python SDK. AutoGen is an open-source framework initiated by Microsoft Research for building large language model (LLM)-based agents and multi-agent systems, and it pioneered concepts such as GroupChat and event-driven agent runtimes. Microsoft Agent Framework is a new-generation multilingual SDK developed by the core teams of AutoGen and Semantic Kernel. It inherits AutoGen's ideas while incorporating practical usage experience, and is positioned as the new foundation for future AI applications.

The guide first outlines the similarities and differences between the two frameworks: the similarities include creating agents around model clients, providing instructions, and attaching tools, and both support function tools, token streaming, multimodal content, and asynchronous I/O. The main differences are: in orchestration style, AutoGen uses an event-driven core plus high-level Team abstractions, while Agent Framework centers on typed graph-structured Workflows that route data along edges and activate executors when inputs are ready; in tools, AutoGen uses FunctionTool to wrap functions, while Agent Framework uses the @tool decorator to automatically infer schemas and adds hosted tools such as code interpreter and web search; in agent behavior, AssistantAgent executes a single turn by default (unless max_tool_iterations is increased), while Agent is multi-turn by default, continuously calling tools until a final answer is returned; in runtime, AutoGen provides embedded and experimental distributed runtimes, while Agent Framework currently focuses on single-process composition, with distributed execution still being planned.

The guide then expands on migration details module by module. The model client section introduces the creation and configuration of clients such as OpenAI, Azure OpenAI, and Foundry, and explains that Agent Framework's OpenAIChatClient supports the Responses API (including reasoning models and structured responses), which AutoGen does not have. The single-agent feature mapping section covers: basic agent creation and execution (Agent is stateless by default, and conversation history must be managed through AgentSession), the OpenAI Assistant agent equivalent solution (recommended migration to the Responses client or FoundryAgent), streaming support (the client and agent produce the same update structure, and chunk.text can be read), message types (AutoGen uses separate classes such as TextMessage and MultiModalMessage, while Agent Framework uses a unified Message and Role enum), tool creation and integration (Agent Framework automatically handles tool iteration and has a built-in mechanism to prevent infinite loops), hosted tools (provided only by Agent Framework; model and account support need to be confirmed), MCP server support (Agent Framework provides more complete built-in support; Python 1.23 uses the MCP SDK 2.x high-level client lifecycle and does not support WebSocket transport or MCP Tasks), the agent-as-tool pattern (Agent Framework's as_tool() does not require disabling parallel tool calls), middleware (new in Agent Framework, supporting cross-cutting concerns such as logging, security, and performance monitoring), and custom agents (the run method must be implemented and the SupportsAgentRun protocol satisfied).

The multi-agent feature mapping section notes that this is the area where the two frameworks differ the most. AutoGen provides the low-level event-driven autogen-core model and the high-level Team model, and bridging the two adds complexity; Agent Framework provides a unified Workflow abstraction that combines type safety, graph visualization, and flexible composition. The guide compares the design philosophy of Workflow and AutoGen's experimental GraphFlow, and introduces nesting patterns, group chat patterns (RoundRobinGroupChat, MagenticOneGroupChat, and future patterns), human-in-the-loop (Request-Response API), and checkpointing and resuming workflows. Finally, it briefly mentions observability support and provides links to runnable examples to help developers verify the migration step by step.

This guide is intended for Python developers who already use AutoGen and plan to migrate to Microsoft Agent Framework; readers are expected to havebasic experience with both frameworks. Some content on the page requires authorized access, which may limit full reading for users who are not logged in. The guide does not cover information such as specific charges, pricing, or platform support scope.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools