MEAI vs Semantic Kernel vs Agent Framework in .NET (2026)

If you've been building .NET APIs and recently started adding AI features, you've likely run into the same confusion many teams hit: three overlapping Microsoft AI packages, each with a different name, different scope, and docs that keep changing. Microsoft.Extensions.AI, Semantic Kernel, and the Microsoft Agent Framework are not competing alternatives - they are layered abstractions built on top of each other. But knowing which layer your project actually needs, and when to stop, is the difference between a clean solution and a tangled dependency graph.
The full production picture - which package belongs in which layer of your ASP.NET Core API, how the layers compose at runtime, and the real trade-offs in cost, latency, and maintainability - is what Chapter 1 of the AI-Powered .NET APIs course builds from the ground up, inside a real running support-desk API you can inspect end to end.
For developers who prefer working source code alongside the comparison, the annotated implementations with all three layers wired together are available on Patreon - with production error handling and provider-swap examples that don't make it into a blog post.
Understanding the Stack Before Choosing a Layer
The three packages form a vertical stack, not a horizontal menu. Here is the mental model in production I've found most useful:
Microsoft.Extensions.AI ← abstraction (IChatClient, IEmbeddingGenerator)
Semantic Kernel ← orchestration (plugins, memory, filters, planning)
Microsoft Agent Framework ← autonomy (reasoning loops, multi-agent, MCP, checkpointing)
You can use any layer independently, but when you pick a higher layer, you are pulling in the ones below it. Semantic Kernel builds on Microsoft.Extensions.AI. The Agent Framework builds on both.
The implication: you are not choosing between them so much as choosing how high up the stack your project needs to reach.
What Microsoft.Extensions.AI Actually Is
Microsoft.Extensions.AI (MEAI) is a thin abstraction package published by Microsoft. Its job is simple: define a standard interface for talking to a language model (IChatClient) and a standard interface for generating embeddings (IEmbeddingGenerator), so the rest of your application code is not tied to any specific provider SDK.
Swap from GitHub Models to OpenAI to Azure OpenAI to a self-hosted Ollama model by changing one registration line in Program.cs. Your controllers, services, and handlers that accept IChatClient never change.
// Ollama (local, free, zero API cost during dev)
builder.Services.AddOllamaChatClient("http://localhost:11434", "phi3.5");
// One line change to go to Azure OpenAI in production
// builder.Services.AddAzureOpenAIChatClient(endpoint, deploymentName);
That's the whole value proposition of MEAI: it is a seam in your dependency graph, not a feature set. For most teams, this is the right level of abstraction for straightforward chat endpoints - a POST that calls GetResponseAsync or GetStreamingResponseAsync on IChatClient and returns the result.
When MEAI is enough: single-model endpoints, classification, summarisation, extraction, structured output. No planning, no tool chains, no persistent agent state.
What Semantic Kernel Adds
Semantic Kernel is an orchestration SDK built on top of MEAI. It adds the scaffolding teams need when a single model call is not enough.
The features it layers on:
Plugins (tool calling): define C# methods as callable tools the model can invoke
Chat history management: maintain multi-turn context, trim by token budget
Filters and middleware: intercept prompts and completions at pipeline stages (logging, PII scrubbing, content moderation)
Memory connectors: plug in vector stores for RAG patterns
Prompt templates: versioned, parameterised prompt functions stored as assets
A pattern that comes up often is using Semantic Kernel's KernelFunction attribute to annotate a real service method so the model can invoke it during a conversation:
[KernelFunction("get_order_status")]
[Description("Returns the status of a customer order by order ID")]
public async Task<string> GetOrderStatusAsync(string orderId)
{
var order = await _orderService.FindAsync(orderId);
return order?.Status ?? "not found";
}
Semantic Kernel handles the round-trip: serialise the tool definition, post it to the model, receive the tool-call request, invoke the method, feed the result back. You write C#. The framework handles the protocol.
When Semantic Kernel fits: multi-step workflows where the model needs to call real services, complex prompt pipelines with filters, RAG over a knowledge base. As long as the flow is deterministic (you control the execution order), Semantic Kernel is the right level.
What the Microsoft Agent Framework Adds
The Microsoft Agent Framework (GA April 2026) is the topmost layer. It is designed for scenarios where you want the model to reason autonomously about what to do next - not just execute a fixed sequence of tool calls you predefined.
The key primitive it adds is the AIAgent - an agent with an instruction set, a tool registry, access to persistent thread state, and an observe-reason-act loop. Instead of your code deciding "call tool A, then tool B", the agent decides at runtime based on the model's own reasoning.
For multi-step support-desk automation this is powerful. For a simple chatbot that answers questions from a knowledge base, it is far too much ceremony.
// Agent Framework: the model decides which tools to call and in what order
var agent = new AIAgent(chatClient)
{
Instructions = "You are a support agent. Diagnose the issue, look up the order, and either resolve it or escalate.",
Tools = [lookupOrderTool, updateOrderTool, escalateTool]
};
var response = await agent.InvokeAsync(userMessage, threadId);
Additional Agent Framework capabilities: multi-agent workflows where agents hand off to each other, human-in-the-loop approval steps for destructive actions, and MCP support for exposing your API as a tool to external AI clients like Claude or VS Code Copilot.
When Agent Framework fits: autonomous triage, multi-agent pipelines, scenarios where the execution path itself is dynamic and determined by the model.
Side-by-Side Comparison
| Dimension | MEAI | Semantic Kernel | Agent Framework |
|---|---|---|---|
| Purpose | Provider abstraction | Orchestration / tool calling | Autonomous agents |
| Core type | IChatClient |
Kernel, KernelFunction |
AIAgent, AgentThread |
| NuGet package | Microsoft.Extensions.AI |
Microsoft.SemanticKernel |
Microsoft.Agents.AI |
| Execution model | One call per invocation | You control the loop | Model controls the loop |
| State management | Stateless | Optional memory connectors | Built-in thread + checkpointing |
| MCP support | No | Partial | Full (client + server) |
| Complexity | Low | Medium | High |
| When to choose | Simple LLM endpoints | Tool calling, RAG, pipelines | Autonomous multi-step reasoning |
Which One Should You Actually Use?
The decision is not about preference - it is about the control model your feature requires.
Use MEAI only when your endpoint does one thing: call a model, get a response, return it. Classification, extraction, a structured JSON response, a simple chat reply. This is the right choice for most first AI endpoints on an existing ASP.NET Core API.
Add Semantic Kernel when you need the model to call real services as typed C# methods, when you need multi-turn state management, or when you need a clean filter pipeline for content moderation and logging. Most production AI features land here.
Add Agent Framework when the model needs to determine its own execution path across multiple tools and turns, when you are building multi-agent systems, or when you need MCP so external AI clients can use your API as a tool.
One trade-off that bit us in production: Agent Framework's autonomy comes with unpredictability. A model that controls its own reasoning loop can consume more tokens than expected on complex inputs. The cost control patterns in the AI-Powered .NET APIs course cover this explicitly - token budgets, model tiering, and rate limiting for AI endpoints.
Is Semantic Kernel Being Deprecated?
No - and this question comes up constantly since the Agent Framework launch. Microsoft documented the relationship clearly: MEAI is the abstraction layer, Semantic Kernel is the orchestration layer, Agent Framework is the agentic layer. They compose; none replaces the others. The Agent Framework uses IChatClient from MEAI internally, and Semantic Kernel plugins can be exposed as Agent Framework tools.
The real shift in 2026 is that for new greenfield AI projects, Microsoft's recommendation is to reach for Microsoft.Extensions.AI as the baseline, add Semantic Kernel if you need orchestration, and only escalate to Agent Framework if you genuinely need autonomous reasoning. Semantic Kernel is not going away - it is stable, widely adopted, and handles the orchestration tier better than anything else in the .NET stack.
What Is the Right Architecture for a Production .NET API?
A pattern we ship at Coding Droplets for AI-backed ASP.NET Core endpoints: register IChatClient from MEAI in DI, inject it into service classes using constructor injection, keep AI-specific logic in a service layer (not controllers), and use FunctionInvokingChatClient from MEAI as the middleware layer when tool calling is needed. Only pull in Semantic Kernel when you need its filter pipeline or memory connectors. Only pull in Agent Framework when you need thread state and autonomous tool selection.
This layered approach means individual endpoints remain testable - you can mock IChatClient in unit tests without pulling in any of the higher-level SDKs.
See RAG Pattern in ASP.NET Core: When to Use It and How for how the data-grounding layer connects to this stack, and What's New in .NET 10 AI Integration: Microsoft.Extensions.AI and IChatClient for the foundational IChatClient setup that every layer here depends on.
For the official documentation on how these libraries relate, see Microsoft.Extensions.AI Overview on Microsoft Learn and the Agent Framework Migration Guide.
FAQ
What is MEAI in .NET?
MEAI stands for Microsoft.Extensions.AI - a lightweight abstraction package from Microsoft that defines standard interfaces (IChatClient, IEmbeddingGenerator) for talking to AI models. Providers like OpenAI, Azure OpenAI, and Ollama each ship an implementation. Your application code depends on the interface, not the provider SDK, making it easy to swap models.
Is Semantic Kernel still relevant in 2026?
Yes. Semantic Kernel is the recommended orchestration layer for .NET AI applications. It is not being replaced by the Agent Framework - it occupies a different architectural tier. Use Semantic Kernel when you need plugins (tool calling), multi-turn state, prompt filters, and memory connectors. Agent Framework is for fully autonomous reasoning loops, which most production APIs do not need.
When should I use Microsoft Agent Framework instead of Semantic Kernel?
Use the Agent Framework when the model itself needs to decide the execution path at runtime - not when you are orchestrating a predefined sequence of tool calls. If you can describe your workflow as "step 1, then step 2, then step 3", Semantic Kernel is simpler and more predictable. If the workflow is "figure out what steps are needed and execute them", Agent Framework is the right choice.
Can I use all three in the same project?
Yes - and this is how Microsoft intends them to be composed. MEAI provides the IChatClient abstraction at the bottom. Semantic Kernel builds on it for orchestration. Agent Framework builds on both for agentic scenarios. You can start with MEAI-only endpoints and progressively add Semantic Kernel or Agent Framework to specific features without rewriting.
Does the Agent Framework support MCP?
Yes. The Agent Framework includes full support for the Model Context Protocol (MCP) using the official C# SDK (ModelContextProtocol 1.x). You can build an MCP server over your ASP.NET Core API using ModelContextProtocol.AspNetCore, which lets external AI clients like Claude, VS Code Copilot, and other MCP-compatible tools call your API as a tool.
What .NET version is required for these packages?
All three packages are compatible with .NET 8+. The current versions target .NET 10 and take advantage of trimming, NativeAOT, and the updated hosting model. For Semantic Kernel, check the release notes for any breaking changes if upgrading from pre-1.0 versions. For Agent Framework, the GA release (April 2026) requires .NET 8 or later.
About the Author
I'm Celin Daniel, Co-founder of Coding Droplets. I've been building .NET and ASP.NET Core systems in production for 13+ years - APIs, distributed backends, enterprise platforms. Everything I write here comes from real shipping experience: patterns that held up, trade-offs that bit us, and lessons learned the hard way.
GitHub: codingdroplets
YouTube: Coding Droplets
Website: codingdroplets.com






