📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

πŸ“š Interview question

In 2026, when would you use Microsoft.Extensions.AI, Semantic Kernel or the Microsoft Agent Framework in a .NET app? Explain what each one is for, how they relate, and how you'd choose for a new project or an existing Semantic Kernel codebase.

The .NET AI stack in 2026: Microsoft.Extensions.AI as the abstraction layer (IChatClient, IEmbeddingGenerator, middleware), Microsoft.Extensions.VectorData for vector stores, Semantic Kernel's plugins and current maintenance status, and the Microsoft Agent Framework (GA as 1.0 in April 2026) for agents and workflows, with guidance for new and existing projects.

Mid-Level Theory Intermediate ai architecture dotnet microsoft-agent-framework microsoft-extensions-ai semantic-kernel

🎯 Key points

  • Microsoft.Extensions.AI: low-level abstractions (IChatClient, IEmbeddingGenerator) plus middleware (function invocation, caching, logging, OpenTelemetry); the core packages went GA in May 2025
  • Microsoft.Extensions.VectorData: common vector store abstraction with connectors (Azure AI Search, SQL Server, Cosmos DB, Postgres, in-memory)
  • Microsoft Agent Framework: agents, threads, tools, MCP, multi-agent workflows; GA as 1.0 on 3 April 2026 for .NET and Python; built on Microsoft.Extensions.AI
  • The Agent Framework is where Microsoft's new agent investment goes: the successor to Semantic Kernel's agent features and AutoGen, with official migration guides
  • Semantic Kernel is in maintenance for new work: still patched, fine for existing apps, but not the choice for new agent features
  • Typical fit: chat endpoint, RAG search or extraction → Microsoft.Extensions.AI alone; research or support assistant that picks its own tools → Agent Framework agent; multi-step approval process → Agent Framework workflows
  • Each layer up adds model calls and moving parts: measure calls, latency and cost per task before adopting it
  • Existing SK code: keep it while it works, migrate incrementally starting with agent features; IChatClient interop eases it

⏱ 30-second answer

As of late 2026 they are layers, not rivals. Microsoft.Extensions.AI is the foundation: IChatClient, IEmbeddingGenerator and middleware for tools, caching and telemetry. Use it directly for most features: a chat endpoint, RAG, tool calling. Microsoft.Extensions.VectorData abstracts vector stores. The Microsoft Agent Framework (GA as 1.0 in April 2026) sits on top for agents: instructions, tools, conversation threads and multi-agent workflows. It is the successor to Semantic Kernel's agent features and AutoGen.

Semantic Kernel is still maintained but no longer the default for new agent work. For a new project, start with Microsoft.Extensions.AI and add the Agent Framework only when you need agents. The trade-off: higher layers give you more for free but add concepts and dependencies.

πŸ—£ Full answer (senior)

How I would answer this in an interview

"I think of it as a stack. At the bottom is Microsoft.Extensions.AI: IChatClient and IEmbeddingGenerator, with provider adapters for Azure OpenAI, OpenAI, Ollama and others, and a middleware pipeline for function invocation, caching, logging and OpenTelemetry. It's to AI what ILogger is to logging. Next to it is Microsoft.Extensions.VectorData, which gives one API over Azure AI Search, SQL Server, Cosmos DB, Postgres and an in-memory store. Most features I build, a chat endpoint, a RAG search, a classifier with structured output, need nothing more.

On top sits the Microsoft Agent Framework, which reached 1.0 GA in April 2026 for .NET and Python. It's built by the Semantic Kernel and AutoGen teams on the same abstractions, and gives you agents with instructions and tools, conversation threads, MCP tool integration, and graph-based workflows for multi-agent or human-in-the-loop processes. Microsoft positions it as the successor for new agent work. Semantic Kernel is still maintained with fixes, and its kernel and plugin model still works, but I wouldn't start new agent code on it. For example, on [a project that started on Semantic Kernel in 2024], we [kept the plugins running and moved the agent orchestration to the Agent Framework first], because that was where the new features were.

The mistake I see is reaching for the biggest framework for a single prompt. An agent framework adds threads, orchestration and its own abstractions; if my feature is 'call the model with these documents', IChatClient is simpler, easier to test and easier to reason about. Pick the lowest layer that does the job, and move up when you genuinely need agents or workflows."


The layers (as of late 2026)

Layer What it gives you Use it for
Microsoft.Extensions.AI IChatClient, IEmbeddingGenerator, middleware, structured output Any LLM call; RAG; tool calling
Microsoft.Extensions.AI.Evaluation Quality and safety evaluators Testing AI features
Microsoft.Extensions.VectorData Vector store abstraction and connectors Storing and searching embeddings
Microsoft Agent Framework Agents, threads, tools, MCP, workflows, hosting Agentic features, multi-agent and long-running processes
Semantic Kernel Kernel, plugins, connectors, planners (older) Existing codebases; maintained but not the default for new agents

Choosing

Situation Choice
New API with a chat or RAG feature Microsoft.Extensions.AI + VectorData
New feature where the model plans and calls several tools over many turns Agent Framework
Multi-step business process with approvals Agent Framework workflows (or your existing workflow engine calling the model)
Existing Semantic Kernel app that works Keep it; migrate agent parts incrementally; new code on the lower layers

Production example

On [a document-processing service], replacing a Semantic Kernel planner with plain IChatClient structured-output calls in a fixed sequence cut [average model calls per document from about 6 to 2] and made failures reproducible in unit tests with a fake client; we used the Agent Framework only for the [interactive research assistant] where the model genuinely chose its own steps.

πŸ” What the interviewer is checking

Checks that the candidate knows the current .NET AI stack and chooses by need rather than hype.

Green flags

  • Describes Microsoft.Extensions.AI as the foundation and the Agent Framework as built on it
  • Knows the Agent Framework is GA (April 2026) and the successor for new agent work
  • Knows Semantic Kernel is maintained but not the default for new agents
  • Picks the lowest layer that solves the problem
  • Has an incremental migration approach

Red flags

  • Thinks Semantic Kernel is the only .NET option, or that it is deprecated and must be removed now
  • Uses an agent framework for a single prompt
  • Can't explain what each layer adds
  • No awareness of version churn in this area

πŸ“š Learn in depth

1. How the pieces stack

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Your app (API, worker, Blazor)                                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Microsoft Agent Framework: agents, threads, workflows, MCP     β”‚  (optional)
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Microsoft.Extensions.AI          β”‚ Microsoft.Extensions.VectorDataβ”‚
β”‚ IChatClient, IEmbeddingGenerator β”‚ VectorStore, collections       β”‚
β”‚ middleware: tools, cache, OTel   β”‚ connectors                     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Providers: Azure OpenAI / Foundry, OpenAI, Ollama, ...         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

2. History, briefly

  • 2023: Semantic Kernel appears: Kernel, plugins ([KernelFunction]), planners, connectors. AutoGen appears separately for multi-agent research.
  • 2024–2025: Microsoft.Extensions.AI is introduced and reaches GA; SK adopts IChatClient; vector store abstractions move into Microsoft.Extensions.VectorData.
  • October 2025: Microsoft Agent Framework announced in preview, unifying SK's enterprise features and AutoGen's multi-agent patterns.
  • February 2026: release candidate. 3 April 2026: 1.0 GA for .NET and Python, with migration guides from SK and AutoGen.

Check the official repositories for current support terms; Microsoft has said SK remains maintained, without (as far as I have seen) a published end-of-life date.

3. Agent Framework concepts

  • Agent (AIAgent, commonly ChatClientAgent): instructions + an IChatClient + tools. Create one from any IChatClient with AsAIAgent(...).
  • Thread / session: conversation state the framework manages and can persist.
  • Tools: AIFunctions, MCP servers, hosted tools.
  • Workflows: typed, graph-based orchestration of agents and functions, with checkpoints and human-in-the-loop steps.

4. Why the lower layer is often enough

A single GetResponseAsync with tools or structured output covers most product features. Agents add non-determinism (the model chooses steps), more calls and more to evaluate. Use them where the task is open-ended.

