started · updated
Hybrid retrieval combines vector and keyword search for AI
Hybrid retrieval is an architecture that combines dense vector search with sparse, keyword-oriented search to improve the accuracy of retrieval-augmented generation (RAG) and AI agents.
Dense vector search uses embeddings to find semantic similarities, allowing systems to connect paraphrased concepts. However, it can struggle with exact identifiers like error codes. Conversely, sparse or full-text search uses inverted indices and scoring functions like BM25 to match literal terms, but it may fail when queries are phrased differently from the source text.
By running both methods and using techniques such as reciprocal rank fusion, systems can merge results to capture both conceptual meaning and exact keyword matches. This approach helps prevent errors where an AI might retrieve a similar but incorrect document due to overlapping embeddings.
Entities
Dify.AI · OpenSearch · PingCAP · TiDB · Weaviate