RAG Explained for Beginners: How It Works | Ep 2
Kodify Dev
0:00 / 0:00
RAG Explained for Beginners: How It Works | Ep 2
195 просмотров · 2 нед. назад
Kodify Dev
82 подписчика
195 просмотров · 2 нед. назад
RAG explained for beginners, step by step: how retrieval-augmented generation works, with embeddings, chunking, vector search, BM25, hybrid search and grounding, shown live in a C# and .NET 10 RAG application. Episode 2 of the Kodify Dev "RAG in .NET" series, built with Azure AI Search and Microsoft Foundry.
What really happens between "upload a PDF" and "an answer with citations"? In this episode we go through every concept behind a production RAG (retrieval-augmented generation) architecture, with live examples in our running app built with .NET 10, Azure AI Search, Microsoft Foundry (Azure AI Foundry) and OpenAI models. At the end, we save the notes in the repo and push them to GitHub.
In this episode:
✅ How an LLM works: next-token prediction, frozen knowledge, the context window and hallucinations (with a live proof)
✅ Prompt stuffing vs fine-tuning vs RAG
✅ RAG architecture: the ingestion pipeline and the question-answering pipeline
✅ Text extraction, chunking (1,600 characters, 250 overlap) and embeddings (1,536 dimensions)
✅ Vector search, cosine similarity and HNSW
✅ Keyword search with BM25, and a live keyword vs vector demo
✅ Hybrid search with Reciprocal Rank Fusion (RRF) and the semantic ranker in Azure AI Search
✅ Query rewriting for follow-up questions
✅ The grounded prompt, citations and streaming with Server-Sent Events
✅ AI agents and tools (function calling) and image RAG
⏱️ Chapters
00:00 What is RAG? What this episode covers
00:32 How an LLM works
01:04 Live proof: the model doesn't know your company
01:17 LLM hallucinations
01:42 Prompt stuffing vs fine-tuning vs RAG
02:13 What is RAG? (retrieval-augmented generation)
02:44 RAG pipeline 1: ingestion
03:03 RAG pipeline 2: question answering
03:21 Text extraction
03:57 Chunking for RAG
04:31 Chunk overlap
05:00 Embeddings explained
05:28 Vector search and cosine similarity
05:53 HNSW
06:26 Keyword search with BM25
06:58 Live demo: keyword vs vector search
07:22 Hybrid search and Reciprocal Rank Fusion (RRF)
07:56 The semantic ranker
08:29 Query rewriting
09:00 The grounded prompt
09:30 Citations and streaming (SSE)
09:58 AI agents and tools (function calling)
10:33 Image RAG
11:07 Recap
11:36 Saving the notes in VS Code
12:15 Commit and push to GitHub
📚 Enterprise RAG in .NET: the full course (watch in order)
Ep 1 · RAG in C# & .NET 10: live demo, tech stack and project setup: • RAG in C# & .NET 10: Build an Enterprise R...
Ep 2 · RAG explained: embeddings, chunking, vector and hybrid search: • RAG Explained for Beginners: How It Works ...
Ep 3 · Azure AI Foundry (Microsoft Foundry) and Azure OpenAI model deployments: • Azure AI Foundry Tutorial: Deploy GPT Mode...
Ep 4 · Azure AI Search and Blob Storage setup: • Azure AI Search Tutorial for RAG: Service ...
Ep 5 · Web API backend and the first AI agent: • Microsoft Agent Framework in C#: Your Firs...
Ep 6 · Knowledge ingestion: Blob Storage, indexer, skillset and vectorizer: • Azure AI Search Indexer in C#: RAG Ingesti...
📦 Code for this episode: https://github.com/shahidnoor19/kodif...
📝 Today's notes: https://github.com/shahidnoor19/kodif...
📦 Full repository: https://github.com/shahidnoor19/kodif...
▶️ Full playlist: • RAG in C# & .NET 10: Full Course (Azure AI...
⬅️ Previous: Ep 1 · RAG in C# & .NET 10, live demo and project setup: • RAG in C# & .NET 10: Build an Enterprise R...
➡️ Next: Ep 3 · Azure AI Foundry (Microsoft Foundry) and Azure OpenAI model deployments: • Azure AI Foundry Tutorial: Deploy GPT Mode...
🧰 Stack: C# · .NET 10 · ASP.NET Core Web API · Angular · Microsoft Agent Framework · Microsoft Foundry / Azure AI Foundry · OpenAI models · Azure AI Search · Azure Blob Storage
🔗 Connect
GitHub: https://github.com/shahidnoor19
LinkedIn: / shahid-noor-4563a6222
🔔 Subscribe to Kodify Dev for .NET, Azure, Angular and AI tutorials, and turn on notifications for the next episode.
#RAG #dotnet #csharp #VectorSearch #HybridSearch