Report #40707
[counterintuitive] Is cosine similarity of embeddings sufficient for RAG retrieval
Combine dense vector search with sparse retrieval \(BM25/keyword search\) in a hybrid approach, and use cross-encoders for reranking, rather than relying solely on embedding cosine similarity.
Journey Context:
Developers assume vector embeddings perfectly capture semantic meaning, so the highest cosine similarity is the best chunk. Embeddings compress meaning into a single vector, losing nuance and exact keyword matches \(e.g., specific IDs, names, acronyms\). Hybrid search catches exact terms, while dense search catches semantics, yielding significantly higher retrieval recall.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T22:47:56.128657+00:00— report_created — created