Building Production-Grade AI Applications in the .NET Ecosystem
Introduction: The Enterprise RAG Challenge
Chapter 1: Foundations of RAG and the .NET AI Ecosystem
- What RAG Actually Solves (and What It Doesn’t)
- The Evolution from Prompt Engineering to Retrieval-Augmented Systems
- The Modern .NET AI Stack: Microsoft.Extensions.AI, Semantic Kernel, and Agent Framework
- Choosing Your LLM Provider: Azure OpenAI, OpenAI API, and Local Models
- A Quick-Start RAG App in .NET
- From Prototype to Production: Refactoring into a Layered Architecture
- Key Takeaways
Chapter 2: Embeddings and Vector Representations
- How Embeddings Encode Meaning
- Choosing an Embedding Model: Accuracy vs. Speed vs. Cost
- Domain-Specific Embeddings and Fine-Tuning
- Dimensionality, Quantization, and Storage Efficiency
- Evaluating Embedding Quality
- Key Takeaways
Chapter 3: Vector Databases for .NET Developers
- The Landscape of Vector Stores in 2026
- Qdrant: Performance and Operations
- PostgreSQL + pgvector: Consolidation and Simplicity
- Azure AI Search: Managed Hybrid Search
- Microsoft.Extensions.VectorData Abstraction Layer
- Making the Choice: A Decision Framework
- Key Takeaways
Chapter 4: Building Robust Ingestion Pipelines
- The Ingestion Pipeline Architecture
- Document Parsing and Layout-Aware Extraction
- Chunking Strategies: Fixed, Recursive, Semantic, and Structural
- Metadata Enrichment and Classification Tags
- Incremental Ingestion and Change Detection
- Key Takeaways
Chapter 5: Hybrid Search and Retrieval Quality
- Why Dense Vector Search Is Not Enough
- Hybrid Search with RRF in Azure AI Search
- Cross-Encoder Reranking
- Query Transformation Techniques
- Designing a Production Retriever
- Key Takeaways
Chapter 6: Prompt Engineering for Grounded Generation
- The Anatomy of a RAG Prompt
- Context Assembly Strategies: Write, Select, Compress, Isolate
- Citation and Grounding Techniques
- Anti-Hallucination Guardrails in Prompts
- Prompt Versioning and Experimentation
- Key Takeaways
Chapter 7: Agentic RAG with the Microsoft Agent Framework
- From RAG to Agentic RAG
- Microsoft Agent Framework 1.0: Architecture and Primitives
- Sequential and Concurrent Workflows
- Agentic Retrieval Patterns
- Human-in-the-Loop and Approval Gates
- Key Takeaways
Chapter 8: Security, Privacy, and Governance
- The RAG Security Threat Model
- Document-Level Access Control at Retrieval Time
- PII and PHI Redaction Pipelines
- Prompt Injection and Content Guardrails
- Audit Trails and Compliance
- Key Takeaways
Chapter 9: Evaluation Frameworks for RAG Systems
- What to Evaluate in a RAG System
- Retrieval Metrics: Precision, Recall, MRR, NDCG
- Generation Metrics: Faithfulness, Groundedness, Answer Relevance
- Microsoft.Extensions.AI.Evaluation in Practice
- Building Custom Evaluators and CI/CD Gates
- Key Takeaways
Chapter 10: Observability and Debugging RAG Systems
- The Observability Challenge in RAG
- End-to-End Tracing with OpenTelemetry
- Metrics and Dashboards
- Root-Cause Analysis Playbook
- Debugging Tools and Techniques
- Key Takeaways
Chapter 11: Scalability and Performance Optimization
- The Latency Budget Problem
- Semantic Caching Strategies
- Async Pipelines and Concurrent Retrieval
- Model Routing and Tiered Inference
- Infrastructure Scaling Patterns
- Key Takeaways
Chapter 12: Testing and Quality Assurance
- What to Test in a RAG System
- Unit Testing Retrieval and Generation
- Integration Testing with Testcontainers
- Regression Evaluation and Golden Datasets
- A/B Testing and Prompt Experiments
- Key Takeaways
Chapter 13: Deployment, CI/CD, and Cost Management
- Containerizing a RAG Application
- CI/CD Pipelines for AI Applications
- Kubernetes Deployment Patterns
- Production Runbooks and Incident Response
- Cost Management and Token Budgeting
- The Complete Architecture: Putting It All Together
- Key Takeaways
