Skip to content

Articles on .NET

Modern C# and .NET: Minimal API, RAG, streaming, function calling and agent orchestration.

Hybrid search in .NET with Qdrant, BM25 and Ollama — Cool Solution
.NET

Hybrid search in .NET with Qdrant, BM25 and Ollama

==Hybrid search== in .NET: **dense** vectors and **BM25** keywords fused into *one ranking* with **Reciprocal Rank Fusion**. One Qdrant collection with *two named vectors*, local embeddings via *Ollama* and *Microsoft.Extensions.AI*, and a **Minimal API** that compares the three modes — *dense*, *keyword*, *hybrid* — over the same knowledge base. Then the level-up: a **RAG** endpoint that sends the retrieved documents to a local LLM, a **semantic cache** of the answers on Qdrant, **Redis** for output caching and **MongoDB** with a generic repository and pagination. Bonus: the AI provider becomes an *appsettings* switch — Ollama or any **OpenAI-compatible** endpoint — plus a hard look at **Microsoft Agent Framework**.

38 min read
Semantic caching for LLMs in .NET with Redis and Ollama — Cool Solution
.NET

Semantic caching for LLMs in .NET with Redis and Ollama

==Semantic caching== for **LLMs** in .NET: a *two-layer* cache that answers **repeated** and *reworded* questions without re-running the model. Exact match with *UseDistributedCache*, a *semantic* layer with embeddings and vector search on **Redis 8**, in a **Minimal API** with *Microsoft.Extensions.AI* and *Ollama*.

27 min read
Structured output in .NET: typed JSON from an LLM with Microsoft.Extensions.AI — Cool Solution
.NET

Structured output in .NET: typed JSON from an LLM with Microsoft.Extensions.AI

Structured output with *Microsoft.Extensions.AI*: why asking for JSON "please" in the prompt isn't enough, how a `record` C# becomes a *JSON Schema* that constrains the model, and a ==tutorial Minimal API .NET== where a local LLM with *Ollama* triages help desk tickets returning ==typed objects==, then saved to *MongoDB*.

19 min read
AI Agent Orchestration: patterns, frameworks and an ASP.NET Core example — Cool Solution
.NET

AI Agent Orchestration: patterns, frameworks and an ASP.NET Core example

==AI agent orchestration== is the pattern that in 2026 is replacing the single agent for complex tasks. Here I walk through the **4 patterns** (hierarchical, collaborative, competitive, hybrid), the **frameworks** that matter — from *LangGraph* and *CrewAI* to the *Microsoft Agent Framework* — and a **hands-on ASP.NET Core example** that orchestrates four specialised agents in a few lines.

13 min read
MCP transport protocols: stdio, HTTP and authentication in C# .NET — Cool Solution
.NET

MCP transport protocols: stdio, HTTP and authentication in C# .NET

==MCP transport protocols== explained in depth: **stdio** for local servers and **Streamable HTTP** for remote ones, with a note on the deprecated *HTTP+SSE*. When to pick *one over the other*, how **authentication** works (OAuth 2.1), and two **C# .NET** examples with *Microsoft Agent Framework* and *Microsoft.Extensions.AI*: one stdio without auth (Filesystem) and one HTTP with auth (GitHub).

24 min read