Skip to content

Hybrid Search for RAG

Combining keyword and vector search so RAG finds both exact terms and paraphrased meaning.

Editorial team 2 min read

Vector search finds passages with similar meaning; keyword search finds exact terms. RAG systems usually need both.

Why Vector Search Alone Falls Short

Embeddings handle paraphrase well but can miss exact product codes, error numbers, names, acronyms and rare technical terms. A question about "error E-4012" may retrieve passages about errors generally.

Why Keyword Search Alone Falls Short

It misses synonyms and natural-language phrasing: "can't sign in" won't match "authentication failure".

Combining Them

Run both searches and merge the result lists. Reciprocal rank fusion (RRF) is a simple, robust method: each document scores based on its rank in each list, so documents ranked well by both rise to the top. Weighted score combinations are an alternative but need score normalisation.

Tuning

  • Retrieve more candidates from each method than you'll finally use.
  • Adjust the balance based on your content: more keyword weight for technical documentation with codes, more semantic weight for conversational questions.
  • Add a re-ranker after fusion for best precision.

Implementation

Many search engines and vector databases support hybrid search natively; otherwise run both and fuse the lists in application code.

Evaluate

Compare recall@k for keyword-only, vector-only and hybrid on your real questions. Hybrid usually wins, but measure it.

More in RAG

All RAG guides →
RAG Guide · 1 min

RAG Architecture: The Components End to End

A map of a complete retrieval-augmented generation system, from ingestion to answer, and what each component is responsible for.

RAG 1 min read 6 Dec 2025

RAG Guide · 2 min

Document Parsing for RAG

Turning PDFs, slides, HTML and scans into clean, structured text — the unglamorous step that decides RAG quality.

RAG 2 min read 5 Dec 2025

RAG Guide · 2 min

Chunk Size and Overlap Tuning

How to choose chunk size and overlap for retrieval by testing against real questions rather than guessing.

RAG 2 min read 4 Dec 2025

RAG Guide · 1 min

Query Rewriting and Expansion

Improving retrieval by rewriting user questions: expansion, decomposition, hypothetical answers and conversational context.

RAG 1 min read 2 Dec 2025