⚡ Verified .NET 10 AI learning path

.NET AI Tutorials: Build Reliable AI Systems with C#

Move from provider-neutral model access to retrieval, tool-using agents, and Model Context Protocol. Each live tutorial is built around runnable C# code, explicit version baselines, and verification evidence so you can see what was actually tested.

4Live tutorials
2Coming next
4GitHub samples
.NET 10Current baseline
Microsoft.Extensions.AI Hybrid Search Agent Framework MCP Evaluation OpenTelemetry

A Practical .NET AI Learning Path

The hub now covers four working layers and is expanding into evaluation and observability. Follow the sequence if you want a progressive path, or jump directly to the problem you need to solve.

Why this order works: stable model access comes first; retrieval adds grounded context; agents add controlled decision-making; MCP standardizes tool access; evaluation measures quality; observability helps you operate the system in production.

Live .NET AI Tutorials

Each guide below focuses on one architectural problem and links to a companion repository sample. The tutorial explains the design; the merged GitHub sample provides the concrete implementation and verification record.

Microsoft.Extensions.AIGateway

Build an ASP.NET Core gateway around IChatClient and switch between Ollama, OpenAI, OpenRouter, and Azure OpenAI through configuration while keeping the application layer provider-neutral.

.NET 10 Minimal API architecture
Streaming, bounded conversations, middleware, and tool calling
Verified companion sample with automated tests
Retrievalpgvector

Combine PostgreSQL full-text search and pgvector semantic retrieval, generate embeddings through IEmbeddingGenerator, and fuse rankings with Reciprocal Rank Fusion.

EF Core + Npgsql + pgvector
Full-text and vector retrieval in one .NET sample
Deterministic tests plus real PostgreSQL/embedding verification
Agent Framework14/14 tests

Build a tool-using agent with AIAgent, AgentSession, streaming, three read-only tools, deterministic evidence, and explicit boundaries between facts, guidance, inference, unknowns, and unproven claims.

Microsoft Agent Framework on .NET 10
Read-only tools and same-session follow-up
14/14 deterministic tests plus live model verification
NewMCP13/13 tests

Build a real Model Context Protocol server with the C# SDK, expose three deterministic read-only tools over stdio, connect with a real MCP client, discover and invoke the tools, and verify the protocol path without an LLM or API key.

ModelContextProtocol 2.2.0 with .NET 10
Exactly three discovered MCP tools
13/13 tests + deterministic stdio E2E verification

Coming Next

These two tutorials extend the current collection from building AI features into measuring and operating them. They are planned next and are not live yet.

Coming soonEvaluation

Evaluate .NET AI Apps with Microsoft.Extensions.AI.Evaluation

Build a repeatable evaluation workflow for .NET AI features using curated test cases, measurable quality criteria, regression checks, and evidence you can compare across model or prompt changes.

Quality checks instead of manual spot testing
Regression-friendly evaluation datasets and scoring
Designed to complement the gateway, retrieval, agent, and MCP samples
Coming soonOpenTelemetry

Observe .NET AI Apps with OpenTelemetry

Trace model requests, retrieval stages, tool calls, latency, failures, and cross-service activity so AI behavior can be investigated with the same operational discipline as the rest of a .NET system.

End-to-end traces across AI application boundaries
Latency, failure, and tool-call visibility
Production-oriented observability for existing .NET AI patterns

Which Tutorial Should You Open?

Pick the live tutorial that matches the boundary you are trying to solve. You do not need to complete the whole learning path before using one of these guides.

“I want to switch AI providers without rewriting my application.”
Start with the Provider-Agnostic Chat Gateway →
“I need keyword + semantic retrieval for a RAG-style system.”
Open Hybrid Search with EF Core and pgvector →
“I want an agent that can use tools but must keep evidence boundaries clear.”
Open the Evidence-First Agent tutorial →
“I want reusable tools exposed through a standard protocol.”
Build the MCP server →

How These Tutorials Are Verified

AI APIs move quickly. This collection avoids vague “works with the latest version” claims and instead records concrete package baselines, test results, and integration evidence for each companion sample.

Version-pinnedEach tutorial states the SDK/framework/package versions used for its verified implementation.
Build-testedCompanion samples are restored and compiled rather than presented as unexecuted snippets.
Behavior-testedDeterministic tests cover the parts that can be asserted exactly without depending on model wording.
Evidence-scopedPages distinguish deterministic tests, local integration, live-provider checks, and CI verification.

Primary Documentation

Use these primary references alongside the tutorials when you need authoritative API or protocol details. The dotnet-guide.com pages focus on tested implementation patterns and explain how the pieces fit together.

Start with the Boundary You Need Today

If your application still talks directly to one provider SDK everywhere, start with the gateway. If model access is already clean, choose retrieval, agent tools, or MCP based on the problem in front of you.