Principle:Infiniflow Ragflow Hybrid Retrieval
| Knowledge Sources | |
|---|---|
| Domains | RAG, Information_Retrieval, NLP |
| Last Updated | 2026-02-12 06:00 GMT |
Overview
A search strategy that combines dense vector similarity with sparse keyword matching and optional reranking to retrieve the most relevant document chunks.
Description
Hybrid Retrieval merges two complementary retrieval paradigms: dense retrieval (embedding-based vector similarity) and sparse retrieval (BM25-style keyword matching). The vector similarity weight parameter controls the balance: a weight of 0.3 means 30% vector + 70% keyword. Results from both methods are fused using score combination, then optionally reranked by a cross-encoder model. This hybrid approach outperforms either method alone because vector search captures semantic meaning while keyword search captures exact term matches.
Usage
Use this principle for testing retrieval quality on a knowledge base. This is the core search mechanism used by chat applications, search applications, and the retrieval testing interface.
Theoretical Basis
Where:
- is the vector_similarity_weight (default 0.3)
- is cosine similarity between query and document embeddings
- is the BM25/TF-IDF keyword relevance score
Optional reranking applies a cross-encoder to the top-K results for more precise ordering.