title: "The Microsoft Agent Framework: What the Semantic Kernel and AutoGen Convergence Means for .NET Teams"
date: 2026-10-04
readingTime: 5 min read
tags: ["Microsoft Agent Framework", "Semantic Kernel", "AutoGen", ".NET", "AI Agents", "Enterprise"]
For the past eighteen months, .NET engineering leaders looking to build intelligent agent workflows faced a confusing architectural dilemma.
On one hand, Semantic Kernel offered production-grade discipline: native dependency injection, typed plugin abstractions, enterprise telemetry, and tight integration with ASP.NET Core. But orchestrating complex, multi-agent conversations often required clunky custom plumbing.
On the other hand, AutoGen (originating from Microsoft Research) offered flexible multi-agent interaction patterns—group chats, dynamic handoffs, and emergent reasoning loops. But it was primarily Python-centric, research-oriented, and lacked the architectural guardrails expected in a 24/7 enterprise backplane.
With the release of the Microsoft Agent Framework (MAF), Microsoft unified these two codebases into a single, production-ready agent runtime. Sitting cleanly on top of Microsoft.Extensions.AI, MAF combines the enterprise engineering foundation of Semantic Kernel with the multi-agent coordination capabilities of AutoGen.
Here is what the converged framework looks like in practice, how it structures multi-agent collaboration, and how to apply it safely to enterprise ERP workflows.
Microsoft.Extensions.AI UnderneathThe critical architectural decision Microsoft made was making Microsoft.Extensions.AI (MEAI) the common exchange layer.
In the unified framework, agents do not wrap proprietary model clients. Instead, agents are configured with standard IChatClient instances:
┌────────────────────────────────────────────────────────┐
│ Microsoft Agent Framework │
│ (AgentGroupChat, Sequential / Handoff Routing, │
│ Durable Checkpoints, Human-In-The-Loop Gates) │
└───────────────────────────┬────────────────────────────┘
│
┌───────────────────────────▼────────────────────────────┐
│ Microsoft.Extensions.AI │
│ (IChatClient, AIFunction, Middleware, OpenTelemetry) │
└───────────────────────────┬────────────────────────────┘
│
┌───────────────────────────▼────────────────────────────┐
│ Providers: Azure OpenAI, Ollama, Local SLMs, MCP │
└────────────────────────────────────────────────────────┘
Because IChatClient supports composable middleware, every agent automatically inherits response caching, distributed tracing, token metering, and automatic tool execution without writing custom decorators.
The Microsoft Agent Framework introduces four primary building blocks:
Agent (or ChatCompletionAgent): An autonomous entity with an explicit persona, a specific IChatClient, and a targeted set of AIFunction tools.Orchestration Patterns: First-class coordination primitives replacing ad-hoc loops:
State & Checkpointing: Built-in persistence mechanisms that allow an agent session to suspend state to durable storage (SQL Server, Cosmos DB, or Redis) and resume after hours or days.Human-in-the-Loop Approval: Native pause-and-resume tokens that halt execution until a human stakeholder reviews and signs off on high-impact actions.Consider a financial reconciliation scenario in an ERP system: when an accounting exception occurs (e.g. an unbilled receipt discrepancy), we want:
Here is how this is expressed cleanly using the Microsoft Agent Framework in C#:
using Microsoft.Agents.Core;
using Microsoft.Agents.Orchestration;
using Microsoft.Extensions.AI;
// 1. Configure the Auditor Agent with ERP query tools
var auditorAgent = new ChatCompletionAgent
{
Name = "AuditorAgent",
Instructions = "Inspect transaction vouchers and identify variance exceptions against purchase orders.",
ChatClient = chatClient,
Tools = [.. mcpLedgerTools]
};
// 2. Configure the Compliance Agent with policy evaluation
var complianceAgent = new ChatCompletionAgent
{
Name = "ComplianceAgent",
Instructions = "Review suggested voucher adjustments against corporate governance policy limits.",
ChatClient = chatClient,
Tools = [.. complianceRulesTools]
};
// 3. Define the Orchestration: Handoff with Human Approval Gate
var workflow = AgentWorkflowBuilder.CreateSequential()
.AddStep(auditorAgent)
.AddStep(complianceAgent)
.AddHumanApprovalGate(new HumanApprovalOptions
{
Condition = context => context.Get<decimal>("AdjustmentAmount") > 1000m,
NotificationChannel = "FinanceManagerApprovalQueue"
})
.Build();
// 4. Execute the multi-agent workflow
var sessionContext = new WorkflowContext();
sessionContext.Set("VoucherId", "VCH-2026-9042");
var result = await workflow.RunAsync(sessionContext, cancellationToken);
if (result.Status == WorkflowStatus.WaitingForApproval)
{
Console.WriteLine($"Workflow paused for human review. Checkpoint ID: {result.CheckpointId}");
}
Notice how clean the transition is. Instead of managing state machines manually with message queues, the framework handles the step transitions, context serialization, and suspension when the human threshold is reached.
If you already have code invested in either Semantic Kernel or early AutoGen prototypes, here is the pragmatic path forward:
[KernelFunction] or tools exposed via the Model Context Protocol require zero rewriting. The framework converts them directly into AIFunction instances.while loops to bounce messages between multiple agents, replace them with the framework's native AgentGroupChat or SequentialWorkflow. You get built-in infinite-loop prevention, maximum turn limits, and cancellation token support out of the box.Just because you can chain five agents together does not mean you should.
In production enterprise software, each agent turn adds:
Start with a single focused agent and deterministic C# business rules. Introduce a second agent only when there is a genuine separation of concerns—such as an independent compliance reviewer with a distinct prompt and restricted security scope.
The Microsoft Agent Framework marks the transition of agentic .NET development from experimental scripting to mature enterprise software. By unifying Semantic Kernel's production foundations with AutoGen's multi-agent coordination over Microsoft.Extensions.AI, .NET developers now have an official, supported architecture for building intelligent, multi-turn business workflows.
2026-06-15
2026-10-08
2026-06-12