Azure AI Search Hybrid Search: RAG Answers with Citations | Ep 7
Kodify Dev
0:00 / 0:00
Azure AI Search Hybrid Search: RAG Answers with Citations | Ep 7
92 просмотра · 5 дн. назад
Kodify Dev
90 подписчиков
92 просмотра · 5 дн. назад
Azure AI Search hybrid search and semantic ranker tutorial for RAG in C# and .NET 10: grounded answers with verified citations, streamed with Server-Sent Events. Episode 7 of the Kodify Dev "RAG in .NET" series.
Our knowledge base is full of chunks and vectors. In this episode we use it: we search it four ways (keyword, vector, hybrid and the semantic ranker), compare the results in Scalar with the debugger, and build the part that makes RAG, RAG: a grounded agent that answers only from the documents, with verified citations, streamed token by token. Then we get the API ready for the Angular interface: conversation history, follow-up questions rewritten by a model, status events, opening the original file, and a clean Stop button.
In this episode:
✅ Keyword (BM25), vector, hybrid (RRF) and the semantic ranker in Azure AI Search, and when to use each
✅ Scalar: API docs and a test client for .NET, instead of curl
✅ VectorizableTextQuery and the semantic configuration in Azure AI Search
✅ Grounding: numbered sources, a "not found" answer, and citations checked in code
✅ Guardrails in five layers: input limits, a minimum reranker score, prompt rules against prompt injection, verified citations, platform filters
✅ Server-Sent Events from ASP.NET Core: status, token, citations and done events, with a small Sse helper
✅ Follow-up questions: send the history, and rewrite the question before searching
✅ Why the debugger stops when a client cancels a request, and how to handle it in the action
⏱️ Chapters
00:00 Welcome to Kodify Dev
00:43 The plan
01:47 How retrieval works: four ways to search
03:01 Guardrails: five layers
04:06 Step 2: Add Scalar to the API
04:33 Semantic configuration in the index
05:17 Step 3: Search models
06:40 KnowledgeSearch service
09:27 Step 4: Search endpoint
10:27 Program.cs and build
11:27 Step 5: Run and compare the search modes in Scalar
13:06 Debugging the hybrid request
14:10 Semantic ranker
14:58 Step 6: Grounded agent and guardrails
16:21 Conversation history and the question rewriter
17:53 AnswerService and the minimum score
20:30 How Server-Sent Events work
22:27 The Sse helper: status and token events
23:36 Step 7-8: Ask controller and the stream
26:52 Step 9: Debug the prompt
27:24 Answer with citations
28:20 Break the guardrails: empty input and prompt injection
29:27 Streaming in Scalar
30:44 Step 10: Follow-up questions with history
31:31 Open the original file: download endpoint
32:33 Stop button: the debugger breaks on cancellation, and the fix
34:49 Production tips
35:22 Step 11: Commit and push
📚 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...
Ep 7 · Retrieval and answers: hybrid search, semantic ranker, citations and streaming: • Azure AI Search Hybrid Search: RAG Answers...
Ep 8 · Image RAG and image generation (coming soon)
📦 Code for this episode: https://github.com/shahidnoor19/kodif...
📝 Search service code: https://github.com/shahidnoor19/kodif...
📝 Grounded answer service code: 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 6 · Knowledge ingestion with the Azure AI Search indexer: • Azure AI Search Indexer in C#: RAG Ingesti...
➡️ Next: Ep 8 · Image RAG and image generation with agent tools
🧰 Stack: C# · .NET 10 · ASP.NET Core Web API · Azure AI Search (hybrid search, semantic ranker) · Microsoft Agent Framework · Microsoft Foundry / Azure OpenAI (gpt-4.1-mini, text-embedding-3-small) · Scalar · Server-Sent Events · VS Code + C# Dev Kit
ℹ️ The keys shown in this video belong to resources that were deleted before publishing.
🔗 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 #AzureAISearch #HybridSearch