Skip to content
derpx06.dev
WritingExplainersNotesAbout
works on my machineit's always DNSship itLGTMTODO: sleepoff by oneread the docsgit push --force-with-lease404: sleep not foundhave you tried turning it off and on againrubber duck says: explain itpremature optimisationworks on my machineit's always DNSship itLGTMTODO: sleepoff by oneread the docsgit push --force-with-lease404: sleep not foundhave you tried turning it off and on againrubber duck says: explain itpremature optimisation

Learning in public.

A student's notebook on system design, distributed systems and databases. Shared as I learn.

ReadWritingExplainersNotesAbout
ElsewhereGitHubLinkedInHugging FaceLeetCode
Say hellomanaskhairnar1511@gmail.com
derpx06
NORMALmain© 2026 Derpx06Pune, Indiatop ↑
Learn/LangChain Mastery/Part 5 · 4. Embeddings & Vector Stores
Lesson 36 of 68

Dense vs Sparse (BM25 Overview)

Keywords vs Semantic Meaning. Why you probably need both.

Derpx0610 Jan · 1 min read
LangChain Mastery
Embeddings: What Matters in PracticeEmbedding Models in LangChainVector Stores: FAISS, ChromaPersisting & Reloading IndexesMetadata FilteringDense vs Sparse (BM25 Overview)Hybrid Search Concepts
Contents
Dense vs Sparse Retrieval1. Two Ways to SearchSparse Retrieval (Keyword Search / BM25)Dense Retrieval (Vector/Semantic Search)2. When Semantic Fails3. The Gap4. Summary
0% read · 1 min leftBack to top ↑
Course outline & contents0%
LangChain Mastery
Embeddings: What Matters in PracticeEmbedding Models in LangChainVector Stores: FAISS, ChromaPersisting & Reloading IndexesMetadata FilteringDense vs Sparse (BM25 Overview)Hybrid Search Concepts
Contents
Dense vs Sparse Retrieval1. Two Ways to SearchSparse Retrieval (Keyword Search / BM25)Dense Retrieval (Vector/Semantic Search)2. When Semantic Fails3. The Gap4. Summary

Dense vs Sparse Retrieval

1. Two Ways to Search

Sparse Retrieval (Keyword Search / BM25)

  • How it works: Matches exact words. Counts frequency (TF-IDF).
  • Strengths: Finding specific names ("Model X-15"), error codes ("Error 501"), and rare terms.
  • Weaknesses: Fails at synonyms. "Laptop" does not match "Notebook."

Dense Retrieval (Vector/Semantic Search)

  • How it works: Embeddings.
  • Strengths: Understanding intent. "Device for work" matches "Laptop."
  • Weaknesses: Fails at exact matches. It might think "Java" (language) is similar to "Coffee" (drink) and return irrelevant results if the context is weak.

2. When Semantic Fails

If a user searches for an acronym "W2-Form," semantic search might retrieve "Tax Documents." That is conceptually correct, but the user wants the exact form. BM25 would find the exact document containing "W2-Form."

3. The Gap

Pure Vector Search is often "too smart for its own good." Pure Keyword Search is "too dumb."

We need a system that understands meaning but respects keywords.

4. Summary

Don't abandon keywords. Google still uses keywords for a reason. Precision matters.

Key Intuition: "Vectors for Concept. Keywords for Precision."

Track your progressSign in and your progress follows you across devices.
Sign in to track progress Next lesson
← Previous lessonMetadata FilteringNext lesson →Hybrid Search Concepts