Skip to main content

Microsoft.Extensions.AI vs Semantic Kernel in .NET: What’s the Difference?

Microsoft.Extensions.AI vs Semantic Kernel: What Is the Difference?

If you're building AI applications with .NET, you've probably encountered two Microsoft technologies that appear to overlap:

  • Microsoft.Extensions.AI
  • Semantic Kernel

Both can be used when building applications that communicate with large language models, work with tools, generate structured responses, retrieve information, and implement AI-powered workflows.

That naturally leads to an important question:

Are Microsoft.Extensions.AI and Semantic Kernel alternatives, or do they solve different problems?

The most useful answer is that they operate at different architectural levels.

Microsoft.Extensions.AI provides common .NET abstractions and building blocks for AI services. Its ecosystem includes abstractions such as IChatClient, IEmbeddingGenerator, AI functions, tool support, and chat-client pipelines.

Semantic Kernel is a broader AI development SDK centered around the Kernel, with concepts such as plugins, functions, agents, filters, and orchestration.

These descriptions overlap in places because both technologies can participate in tool calling and AI application development. The difference is therefore less about a simple feature checklist and more about where each technology fits in your application architecture.

Short answer: don't think of this as simply "Microsoft.Extensions.AI versus Semantic Kernel." A better question is: How much AI infrastructure do I need, and how much orchestration does my application actually require?

This article focuses on that architectural boundary and uses practical .NET examples to show when each approach makes sense.

Microsoft.Extensions.AI vs Semantic Kernel at a Glance

Area Microsoft.Extensions.AI Semantic Kernel
Primary purpose Common .NET abstractions and AI building blocks Broader AI application SDK and orchestration model
Core abstraction IChatClient, IEmbeddingGenerator Kernel
Chat Core abstraction through IChatClient Supported through configured AI services
Embeddings IEmbeddingGenerator Supported through Semantic Kernel AI services/connectors
Tools AIFunction, AITool, tool invocation Kernel functions and plugins
Plugins Not its central application concept Core concept
Agents Not primarily an agent framework Dedicated agent capabilities
Middleware/pipelines Strong focus through chat-client pipelines Filters and broader framework mechanisms
Orchestration Provides building blocks Broader application/orchestration capabilities

The Microsoft.Extensions.AI documentation describes the libraries as providing a unified approach for representing generative AI components and interoperability between AI services. It specifically identifies IChatClient and IEmbeddingGenerator<TInput,TEmbedding> as core abstractions.

Semantic Kernel, meanwhile, describes the Kernel as the central component that manages the services and plugins required by an AI application.

A Better Mental Model

Instead of thinking about these technologies as competing libraries, think about the responsibilities they can provide.

Your .NET Application Application Services / Workflows Semantic Kernel — when useful Microsoft.Extensions.AI AI Providers

This is a conceptual architecture, not a mandatory dependency stack.

A simple application might use IChatClient without Semantic Kernel. Another application may use Semantic Kernel directly. A larger system may use concepts from both, depending on the versions, integrations, and architecture chosen.

What Is Microsoft.Extensions.AI?

Microsoft.Extensions.AI is a set of .NET libraries designed to provide common abstractions for AI services.

The important idea is decoupling application code from a specific AI provider implementation.

The core abstractions include:

  • IChatClient for chat-capable AI services.
  • IEmbeddingGenerator<TInput,TEmbedding> for embedding generation.
  • AIFunction and related types for describing callable functions.
  • ChatOptions for configuring individual chat requests.
  • Chat-client builders and delegating clients for composing functionality such as tool invocation, telemetry, and caching.

Microsoft's current documentation specifically describes IChatClient as the application-facing abstraction for chat services and IEmbeddingGenerator as the common abstraction for embedding generation.

Why is this useful?

Without a common abstraction, an application service can become tightly coupled to a particular provider SDK:

Controller
    ↓
Provider SDK
    ↓
Business Logic

With an abstraction, the business-facing code can depend on:

Controller
    ↓
Application Service
    ↓
IChatClient
    ↓
