VFlash: Fast, Accurate Visual Planning via Flash Primitive Decoding
u_Unrolled
D8: RAG & Knowledge Systems · Advanced RAG — Hybrid Search, Reranking, Context and Citations
Phase 5/Domain 8/Lesson 6

Advanced RAG — Hybrid Search, Reranking, Context and Citations

20 min read·Advanced· Unrolled Pro
Advanced RAG — Hybrid Search, Reranking, Context and Citations

You already know: BM25 and its blind spots (Retrieval fundamentals); dense retrieval and contrastive training (Embeddings); structural chunks with heading paths (Document ingestion); ANN indexes and filtering (Vector databases); chains with checks (D7 Advanced prompting).

Why this matters for Atlas. "Basic RAG" — embed the question, take the top 5 chunks, generate — is a demo, not a product. Production RAG is a pipeline of small, measurable improvements, each fixing a specific failure: hybrid search for codes and paraphrases, reranking for precision, query rewriting for vague questions, contextual chunks for orphaned facts, multi-hop retrieval for questions that span documents, diversity for redundant results, and citation checking for trust. This lesson builds each one and measures what it fixes and what it doesn't.


1. Hybrid search: keywords and meaning together

The question. BM25 misses paraphrases; dense retrieval misses exact codes. Can one system get both?

Start from nothing. Run both retrievers and fuse their result lists. Their scores live on different scales (BM25 is unbounded, cosine sits between −1 and 1), so the simplest robust fusion ignores scores and uses ranks. Reciprocal Rank Fusion (Cormack et al., 2009) scores each document as Σ 1/(k + rank) over the lists it appears in, with k ≈ 60. To make the dense side realistic, its "model" is trained on general text that never contains this help centre's error codes, just as a real embedding model was trained before your product existed:

That's the preview. The full lesson, with its code and exercises, is part of Unrolled Pro.
Staff AI & Pro Tier Lesson

Unlock "Advanced RAG — Hybrid Search, Reranking, Context and Citations"

The foundations are free forever. Unrolled Pro unlocks the complete lesson, production architectures, and 55 battle-tested ML system design case studies.

Everything included with Pro:
All 234+ Deep-Dive Lessons across transformer internals, inference, RAG & agents
55 Staff-Level ML & System Design Case Studies with mathematical capacity estimates
AI Engineer Sheet & Exercises with worked solutions, self-checks, and code
100 Landmark Research Papers guided walkthroughs & progress tracking
14-Day Money-Back Guarantee — 100% full refund if you aren't satisfied
View Plans & Unlock All Lessons

From ₹167/mo (~$2/mo) · Cancel anytime · Instant activation

100% Risk-Free: 14-day no-questions-asked money-back guarantee
Build Atlas · Part 7 of 9: Ground it in your documentsUse this lesson in the project: Chunk the lessons by structure, search them with BM25 and dense vectors, fuse the rankings, and measure retrieval apart from answers.