Skip to main content

Posts

Showing posts with the label Semantic Kernel tutorial

Generative AI in .NET: Enterprise Architecture Patterns

Learn generative AI in .NET with proven enterprise patterns: RAG, function calling, IChatClient, resilience and cost control. Start building with C# today. Generative AI in .NET has moved from experiment to production requirement. In 2026, most enterprise teams building on C# are being asked to add chat assistants, document summarization, or intelligent search to existing line-of-business apps. The hard part is not calling a model. The hard part is doing it in a way that survives a compliance review, a traffic spike, and a vendor price change. This guide covers the architecture patterns that work for generative AI in .NET enterprise applications, with runnable C# examples and the pitfalls that catch most teams on their first project. Why Generative AI in .NET Needs Real Architecture A prototype that calls an LLM from a controller action works on a laptop. It fails in production for predictable reasons: Vendor lock-in. Model providers change pricing, deprecate models, and releas...

How to Build a RAG Chatbot in C# with Semantic Kernel

Learn how to build a RAG chatbot in C# with Semantic Kernel. Step-by-step tutorial with runnable code for chatting with your own documents. Start now! Large language models are impressive, but they know nothing about your data: your internal wiki, your PDF manuals, your support tickets. Retrieval-Augmented Generation (RAG) fixes that. In this tutorial you will build a RAG chatbot in C# with Microsoft's Semantic Kernel that ingests your own documents, stores them as vector embeddings, retrieves the most relevant chunks for each question, and answers with citations. Every example is runnable .NET 8/9 code, and along the way we explain why each design choice matters, not just how to wire it up. What Is a RAG Chatbot and Why Build One in C#? RAG is a simple idea with a big payoff. Instead of fine-tuning a model on your documents (expensive, slow, and stale the moment your docs change), you keep the model as-is and retrieve relevant text at query time, then hand that text to ...

Build a RAG Chatbot in C# with Semantic Kernel (2026)

Learn how to build a RAG chatbot in C# using Semantic Kernel. Step-by-step tutorial with embeddings, vector search & code. Start building today! Building a RAG chatbot in C# is one of the most in-demand AI skills for .NET developers in 2026 — and for good reason. Retrieval-Augmented Generation (RAG) lets you build an AI chatbot that answers questions using your own documents — internal wikis, PDFs, product manuals, support tickets — instead of relying on whatever the model memorized during training. In this tutorial, you'll build a complete RAG chatbot using C# and Microsoft's Semantic Kernel , the official .NET SDK for orchestrating large language models. We'll cover embeddings, vector search, chunking, prompt grounding, and the pitfalls that trip up most first-time builders. By the end, you'll have a working console chatbot that ingests documents, retrieves the most relevant passages for each question, and generates grounded, citation-friendly answers — al...

AI Agents in C# with Semantic Kernel: Full Guide

Learn how to build AI agents in C# using Semantic Kernel. Step-by-step tutorial with runnable code, best practices, and pitfalls. Start building today! Building AI agents in C# is no longer the exclusive territory of Python developers. With Microsoft's Semantic Kernel, .NET engineers can now create autonomous, task-solving agents that reason, call tools, and complete multi-step workflows—all in the language and ecosystem they already know. In this tutorial, you'll learn exactly how to build AI agents in C# using Semantic Kernel, from your first "hello world" agent to production-grade patterns used in real applications. Whether you're a beginner searching for "how to build an AI agent," an intermediate developer looking for Semantic Kernel best practices, or a senior engineer exploring advanced autonomous agent design in C#, this guide walks through the concepts, the code, and the pitfalls to avoid. What Are AI Agents in C#? An AI agent is a...