Configured AI implementation

A simple service can therefore look like this:

using Microsoft.Extensions.AI;

public sealed class AiService(IChatClient chatClient)
{
    public async Task<string> AskAsync(
        string prompt,
        CancellationToken cancellationToken)
    {
        var response = await chatClient.GetResponseAsync(
            prompt,
            cancellationToken: cancellationToken);

        return response.Text;
    }
}

The application service does not need to contain provider-specific HTTP code or SDK types.

That separation can be useful for testing, dependency injection, provider changes, telemetry, caching, and other infrastructure concerns.

What Is Semantic Kernel?

Semantic Kernel is a broader development kit for building AI applications and agents in .NET and other supported languages.

At the center of Semantic Kernel is the Kernel. Microsoft describes it as the central component that manages the services and plugins needed by an AI application.

Its programming model includes concepts such as:

  • Kernel services
  • Kernel functions
  • Plugins
  • Function calling
  • Filters
  • Agents
  • Process and workflow capabilities

Plugins are particularly important because they allow existing application functionality to be exposed to an AI workload as a group of functions. Semantic Kernel's documentation describes plugins as collections of functions that can be invoked through function calling.

A simplified Semantic Kernel setup looks like this:

using Microsoft.SemanticKernel;

var builder = Kernel.CreateBuilder();

builder.AddOpenAIChatCompletion(
    modelId: "your-model",
    apiKey: "your-api-key");

var kernel = builder.Build();

The important part of this example is not the provider. It is the programming model around the configured AI services and application capabilities.

The Real Difference: Abstractions vs Application Framework

This is the distinction that makes the rest of the comparison easier.

Microsoft.Extensions.AI is primarily about common AI abstractions and composable infrastructure.

Semantic Kernel is a broader AI application SDK that organizes services, functions, plugins, agents, and related application behavior around a Kernel.

That does not mean Microsoft.Extensions.AI cannot handle tools.

It can.

And it does not mean Semantic Kernel cannot provide provider integrations.

It does.

The difference is the architectural role each technology is intended to play.

Question Natural starting point
How can my .NET code communicate with chat AI through a common abstraction? IChatClient
How can I generate embeddings through a common abstraction? IEmbeddingGenerator
How can I add AI tools to a chat request? AIFunction / AITool
How can I organize application functionality as AI-callable plugins? Semantic Kernel plugins
How can I build agent-oriented application behavior? Semantic Kernel Agent Framework
How should I structure a complex AI workflow? Semantic Kernel or explicit application orchestration

IChatClient: The Important Microsoft.Extensions.AI Abstraction

If you are a .NET developer entering AI engineering, IChatClient is worth understanding early.

It represents a chat client abstraction that allows application code to interact with chat-capable AI services without directly depending on one particular provider SDK.

For example:

public sealed class QuestionService(
    IChatClient chatClient)
{
    public async Task<string> GenerateAsync(
        string topic,
        CancellationToken cancellationToken)
    {
        var response = await chatClient.GetResponseAsync(
            $"Create a compliance question about {topic}.",
            cancellationToken: cancellationToken);

        return response.Text;
    }
}

Notice what is missing:

  • No OpenAI-specific client type.
  • No Gemini-specific client type.
  • No provider-specific HTTP implementation.
  • No provider-specific authentication code inside the application service.

Those concerns can remain in the application's composition and infrastructure layers.

Microsoft also provides chat-client builders and delegating clients, which means additional behavior can be composed around an IChatClient rather than being placed inside every application service.

Tool Calling: Both Technologies Can Participate

One of the easiest mistakes to make is saying:

"Microsoft.Extensions.AI does tool calling, while Semantic Kernel does plugins."

That is too simplistic.

Microsoft.Extensions.AI provides AI functions and tools. Its ChatOptions includes a Tools collection, and FunctionInvokingChatClient can automate function invocation around an IChatClient.

A simplified example is:

using Microsoft.Extensions.AI;

var getWeather = AIFunctionFactory.Create(
    (string city) => $"Weather information for {city}");

