The 2026 Dilemma: Semantic Kernel or Agent Framework?
Semantic Kernel and Microsoft Agent Framework are complementary layers of the Microsoft .NET AI stack, not competing alternatives. In 2026, Microsoft clarified the architectural hierarchy: Semantic Kernel provides the foundation layer (model connectors, plugin functions, vector memory, and streaming filters), while Microsoft Agent Framework (MAF 1.0 GA) provides the autonomous multi-agent layer (graph workflows, checkpointed agent state, and human-in-the-loop approvals).
Enterprise .NET architectures combine both frameworks to build scalable, resilient production AI systems.
Detailed Architectural Comparison
| Dimension | Semantic Kernel (SK) | Microsoft Agent Framework (MAF) |
|---|---|---|
| Primary Role | Model orchestration & tool execution | Multi-agent coordination & stateful workflows |
| Core Abstraction | Kernel, KernelFunction, KernelPlugin | AIAgent, AgentGroupChat, WorkflowGraph |
| Lineage | Semantic Kernel Core | Unification of AutoGen & SK Experimental Agents |
| State Management | Ephemeral ChatHistory | Checkpointed, resumable session state |
| Multi-Agent Patterns | Basic sequential chatting | Hierarchical, broadcast, graph routing, round-robin |
| RAG / Vector Memory | Native vector store connectors | Delegates vector queries to SK or MEAI |
| Human-in-the-Loop | Manual intervention in code | Built-in approval gates & checkpoint resumes |
| Primary NuGet | Microsoft.SemanticKernel (1.54+) | Microsoft.Agents.AI (1.0.0 GA) |
Code Example: Building Tools in Semantic Kernel
Semantic Kernel shines at defining clean, testable C# plugins with parameter schemas and dependency injection:
using System.ComponentModel;
using Microsoft.SemanticKernel;
public class InventoryPlugin
{
[KernelFunction("check_stock")]
[Description("Checks current warehouse inventory for a given SKU.")]
public async Task<int> CheckStockAsync(
[Description("The product stock keeping unit (SKU)")] string sku,
CancellationToken ct = default)
{
// Simulated database inventory lookup
await Task.Delay(10, ct);
return sku.StartsWith("PROD-AI") ? 42 : 0;
}
}
Code Example: Orchestrating Agents in Microsoft Agent Framework
Microsoft Agent Framework consumes the Semantic Kernel plugin above and coordinates multi-agent collaboration with built-in turn termination:
using Microsoft.Agents.AI;
using Microsoft.SemanticKernel;
// 1. Build underlying Semantic Kernel with Azure OpenAI / Microsoft Foundry
var kernel = Kernel.CreateBuilder()
.AddAzureOpenAIChatCompletion("gpt-4o", "https://my-foundry.openai.azure.com/", "apiKey")
.Build();
// 2. Register tools in Semantic Kernel
kernel.Plugins.AddFromType<InventoryPlugin>("Inventory");
// 3. Create autonomous MAF Agents sharing the kernel tools
var supportAgent = new ChatCompletionAgent
{
Name = "CustomerSupport",
Instructions = "Gather customer requirements and inquire about inventory when needed.",
Kernel = kernel
};
var logisticsAgent = new ChatCompletionAgent
{
Name = "LogisticsSpecialist",
Instructions = "Verify stock levels using the Inventory tools and authorize shipments.",
Kernel = kernel
};
// 4. Coordinate multi-agent group conversation
var groupChat = new AgentGroupChat(supportAgent, logisticsAgent)
{
ExecutionSettings = new()
{
TerminationStrategy = new RegexTerminationStrategy(@"\b(SHIPMENT_APPROVED|OUT_OF_STOCK)\b")
}
};
await groupChat.AddChatMessageAsync(new("Customer: I need 5 units of PROD-AI-10 immediately."));
await foreach (var message in groupChat.InvokeAsync())
{
Console.WriteLine($"[{message.AuthorName}]: {message.Content}");
}
When to Use Which: Architectural Decision Matrix
Choose Semantic Kernel When:
- You need a single intelligent assistant: Adding conversational chat or copilot sidebars to ASP.NET Core or Blazor apps.
- You are building custom RAG pipelines: Ingestion, chunking, embedding generation, and vector retrieval with Azure AI Search, Qdrant, or Cosmos DB.
- You want lightweight middleware: Logging, cost estimation, prompt caching, and token counting filters.
Choose Microsoft Agent Framework When:
- You need autonomous multi-role teams: An analyst agent drafts a plan, a coder agent writes code, and a reviewer agent validates the output.
- Your workflows span hours or days: Checkpointed workflows pause to wait for human manager approval and resume without losing context.
- You require graph-based state transitions: Complex decision trees where agent outputs branch dynamically based on business rules.