All migration samples are available in the autogen-migration samples directory.
Key Differences at a Glance
API Mapping Reference
Basic Agent Creation
Tools and Functions
AutoGen uses
FunctionTool wrappers; AF uses @tool decorators with automatic schema inference from Python type hints and docstrings.Thread Management
Streaming Responses
Orchestration Pattern Migrations
Round Robin Group Chat → Sequential Builder
AutoGen’sRoundRobinGroupChat executes agents in order. AF provides SequentialBuilder for the same pattern.
- AutoGen
- Agent Framework
Advanced: Sequential with Cycles
Advanced: Sequential with Cycles
For AutoGen patterns with multiple rounds, use AF’s
WorkflowBuilder with cyclic edges:Selector Group Chat → Group Chat Builder
AutoGen’sSelectorGroupChat uses an LLM to choose the next speaker. AF’s GroupChatBuilder provides the same capability.
Swarm Pattern → Handoff Builder
AutoGen’sSwarm enables agent handoffs. AF’s HandoffBuilder provides structured handoff coordination.
- AutoGen
- Agent Framework
AF’s
HandoffBuilder supports human-in-the-loop patterns via HandoffAgentUserRequest for interactive workflows.Magentic One → Magentic Builder
AutoGen’sMagenticOneGroupChat provides orchestrated multi-agent workflows. AF has a direct equivalent.
Agent as Tool Pattern
Both frameworks support using agents as tools for hierarchical agent patterns.Agent as Tool Migration
Agent as Tool Migration
Breaking Changes and Deprecations
-
Default Behavior: AutoGen agents are single-turn by default; AF agents are multi-turn. Adjust
max_tool_iterationsexpectations. -
Thread Management: AutoGen maintains conversation state implicitly; AF requires explicit
create_session(). -
Tool Wrappers: AutoGen’s
FunctionToolmust be replaced with AF’s@tooldecorator. -
Message Types: AutoGen uses
ChatMessage/TextMessage; AF usesMessagewith.text,.role, and.author_name. -
Termination Conditions: AutoGen’s
TerminationConditionclasses must be converted to AF’s lambda-based or custom termination logic. -
Handoff Messages: AutoGen’s
HandoffMessagemust be replaced with AF’sHandoffAgentUserRequestfor human-in-the-loop patterns.
Migration Checklist
1
Update agent construction
Replace
AssistantAgent(model_client=...) with client.as_agent(...)2
Convert tools
Transform
FunctionTool wrappers to @tool decorated functions3
Add explicit sessions
Create sessions with
agent.create_session() for stateful conversations4
Adjust default behavior expectations
Account for AF’s multi-turn default (vs. AutoGen’s single-turn default)
5
Update orchestration patterns
RoundRobinGroupChat→SequentialBuilderSelectorGroupChat→GroupChatBuilderSwarm→HandoffBuilderMagenticOneGroupChat→MagenticBuilder
6
Convert termination conditions
Replace AutoGen termination classes with AF’s lambda-based conditions
7
Test streaming behavior
Update streaming logic to handle AF’s
AgentResponseUpdate eventsCommon Migration Patterns
Converting System Messages
Converting Descriptions
Converting Streaming
Additional Resources
Migration Samples
Runnable side-by-side code comparisons for all patterns
Agent Framework Docs
Complete documentation for the Agent Framework
AutoGen Docs
Official AutoGen documentation
Community Support
Get help from the community on Discord
Migration Tips
- Start with single-agent patterns before multi-agent orchestrations
- Test default behavior early — AF’s multi-turn default can produce different results than AutoGen’s single-turn default
- Use explicit sessions liberally during development; optimize session management after achieving parity
- For group chats, AF’s
GroupChatBuildersimplifies speaker selection — no need to manually track turn order - Handoff patterns are more structured in AF; use
HandoffBuilderfor clearer coordination logic - Tool approval is explicit in AF via
approval_mode; always use"always_require"in production for actions
Installation Commands
The
--pre flag is needed during the Agent Framework preview period. Both SDKs can coexist in the same environment for gradual migration.