var options = new ChatOptions
{
    Tools = [getWeather]
};

var response = await chatClient.GetResponseAsync(
    "What is the weather in London?",
    options,
    cancellationToken);

AIFunctionFactory can create an AI function from a .NET method and derive the function's input schema.

If automatic invocation is required, Microsoft.Extensions.AI also provides FunctionInvokingChatClient and the corresponding chat-client pipeline support.

Semantic Kernel has a different programming model for this capability.

A native plugin can contain functions such as:

using Microsoft.SemanticKernel;

public sealed class WeatherPlugin
{
    [KernelFunction]
    public string GetWeather(string city)
    {
        return $"Weather information for {city}";
    }
}

Semantic Kernel's plugin model groups functions into reusable application capabilities that can be exposed to AI workloads.

So the better question is not:

"Which library supports tool calling?"

Both do.

The better question is:

"How much application structure do I need around those tools?"

Where Microsoft.Extensions.AI Is a Strong Fit

Consider an application that mainly needs:

  • Chat completion.
  • Structured output.
  • Embeddings.
  • Simple RAG.
  • Classification.
  • Summarization.
  • Content generation.
  • Simple function calling.
  • Provider-independent AI infrastructure.

A straightforward architecture might be:

ASP.NET Core
     ↓
Application Service
     ↓
IChatClient
     ↓
AI Provider

There is no reason to introduce a larger orchestration framework merely because the application uses AI.

Keeping the architecture small can actually be an advantage.

Where Semantic Kernel Becomes More Useful

Semantic Kernel becomes more attractive when AI itself becomes a significant application subsystem.

For example, suppose a compliance assistant needs to:

  1. Understand the user's request.
  2. Search regulatory information.
  3. Call a policy service.
  4. Check application state.
  5. Invoke one or more business functions.
  6. Inspect the results.
  7. Continue the workflow when necessary.
  8. Generate the final response.

At that point, the problem is no longer simply "call an LLM."

It is an AI application orchestration problem.

A conceptual workflow could look like:

User request
     ↓
AI application workflow
     ↓
 ┌───────────────┐
 │ Search policy │
 └───────┬───────┘
         ↓
 ┌──────────────────┐
 │ Check permissions│
 └────────┬─────────┘
          ↓
 ┌──────────────────┐
 │ Call application │
 │ function         │
 └────────┬─────────┘
          ↓
 ┌──────────────────┐
 │ Inspect result   │
 └────────┬─────────┘
          ↓
     Final response

This is where Semantic Kernel's plugins, functions, Kernel, filters, and agent capabilities can become useful.

Microsoft's current Semantic Kernel documentation describes a dedicated Agent Framework for creating AI agents and incorporating agentic patterns into applications.

What About RAG?

RAG is a good example of why an AI abstraction should not be confused with the entire application architecture.

A basic RAG pipeline could be:

User question
     ↓
Generate embedding
     ↓
Vector / hybrid search
     ↓
Retrieve authorized documents
     ↓
Build context
     ↓
IChatClient
     ↓
Validate response
     ↓
Return answer

IEmbeddingGenerator and IChatClient can provide common AI abstractions within that pipeline.

But the actual RAG architecture still requires decisions about:

  • Document ingestion.
  • Chunking.
  • Embedding generation.
  • Vector or hybrid search.
  • Ranking.
  • Metadata filtering.
  • Tenant isolation.
  • Document permissions.
  • Context limits.
  • Document freshness.
  • Citation or source tracking.

Those are application architecture concerns.

Semantic Kernel can participate by organizing retrieval functions, plugins, AI services, or agent workflows, but it does not automatically become the entire RAG architecture.

What About AI Agents?

This is where the distinction becomes even more useful.

A simple AI request might be:

User
 ↓
Prompt
 ↓
Model
 ↓
Response

An agentic workflow introduces additional behavior:

User
 ↓
Agent
 ↓
Determine required information
 ↓
Call tool
 ↓
Inspect result
 ↓
Call another tool
 ↓
Evaluate state
 ↓
