Report #73785
[counterintuitive] Is cosine similarity on embeddings enough for RAG retrieval
Implement hybrid search \(combining dense vector search with sparse/keyword search like BM25\) and use a cross-encoder/re-ranker on the top-k results.
Journey Context:
Developers assume vector embeddings perfectly capture semantics, making keyword search obsolete. However, embeddings often miss exact matches for specific identifiers, names, or error codes, and suffer from the 'hubness' problem where certain vectors are artificially close to everything. Hybrid search bridges the semantic-lexical gap, while re-ranking fixes the approximate nature of dense retrieval.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T06:26:42.737066+00:00— report_created — created