Skip to main content
This guide helps Semantic Kernel (SK) developers move to the Microsoft Agent Framework (AF) with minimal guesswork. The frameworks share similar primitives but differ in their approach to agent orchestration, tool handling, and session management.
All migration samples are available in the semantic-kernel-migration samples directory.

Key Differences at a Glance

API Mapping Reference

Agent Creation

Tools and Functions

In production, always use approval_mode="always_require" for tools that perform actions. The migration samples use "never_require" only for brevity.

Session and Thread Management

AF agents are stateless by default. Always create and pass a session when you need conversation history to persist across run() calls.

Streaming Responses

Orchestration Patterns

Sequential Orchestration

Run agents one after another, passing output to the next agent.

Group Chat Orchestration

Multiple agents collaborate with an LLM-backed manager deciding who speaks next.

Process Framework (Fan-out/Fan-in)

Semantic Kernel’s Process Framework uses KernelProcess with steps and edges. Agent Framework uses WorkflowBuilder with custom executors.
AF workflows support checkpoints and resume capabilities that SK Process Framework does not. Use the workflow samples as a blueprint when modernizing complex agent graphs.

Provider-Specific Migrations

Azure AI Agent Service

OpenAI Assistants API

Copilot Studio

Breaking Changes and Deprecations

Important Breaking Changes
  1. Session Management: AF requires explicit session creation. SK’s implicit thread state won’t migrate automatically.
  2. Plugin System: SK’s @kernel_function plugins must be converted to AF’s @tool decorators.
  3. Response Types: SK returns ChatMessageContent objects; AF returns AgentResponse with .text, .messages, and .data properties.
  4. Orchestration Runtime: SK’s InProcessRuntime is not needed in AF. Workflows run directly without runtime management.
  5. Streaming Format: SK streams ChatMessageContent chunks; AF streams AgentResponseUpdate objects.

Migration Checklist

1

Update agent construction

Replace ChatCompletionAgent(service=...) with client.as_agent(...)
2

Convert plugins to tools

Transform @kernel_function class methods to standalone @tool functions
3

Add explicit sessions

Create sessions with agent.create_session() for stateful conversations
4

Update orchestrations

Replace SK orchestrations with AF builders (SequentialBuilder, GroupChatBuilder, WorkflowBuilder)
5

Migrate streaming code

Update streaming logic to handle AgentResponseUpdate instead of ChatMessageContent chunks
6

Test with sample workflows

Run side-by-side comparisons using the migration samples to verify behavior parity

Additional Resources

Migration Samples

Runnable side-by-side code comparisons for all patterns

Agent Framework Docs

Complete documentation for the Agent Framework

Semantic Kernel Docs

Official Semantic Kernel documentation

Community Support

Get help from the community on Discord

Migration Tips

Keep both implementations open side-by-side while migrating. The code samples are formatted to make copy/paste easy across SDKs.
  • Start with single-agent patterns before tackling orchestrations
  • Test streaming behavior early — AF’s streaming API is simpler but has different event types
  • Use agent.create_session() liberally during development; you can optimize session management later
  • For complex multi-agent graphs, use AF’s workflow checkpointing to enable pause/resume capabilities
  • Tools map cleanly from SK plugins to AF @tool callables; introduce hosted tools (MCP, web search) after achieving parity