Produce response

That creates additional engineering requirements:

  • State management.
  • Tool selection.
  • Authorization.
  • Maximum iterations.
  • Timeouts.
  • Retries.
  • Cost controls.
  • Observability.
  • Error handling.
  • Human approval for sensitive operations.

An important distinction is that calling an LLM does not automatically make an application an agent.

An agent is an application architecture involving a model plus some combination of tools, state, instructions, decision-making, and an execution mechanism.

Semantic Kernel has a dedicated agent framework for this type of application.

Can Microsoft.Extensions.AI and Semantic Kernel Be Used Together?

They can coexist, but you should not assume that every application needs both.

A conceptual architecture might look like this:

ASP.NET Core
     ↓
Application Services
     ↓
AI Orchestration
     ↓
Semantic Kernel
     ↓
AI service abstractions / integrations
     ↓
AI Provider

However, the exact relationship depends on the versions, packages, connectors, and integration choices in your application.

The important point is that you should not create an artificial dependency chain simply because two Microsoft AI technologies exist.

For a small application:

Application Service
     ↓
IChatClient
     ↓
Provider

may be completely sufficient.

For a more complex AI application:

Application Service
     ↓
Semantic Kernel / Workflow
     ↓
Plugins + Functions + Agent
     ↓
Configured AI services
     ↓
Provider

may be a better fit.

The architecture should follow the application's requirements.

Provider Portability: An Important Advantage of Common Abstractions

Imagine that an application starts with one AI provider.

Later, you need:

  • A second provider.
  • A cheaper model for background processing.
  • A local model for development.
  • A different model for embeddings.
  • A test implementation that does not call an external service.

If provider-specific SDK types are spread throughout application services, changing providers can become expensive.

With a common abstraction such as IChatClient, provider-specific implementation details can remain closer to the infrastructure layer.

Conceptually:

Application Service
       ↓
   IChatClient
       ↓
 ┌─────┼──────────┐
 ↓     ↓          ↓
Provider A   Provider B   Local Model

Microsoft describes this interoperability as one of the purposes of the Microsoft.Extensions.AI libraries.

That does not mean every provider exposes identical capabilities. Provider differences still matter.

A common abstraction reduces coupling, but it does not magically make every model or provider behave identically.

Do Not Confuse Provider Abstraction With Business Logic

One architectural mistake is allowing AI framework types to spread into every layer of an application.

For example, this is usually undesirable:

Controller
   ↓
Semantic Kernel types
   ↓
Domain model
   ↓
Database

Your business logic should not become dependent on an AI framework simply because one part of the workflow uses an AI model.

A cleaner boundary is often:

Controller
   ↓
Application Service
   ↓
Domain / Business Logic
   ↓
AI Adapter
   ↓
AI Framework / Provider

This makes the AI integration replaceable and keeps business rules under application control.

Production Security Still Belongs to Your Application

Neither technology automatically solves the security problems introduced by AI.

Production applications still need to consider:

  • Authentication.
  • Authorization.
  • Prompt injection.
  • Tool authorization.
  • Input validation.
  • Output validation.
  • Data privacy.
  • Tenant isolation.
  • Rate limiting.
  • Cost controls.
  • Audit logging.
  • Observability.
  • Evaluation.

For example, if an AI model requests:

DeleteCustomer(customerId: 4821)

the fact that the model selected a valid function does not mean the application should execute it.

The application should still determine:

  • Whether the authenticated user has permission.
  • Whether customer 4821 belongs to an accessible tenant.
  • Whether the argument is valid.
  • Whether the operation is allowed in the current business state.
  • Whether confirmation or human approval is required.

This distinction between AI-generated intent and application authorization is one of the most important concepts in production AI engineering.

AIFunction Arguments Are Still Untrusted

There is another subtle point worth understanding when working with AI functions.

The arguments supplied to an AI function originate from an AI interaction and should not automatically be treated as trusted application data.

Microsoft's current AIFunctionFactory documentation explicitly notes that arguments supplied through AIFunctionArguments should be considered unvalidated and untrusted.

