RAG .NET 10 Production Hub

Conversational AI Architecture & Assessment Walkthrough

Conversational RAG System Built from First Principles

An enterprise-grade, transparent Retrieval-Augmented Generation (RAG) platform developed in .NET 10. Designed without high-level framework lock-in, enforcing Clean Architecture, strict grounding boundaries, local Ollama execution with Groq cloud acceleration, and Qdrant vector retrieval.

Core Runtime
.NET 10
C# 13 Minimal APIs + Native AOT Ready
Vector Storage
Qdrant
Cosine Similarity • Persistent Disk Storage
Local Embeddings
768 Dim
nomic-embed-text via Ollama (8x Concurrency)
LLM Orchestration
Hybrid
Ollama Gemma 2 (Local) + Groq Llama 3.3 (Cloud)
Evaluation Fidelity
100%
10 Core Queries + 2 Hallucination Refusal Probes

🏛️ Clean Architecture Layers & Boundaries

Strict Dependency Inversion ensures core business domain models remain independent of AI models and vector databases.

RagDemo.Domain Core Enterprise
Contracts, entities, evaluation records, and retrieval domain models.
Key Interfaces: IChatCompletionService, IVectorStore, IRetriever, IEmbeddingGenerator, IConversationMemory
Rule: Zero external dependencies. Cannot reference Application, Infrastructure, or Api.
RagDemo.Application Use Cases & Prompts
Pipeline coordination, QueryClassifier, RagPromptBuilder, and evaluation test runner.
Responsibility: Orchestrates ingestion and query pipelines. Implements grounding barrier.
Dependencies: References only RagDemo.Domain.
RagDemo.Infrastructure Adapters & I/O
Ollama, Groq API, Qdrant client, PdfPig extractor, CharacterChunkingStrategy.
Responsibility: Concrete I/O adapters. Network calls, vector indexing, disk persistence.
Dependencies: References RagDemo.Domain.
RagDemo.Api & Cli Entry Points
ASP.NET Core Minimal APIs, SSE streaming endpoints, interactive CLI terminal.
Responsibility: Dependency Injection root, HTTP endpoints (/chat/stream, /evaluation/run), SSE serialization.

⚡ Core System Hallmarks

  • Zero Framework Lock-in: Built from fundamentals in C# without LangChain or Semantic Kernel abstractions, providing 100% control over retrieval dynamics.
  • 1000 / 200 Character Chunking: Validated against deep learning papers (629 chunks across Attention Is All You Need and BERT) for optimal recall without token fragmenting.
  • Strict Grounding Contract: Prompt engineering strictly constrains the LLM to output: "I could not find the answer in the provided documents." when context is insufficient.
  • 4-Turn Sliding Conversational Memory: Thread-safe in-memory cache retaining recent dialogue history to rewrite ambiguous follow-up questions.
  • Real-Time SSE Token Streaming: IAsyncEnumerable<string> pipeline streaming tokens directly to web and CLI clients with sub-100ms time-to-first-token.
💡 Recommended Next Steps:
Explore the Flows & Pipelines tab to step through the live simulator, or dive into the 16 Master Guides for the full assessment curriculum.
Inference Engine:

Step Description & Architectural Role Active Step

Selecting step...

💡 Click any node on the track above or use Step Forward to advance through each transformation.

Data Payload & Diagnostics JSON Representation

{}
Phase 1: Foundations & Flow

Loading Guide...

13-Sprint Evolutionary Implementation Journey

Review the step-by-step engineering progression from Sprint 00 through Sprint 12. Each sprint isolated specific capabilities (chunking, Ollama integration, vector stores, prompt grounding, memory, SSE streaming) before moving to subsequent layers.

Architecture Decision Records (ADRs)

Transparent rationale for all architectural design decisions: why character chunking was selected over semantic chunking (ADR-017), why Qdrant was selected over Pinecone (ADR-020), and how prompt separation guarantees grounding (ADR-013).

🎯 Technical Interview & Assessment Trainer

Interactive flashcards built directly from 14-Mock-Assessment-Questions-And-Answers.md. Click any card to flip between Question and Model Answer.

Topic
Question Loading...
🔄 Click anywhere on card to reveal model answer 1 of 24
Model Answer
Answer Loading...
🔄 Click anywhere to flip back to question ✓ Verified Model Answer
Zero Backend Required • Pure Client-Side Replay

🤖 Interactive RAG Pipeline Simulator

Experience the 5-stage RAG execution pipeline directly in GitHub Pages. Select any benchmark query or test a custom prompt to observe vector similarity retrieval against pre-indexed paper chunks from Attention Is All You Need, strict prompt grounding assembly, and simulated token-by-token streaming.

Model Engine:
Select Benchmark Evaluation Scenario:
Stage 1 🧠 Sliding Memory Context
Pending
Select a query above or click "Run RAG Pipeline" to initiate the pipeline.
Stage 2 🔍 Vector Retrieval & Cosine Ranking (Qdrant)
Pending
Qdrant vector collection awaiting query vector (768-dim nomic-embed)...
Stage 3 🛡️ Grounding Prompt Assembly
Pending
Prompt boundary awaiting injection of retrieved context and anti-hallucination rules...
Stage 4 ⚡ Token Streaming Generation
Pending
Streaming LLM tokens will appear here...
Stage 5 📊 Turn Telemetry & Evaluation HUD
Pending
Execution telemetry will calculate upon stream completion.
⚡

Ready for Live Execution with Your Own Documents & Models?

Run the production .NET 10 API locally to query any uploaded PDF or text file with live Ollama or Groq streaming:

git clone https://github.com/adarshsince90/rag-dotnet.git && dotnet run --project src/RagDemo.Api Open Local Studio (localhost:5000) ↗

✂️ Interactive Chunking & Overlap Inspector

Demonstrates CharacterChunkingStrategy. Move the sliders to observe how chunk boundaries and sliding overlap windows protect context continuity.

Chunk Size (Characters) 1000 chars
Overlap Window 200 chars

🧠 4-Turn Sliding Memory & FIFO Eviction Visualizer

Simulates InMemoryConversationMemory. The memory maintains a rolling window of the last 4 turns. Adding a 5th turn triggers FIFO eviction of the oldest turn while enriching the retrieval query vector.

Diagnostic: