Two kinds of search, run together

Hybrid RAG runs two retrieval methods in parallel and merges their results: dense retrieval (embedding-based vector search, covered in Lesson 3) for semantic similarity, and sparse retrieval, most commonly the decades-old algorithm BM25, for exact keyword and term-frequency matching. Sparse retrieval scores a chunk by how often and how distinctively a query's literal terms appear in it, the same basic idea a traditional search engine uses, with no notion of meaning at all.

Why combining them beats using either alone

Dense and sparse retrieval fail in complementary ways: dense search misses exact terms it has never seen phrased that way, sparse search misses paraphrases and synonyms it has no notion of meaning for. A hybrid system computes both a dense score and a sparse score for every candidate chunk, then merges the two rankings, commonly with an algorithm called Reciprocal Rank Fusion (RRF), which combines two ranked lists based on each item's rank position rather than trying to make two differently-scaled scores directly comparable.

The practical effect: a query containing both a technical term and a natural-language description ("error E4021 keeps happening after login") benefits from sparse search catching "E4021" exactly and dense search catching the semantic connection between "keeps happening" and words like "recurring" or "intermittent" that the actual document might use instead.

Question

Dense: Vector Search

Reciprocal Rank Fusion

Sparse: BM25

Merged Ranking

Two independent searches over the same question, merged by rank position rather than by comparing two differently-scaled scores directly.

Cost of the improvement

Hybrid retrieval roughly doubles the retrieval-side computation, running two searches and a fusion step instead of one, and requires maintaining two indexes over the same data instead of one. For a knowledge base heavy on codes, names, or precise technical vocabulary, most teams find that cost well worth it; for prose-heavy, conversational content, the gain over dense-only search is often smaller.

Checkpoint

  • Dense retrieval: embedding-based, strong on meaning and paraphrase, weak on exact terms.
  • Sparse retrieval (BM25): keyword-based, strong on exact terms and codes, has no notion of meaning.
  • Reciprocal Rank Fusion merges two ranked result lists by rank position, avoiding the problem of comparing two differently-scaled relevance scores directly.

If anything here still feels unclear, ask before moving to Lesson 12.