That means a tool such as:

GetCustomer(int customerId)

still needs normal validation and authorization inside the application.

AI tool schemas help the model understand how to call a function. They do not replace your security boundary.

When Microsoft.Extensions.AI Is Probably Enough

Consider starting with Microsoft.Extensions.AI when your workload mainly looks like:

ASP.NET Core API
      ↓
Application Service
      ↓
IChatClient
      ↓
AI Provider

Typical examples include:

  • Summarization.
  • Classification.
  • Structured extraction.
  • Question answering.
  • Content generation.
  • Basic RAG.
  • Simple AI-assisted validation.
  • Simple tool calling.

You can still build a serious production application around this architecture.

Production quality does not come from adding more frameworks. It comes from good boundaries, validation, authorization, observability, testing, resilience, and operational controls.

When Semantic Kernel Becomes More Attractive

Semantic Kernel becomes more interesting when the AI workload itself has become a substantial subsystem.

Examples include:

  • Multiple AI-callable plugins.
  • Many reusable functions.
  • Agent-oriented workflows.
  • Complex tool selection.
  • Multi-step AI processes.
  • Reusable AI application components.
  • Applications that benefit from Semantic Kernel's filters and framework abstractions.

Semantic Kernel's plugin model is designed to encapsulate existing APIs and application functionality as AI-callable functions.

Its Agent Framework is specifically intended for applications that need agentic behavior.

A Practical Decision Tree

Instead of starting with the question "Which framework is better?", start with the workflow.

What does the application need?
             │
             ├── One or a few AI calls?
             │        ↓
             │    IChatClient may be enough
             │
             ├── RAG?
             │        ↓
             │    Add retrieval + embeddings + authorization
             │
             ├── Tools?
             │        ↓
             │    Add controlled function calling
             │
             ├── Many reusable AI functions?
             │        ↓
             │    Consider Semantic Kernel plugins
             │
             └── Agent / multi-step workflow?
                      ↓
              Consider Semantic Kernel
              or explicit orchestration

This prevents the framework from driving the architecture.

The problem should determine the abstraction.

What Should a .NET Developer Learn First?

If you're starting AI engineering with .NET, you do not need to learn every framework at once.

A practical progression is:

  1. Understand basic LLM interactions.
  2. Learn tokens, context windows, latency, and model limitations.
  3. Learn structured output.
  4. Learn IChatClient.
  5. Build a small RAG application.
  6. Learn embeddings and vector search.
  7. Learn function and tool calling.
  8. Learn authorization around AI tools.
  9. Learn evaluation and observability.
  10. Learn Semantic Kernel when your application needs its broader programming model.

This sequence gives you a foundation in AI application architecture before adding framework-specific concepts.

A Production Architecture for a Larger .NET AI Application

For a larger application, I would separate application responsibilities from AI infrastructure.

┌──────────────────────────────────────┐
│ ASP.NET Core / API                   │
│ Authentication • Authorization       │
└───────────────────┬──────────────────┘
                    │
                    ▼
┌──────────────────────────────────────┐
│ Application Services                 │
│ Business rules • Workflows           │
└───────────────────┬──────────────────┘
                    │
                    ▼
┌──────────────────────────────────────┐
│ AI Orchestration — when required     │
│ Semantic Kernel / Custom Workflow    │
└───────────────────┬──────────────────┘
                    │
                    ▼
┌──────────────────────────────────────┐
│ AI Infrastructure                    │
│ IChatClient • IEmbeddingGenerator    │
│ Tools • Telemetry • Caching          │
└───────────────────┬──────────────────┘
                    │
                    ▼
┌──────────────────────────────────────┐
│ AI Providers                         │
│ OpenAI • Gemini • Groq • Local       │
└──────────────────────────────────────┘

Cross-cutting:
Security • Guardrails • Logging
Rate limiting • Cost tracking
Evaluation • Resilience

This architecture is intentionally flexible.

You might not need the Semantic Kernel layer at all.

You might also find that a complex application benefits from it.

