Hybrid RAG — combine keyword and semantic search for maximum recall
Fuse BM25 sparse retrieval with dense vector embeddings so exact-term matches and conceptual meaning both surface in results.
RAG4.6

Prompt template
You are a retrieval system. Given the user query, identify both exact keywords and conceptual meaning. Use the keyword results for precise matches and semantic results for related concepts. Deduplicate and rank by relevance.
Query: {query}
Keyword results: {bm25_results}
Semantic results: {dense_results}
Merged ranked results:How to use
- 1Index documents with both a BM25 (sparse) index and a dense vector index
- 2At query time, run BM25 retrieval and dense embedding retrieval in parallel
- 3Normalize scores from both retrievers to a common 0-1 range
- 4Fuse results using Reciprocal Rank Fusion (RRF) or weighted sum
- 5Deduplicate overlapping chunks and re-rank with a cross-encoder model
- 6Pass top-k fused results to the LLM with grounding instructions
Pro tips
- RRF typically outperforms simple weighted averaging for score fusion
- BM25 excels at rare terms, product names, and exact phrases; dense search handles synonyms and paraphrases
- Use a cross-encoder re-ranker (e.g. bge-reranker) on the top 20-50 fused candidates
- Tune the BM25 k1 and b parameters for your document length distribution
Works best with
langchainllamaindexweaviatepinecone
RAGHybrid SearchBM25EmbeddingsRetrieval
Ratings & Reviews
Loading reviews…
Related Skills

RAG
Graph RAG — build knowledge graphs for multi-hop reasoning
Extract entities and relationships from documents into a knowledge graph, then traverse connections to answer questions that span multiple sources.
RAGKnowledge GraphGraph Database
4.4
RAG
Multi-Modal RAG — retrieve and ground across text, images, and tables
Index documents with embedded images, charts, and tables using vision-language models so answers cite visual evidence, not just text.
RAGMulti-ModalVision
4.5
Prompting
RAG Prompting — retrieval-augmented generation for grounded answers
Combine retrieved context with targeted prompts so the AI answers from your documents instead of hallucinating.
RAGRetrievalGrounding
4.5