Microsoft Agent Framework
The next-generation Microsoft library for building AI agents and multi-agent workflows in .NET and Python. The direct successor to both Semantic Kernel and AutoGen, built by the same teams.
Microsoft Agent Framework Overview | Microsoft Learn
What It Is
A harness — it wraps an LLM (the reasoning core) and manages everything the model itself cannot do: the agent loop, tool execution, state, routing, and multi-agent coordination.
It combines:
- AutoGen’s simple agent abstractions for single- and multi-agent patterns
- Semantic Kernel’s enterprise features: session state, middleware, telemetry, type safety
Two Primary Capabilities
| Capability | Description |
|---|---|
| Agents | Individual agents that use LLMs to process inputs, call tools and MCP servers, and generate responses |
| Workflows | Graph-based workflows connecting agents and functions for multi-step tasks with type-safe routing, checkpointing, and human-in-the-loop support |
Key Concepts
- Agent loop — calls the LLM, processes tool responses, feeds results back
- Session/state management — persists conversation state across turns
- Middleware — intercepts and modifies agent actions (similar to hooks in Claude Code)
- MCP client — built-in tool integration via Model Context Protocol
- Multi-provider — supports Azure AI Foundry, Azure OpenAI, OpenAI, Anthropic, Ollama, and more
Quick Start (C#)
AIAgent agent = new AIProjectClient(
new Uri("https://your-foundry-service.services.ai.azure.com/api/projects/your-project"),
new AzureCliCredential())
.AsAIAgent(
model: "gpt-4o-mini",
instructions: "You are a friendly assistant.");
Console.WriteLine(await agent.RunAsync("What is the largest city in France?"));When to Use Agent vs Workflow
| Use an Agent when… | Use a Workflow when… |
|---|---|
| Task is open-ended or conversational | Process has well-defined steps |
| You need autonomous tool use and planning | You need explicit control over execution order |
| A single LLM call (possibly with tools) suffices | Multiple agents or functions must coordinate |
Migration
See Also:: Semantic Kernel
See Also:: Agentic Frameworks
See Also:: Agents vs Skills
See Also:: AI Memory