The important thing is that the application does not become unnecessarily coupled to an AI framework.

A Compliance AI Example

Consider an application that generates compliance questions from regulatory content.

A small implementation could be:

API
 ↓
QuestionGenerationService
 ↓
IChatClient
 ↓
Model

As requirements grow, the workflow might become:

API
 ↓
QuestionGenerationService
 ↓
AI Workflow
 ├── Retrieve regulatory context
 ├── Check document permissions
 ├── Generate scenario
 ├── Generate questions
 ├── Validate structure
 ├── Evaluate quality
 └── Store result
       ↓
   IChatClient
       ↓
   AI Provider

At this point there are clearly two different concerns:

  • AI service interaction: communicating with the model.
  • Application orchestration: coordinating retrieval, generation, validation, evaluation, and persistence.

IChatClient can represent the chat interaction while application code or an orchestration framework coordinates the larger workflow.

Common Mistakes When Choosing Between Them

1. Treating them as direct competitors

They overlap, but they are not simply two interchangeable implementations of the same abstraction.

2. Adding Semantic Kernel to every project

A small application may not need a larger orchestration model.

3. Building everything directly against a provider SDK

This can spread provider-specific types throughout application code and make future changes more expensive.

4. Assuming tool calling means the operation is authorized

Tool selection by a model is not an authorization decision.

5. Assuming structured output is automatically safe

Valid JSON or a valid schema does not guarantee valid business behavior.

6. Treating an abstraction as the entire architecture

IChatClient can simplify AI service integration, but it does not design your RAG pipeline, tenant model, authorization system, database architecture, or business workflow for you.

Microsoft.Extensions.AI vs Semantic Kernel: Final Comparison

Area Microsoft.Extensions.AI Semantic Kernel
Main role Common AI abstractions and infrastructure Broader AI application SDK
Chat IChatClient Configured AI services
Embeddings IEmbeddingGenerator Semantic Kernel AI services/connectors
Tools AIFunction, AITool, function invocation Kernel functions and plugins
Plugins Not the central abstraction Core concept
Kernel No equivalent central Kernel concept Central Semantic Kernel component
Agents Not primarily an agent framework Dedicated Agent Framework
Pipeline composition Chat-client builders/delegating clients Filters and broader framework mechanisms
Best fit Common AI infrastructure and simpler AI features Plugins, agents, functions, and broader AI application workflows

Frequently Asked Questions

Is Microsoft.Extensions.AI replacing Semantic Kernel?

No. That is too simplistic. Microsoft.Extensions.AI provides common AI abstractions and composable infrastructure, while Semantic Kernel provides a broader AI application programming model. They can be used independently, and some architectures can use concepts from both.

Is Semantic Kernel required for AI agents?

No. An agent can be implemented with application-specific orchestration or another framework. Semantic Kernel provides an agent framework and related capabilities that can make agent-oriented applications easier to structure.

Can Microsoft.Extensions.AI do function calling?

Yes. Microsoft.Extensions.AI provides AIFunction, AITool, tool configuration through ChatOptions, and function-invocation support through chat-client pipelines.

Does Semantic Kernel support plugins?

Yes. Plugins are a core Semantic Kernel concept and can contain functions that expose existing application capabilities to AI workloads.

Which one should I learn first?

For a .NET developer who is learning AI application development, understanding common AI concepts and IChatClient is a useful foundation. Learn Semantic Kernel when you have a concrete need for its plugins, functions, agents, filters, or broader orchestration model.

Can I build RAG without Semantic Kernel?

Yes. RAG is an application architecture rather than a requirement of one particular framework. You can combine embeddings, retrieval, authorization, an IChatClient, and your chosen vector or search infrastructure directly.

Does using either library automatically make my AI application production-ready?

No. Authentication, authorization, prompt-injection defenses, output validation, tenant isolation, rate limiting, observability, evaluation, cost controls, and business rules remain application engineering responsibilities.

