Hybrid Search: How to Balance Semantic and Keyword Search in RAG
Citai Team
March 8, 2026 · 7 min read
Two ways to search, one answer
Modern RAG systems use hybrid search: combining semantic search (vectors) with keyword search (BM25). Each has distinct strengths.
Semantic search (vectors)
- Understands meaning: “cancel subscription” ≈ “unsubscribe from plan”
- Works with synonyms, paraphrases, natural language
- Can fail with exact technical terms or codes
Keyword search (BM25)
- Finds exact matches: “ERR_429”, “SKU-7832”, “Article 15”
- Ideal for proper names, IDs, specific terminology
- Doesn’t understand synonyms or variations
The key parameter: semantic_weight
Controls the ratio between methods. From 0.0 (BM25 only) to 1.0 (semantic only).
Recipe by content type
Technical docs (APIs, SDKs)
- semantic_weight: 0.4-0.5 — many codes and function names need exact match.
Support / customer service
- semantic_weight: 0.6-0.7 — users ask in natural language with synonyms.
Legal documents
- semantic_weight: 0.5 — perfect balance between exact terms and concepts.
Educational content / guides
- semantic_weight: 0.7-0.8 — conceptual questions, rarely exact terms.
Product catalogs
- semantic_weight: 0.3-0.4 — SKUs, model names, specs need exact match.
Result fusion: how RRF works
After getting results from both methods, they’re combined using Reciprocal Rank Fusion (RRF):
- Each method returns top-K candidates with ranking
- RRF scores based on position:
1 / (rank + k) - Candidates in both rankings get a boost
- semantic_weight adjusts each ranking’s influence
Other search parameters
top_k (initial candidates)
- Low (10-15): Faster, may miss relevant results
- High (25-40): More candidates, better recall
- Recommended: 20
similarity_threshold
- 0.1: Permissive | 0.3: Standard | 0.5: Strict
Playground diagnosis
- Run a query and examine separate results (Vector, BM25, Merged)
- If vector is good but BM25 is noise → raise semantic_weight
- If BM25 finds correctly but vector brings irrelevant → lower semantic_weight
Adjust hybrid search from each knowledge base’s RAG configuration.
Try Citai for free
Create your intelligent knowledge base in minutes. No credit card required.
Create free accountRelated articles
What is RAG? Retrieval-Augmented Generation Explained
Discover how RAG combines intelligent search with generative AI to deliver accurate answers with verifiable sources.
Read article → TechnologyEmbeddings and Semantic Search: How Context-Aware AI Works
Understand how embeddings transform text into vectors to find information by meaning, not exact words.
Read article → TechnologyCross-Encoder Reranking: How to Improve Your Chatbot's Accuracy
Learn how cross-encoder reranking dramatically improves RAG response relevance.
Read article →