5. Migrating from Semantic Kernel

  1. Replace SK chat connectors with IChatClient (SK can consume it).
  2. Turn [KernelFunction] plugins into AIFunctions (often by pointing AIFunctionFactory at the same methods).
  3. Move SK ChatCompletionAgent / group chat to Agent Framework agents and workflows.
  4. Re-run your evaluation set at each step.

Try it yourself

  1. Build a chat endpoint with only IChatClient; then wrap the same client as an Agent Framework agent and compare code size.
  2. Port one SK plugin to AIFunctionFactory.Create and call it via UseFunctionInvocation.
  3. Swap the provider from Azure OpenAI to Ollama locally without changing feature code.
  4. Read the SK-to-Agent-Framework migration guide and list what your app uses that would change.

πŸ’» Code

The same capability at two layers: plain IChatClient, then an Agent Framework agent built from it.

// Layer 1: Microsoft.Extensions.AI only. Enough for most features.
using System.ComponentModel;
using Azure.AI.OpenAI;
using Azure.Identity;
using Microsoft.Extensions.AI;

IChatClient chat = new ChatClientBuilder(
        new AzureOpenAIClient(new Uri(Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT")!),
                              new DefaultAzureCredential())
            .GetChatClient("gpt-4.1-mini").AsIChatClient())
    .UseFunctionInvocation()
    .Build();

var options = new ChatOptions { Tools = [AIFunctionFactory.Create(Weather.GetForecast)] };
var answer = await chat.GetResponseAsync("Should I take an umbrella in Sydney today?", options);
Console.WriteLine(answer.Text);

public static class Weather
{
    [Description("Gets today's forecast for an Australian city.")]
    public static string GetForecast([Description("City name")] string city) =>
        city.Equals("Sydney", StringComparison.OrdinalIgnoreCase) ? "Showers, 22Β°C" : "Fine, 25Β°C";
}
// Layer 2: Microsoft Agent Framework (package Microsoft.Agents.AI). Adds instructions,
// threads and a home for multi-turn, multi-tool behaviour; reuses the same IChatClient.
using Microsoft.Agents.AI;

AIAgent agent = chat.AsAIAgent(
    name: "TravelHelper",
    instructions: "You help staff plan trips between Australian offices. Be brief.",
    tools: [AIFunctionFactory.Create(Weather.GetForecast)]);

AgentThread thread = agent.GetNewThread();   // conversation state managed by the framework
Console.WriteLine(await agent.RunAsync("Weather in Sydney?", thread));
Console.WriteLine(await agent.RunAsync("And should I pack a jacket?", thread));

Agent Framework method names have shifted between previews and 1.0; check the current docs for exact signatures before copying.

⚠ Common mistakes

  • Mistake: Starting every AI feature on an agent framework. Why it is wrong: more abstractions, more model calls and less predictable behaviour for a single-prompt task. Instead: IChatClient first; add agents when the task is genuinely open-ended.
  • Mistake: Starting new agent work on Semantic Kernel because old tutorials do. Why it is wrong: Microsoft now steers new agent development to the Agent Framework, where new features land. Instead: use the Agent Framework for new agents; keep SK where it already works.
  • Mistake: Big-bang rewrite of a working SK app. Why it is wrong: risk without user value. Instead: migrate incrementally, agent features first, with the evaluation set as a safety net.
  • Mistake: Coding directly against a provider SDK in feature code. Why it is wrong: hard to test and to swap models. Instead: depend on IChatClient / IEmbeddingGenerator.
  • Mistake: Treating preview APIs as stable. Why it is wrong: names changed between Agent Framework previews and 1.0, and some provider adapters still ship previews first. Instead: pin package versions and read release notes before upgrading.
  • Mistake: Assuming planners or agents remove the need for evaluation. Why it is wrong: more autonomy means more paths to test. Instead: evaluate with Microsoft.Extensions.AI.Evaluation and trace every run.

πŸ› Senior insight: trade-offs

The decision is about autonomy, not libraries. If you can write the steps down, write them in code and call the model at each step with IChatClient: cheaper, faster and testable. Use an agent when the model must choose the steps, and accept the cost of evaluating and observing that freedom.

Option When it fits Cost When not to
Microsoft.Extensions.AI only Chat, RAG, extraction, tool calls Lowest complexity Long-running multi-agent processes
Agent Framework agent Open-ended tasks with tools across turns More calls, more to evaluate Fixed, known steps
Agent Framework workflows Multi-agent or human-in-the-loop processes with checkpoints New concepts to learn You already have a workflow engine that can call the model
Stay on Semantic Kernel Existing, working code Migration later New agent features

Measure model calls per task, latency, cost and evaluation scores when you move up a layer; if they don't improve, you didn't need it.

πŸ”— Follow-ups the interviewer may ask

  1. When: Candidate mentions IChatClient Why: Checks hands-on use of the foundation layer
    How to answer

    Use Microsoft.Extensions.AI: build an AzureOpenAIClient with the endpoint and DefaultAzureCredential, take the chat client for your deployment and call AsIChatClient(). Register it once with builder.Services.AddChatClient(...), which returns a ChatClientBuilder so you can add logging, OpenTelemetry and caching as middleware. In Azure the app's managed identity gets the Cognitive Services OpenAI User role, so there is no key anywhere.

    For streaming, call GetStreamingResponseAsync and return the IAsyncEnumerable (or server-sent events) so the first words reach the browser in under a second. Pass RequestAborted as the cancellation token. The trade-off: streaming improves perceived latency but you can't validate the whole answer before the user sees it.

  2. When: Candidate mentions the Agent Framework or agents Why: Checks judgement about autonomy, cost and predictability
    How to answer

    A workflow runs steps you wrote in code and calls the model at known points: classify an email, extract fields, draft a reply. Control flow and state live in your code (or a durable orchestrator), so each step has a known input and output that you can unit-test, retry and cost up front. An agent gets a goal and tools and chooses the steps itself in a loop until it decides it is done. An example is a support assistant that investigates an order across several systems in whatever order the case needs.

    Workflows are cheaper, faster and predictable. Agents handle open-ended tasks with unknown paths, at the cost of more calls, variable latency and harder evaluation. Choose a workflow when you can write the steps down, and an agent only when you can't. Then add an iteration and token cap, least-privilege tools, human approval for actions with real-world effect, and tracing of every step.

πŸ›  Real-world problems: how you handle them

Choosing a stack for a new assistant in a Semantic Kernel shop
Situation
[A team of six] had [two services] built on Semantic Kernel in 2024. A new [claims-triage assistant] needed RAG over policy documents plus a few lookups, and the team assumed it should use SK planners again.
Signals
The prototype on SK planners averaged [about 7 model calls] per request, p95 latency [about 14 s], and gave different step sequences for the same input, making failures hard to reproduce.
Investigation
Traced runs with OpenTelemetry gen_ai spans in Application Insights to count calls and tokens per step; ran the [120-case] evaluation set through the prototype and a plain IChatClient version (retrieve, then answer with two read-only tools) built in a spike.
Resolution
Built the assistant on Microsoft.Extensions.AI and VectorData with a fixed retrieve-then-answer flow and two tools. Kept the existing SK services, and recorded in an ADR that new agentic features use the Microsoft Agent Framework while SK code migrates when touched.
Prevention
ADR with a decision table (workflow vs agent), the evaluation set in CI, and dashboards for calls, tokens and latency per request so the choice can be revisited with data.

How to tell it (STAR)

**S:** We were starting a [claims-triage assistant] and the team wanted to reuse Semantic Kernel planners as on [two earlier services]. **T:** As [the lead on the feature], I needed a stack that would be predictable and cheap to run. **A:** I traced the planner prototype, which made about [seven] calls per request, and ran our [120-case] evaluation set against it and against a plain `IChatClient` version with retrieval and two tools. I wrote an ADR: fixed flows on Microsoft.Extensions.AI, agents on the Agent Framework, SK kept where it works. **R:** The plain version matched quality, cut p95 latency from [14 s to about 4 s] and cost per request by [about 65%].

More in .NET and AI

Last updated 23 Nov 2026.

🌐 Sangam's Webring

βͺ Previous 🏠 Main Next ⏩
πŸ’¬ Chat with me