Key Takeaways

  • Microsoft.Extensions.AI provides common .NET abstractions for AI services.
  • IChatClient is the central chat abstraction in Microsoft.Extensions.AI.
  • IEmbeddingGenerator provides a common embedding-generation abstraction.
  • Microsoft.Extensions.AI also provides AI functions, tools, and composable chat-client infrastructure.
  • Semantic Kernel is a broader AI development SDK centered around the Kernel.
  • Semantic Kernel plugins group functions that expose application capabilities to AI.
  • Semantic Kernel also provides agent-oriented capabilities.
  • Both technologies can participate in tool/function calling.
  • The most important difference is architectural responsibility, not a simple feature checklist.
  • A simple AI feature may only need Microsoft.Extensions.AI or even a provider-specific integration.
  • A tool-heavy or agentic application may benefit from Semantic Kernel's broader programming model.
  • The two approaches can coexist when there is a real architectural reason to do so.

Final Thoughts

The .NET AI ecosystem is becoming more layered, and that is not necessarily a problem.

Common abstractions can reduce coupling to individual AI providers, while higher-level frameworks can provide structure when an AI workload becomes a larger application subsystem.

That is why I would not frame the decision as:

"Microsoft.Extensions.AI or Semantic Kernel?"

A better question is:

"What level of AI architecture does my application actually need?"

If you need a common abstraction for chat or embeddings, start by understanding Microsoft.Extensions.AI.

If your application needs reusable AI-callable functions, plugins, agents, filters, or more involved AI workflows, evaluate Semantic Kernel.

If your application is small, keep it small.

If your application has genuinely become a tool-heavy, agentic workflow, introduce the additional structure when it solves a real problem.

Most importantly, do not let an AI framework replace normal software engineering. Authentication, authorization, validation, security, observability, resilience, testing, evaluation, and cost management still belong in the architecture.

Comments

Popular posts from this blog

AI Engineering with .NET: A Practical Guide to Building AI Applications

AI Engineering with .NET: A Practical Guide If you write C# for a living, there is a good chance someone has already asked you to "add AI" to an application. Maybe the requirement is document summarization, answering questions over company policies, classifying support tickets, generating content, extracting structured data, or building a chatbot. The interesting part is that most of these problems do not require you to become a machine-learning researcher. They require you to understand how AI models fit into a software system: how to call them, structure their output, provide application context, handle failures, control cost, evaluate responses, and keep the system observable in production. That is where AI engineering with .NET becomes useful. If you already work with C#, ASP.NET Core, dependency injection, APIs, databases, background services, logging, and distributed systems, you already have much of the foundation requir...

Calling LLMs from .NET: IChatClient in Practice

IChatClient in .NET: A Practical Guide for Building AI Applications If you are building AI features in a .NET application, getting your first response from a large language model is usually the easy part. The harder problem appears when the application grows. Provider-specific SDKs start appearing inside application services, prompts become coupled to infrastructure code, conversation history needs to be managed, and concerns such as logging, telemetry, caching, rate limiting, security, and cost tracking begin spreading across the codebase. This is where IChatClient becomes useful. IChatClient is part of the Microsoft.Extensions.AI ecosystem. It provides a common .NET abstraction for interacting with chat-capable AI services while allowing the underlying implementation to come from a provider SDK or another compatible implementation. The architectural idea is simple: your application can depend on an AI capabilit...

RAG with .NET: A Practical Guide to Retrieval-Augmented Generation

Retrieval-Augmented Generation in .NET: A Practical RAG Guide If you're building AI applications with .NET, there is a point where simply sending a prompt to an LLM stops being enough. Generating a summary is easy. Generating an answer from your company's documents, policies, product information, support knowledge, database records, or internal documentation is a different problem. The model does not automatically know your private data. And even when information is available somewhere in a model's training data, you generally do not want an application to depend on the model remembering it correctly or knowing the latest version of a business policy. This is where Retrieval-Augmented Generation (RAG) becomes useful. Instead of asking an LLM to answer entirely from its general knowledge, your application first retrieves relevant information from an external knowledge source and provides that information to the model as context. RAG = retrieve releva...