Report #15708
[architecture] Vector similarity search missing exact keyword matches and poor ranking with embeddings alone
Combine ANN vector search with BM25 full-text search using Reciprocal Rank Fusion \(RRF\) to merge result sets
Journey Context:
Pure vector search \(HNSW, IVFFlat\) captures semantic similarity but misses exact keyword matches, struggles with out-of-vocabulary terms, and embeds are poor at matching specific IDs or codes. Full-text search \(BM25\) excels at lexical matching but misses semantic nuance. Hybrid approaches run both queries independently and fuse results. RRF requires no tuning or score normalization: score = Σ 1/\(k \+ rank\) where k=60 typically, summing across result sets. Documents appearing high in both lists rank highest. Tradeoffs: Doubles query latency \(both searches must complete\), requires maintaining both vector and inverted indexes, and increases storage. Pre-filtering with metadata before vector search is often necessary for performance.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T00:48:54.851850+00:00— report_created — created