Hybrid search vs vector search: why pure vector RAG quietly fails

Pure vector search is great for conceptual synonyms, but notoriously bad at finding product SKUs, error codes, and exact names. Hybrid search combines BM25 and vector embeddings to give you the best of both worlds.

JobsDart Editorial4 min read

Key takeaways

  • Pure vector search maps concepts to high-dimensional space, excelling at synonyms but failing catastrophically on exact string matches.
  • Keyword search (BM25) matches exact tokens, serial numbers, and technical terms, but fails when users use different phrasing for the same idea.
  • Hybrid search executes both sparse lexical search (BM25) and dense semantic search (embeddings) in parallel.
  • Reciprocal Rank Fusion (RRF) normalizes and merges rank lists from both systems without requiring delicate score tuning.
  • You do not need separate databases: PostgreSQL with pg_trgm/tsvector and pgvector provides world-class hybrid search natively.

Understanding BM25 keyword search: the reliable foundation

BM25 (Best Matching 25) is the industry-standard probabilistic ranking function that powered search engines like Lucene, Elasticsearch, and Google for decades. It scores documents based on term frequency (how often a word appears in a document) inverted by document frequency (penalizing common words like "the" or "is").

BM25 is unbeatable for exact terms, acronyms, code identifiers, phone numbers, and unique product names. It requires no GPU compute, indexes gigabytes of text in seconds, and executes in single-digit milliseconds.

The limitation of BM25 is vocabulary mismatch: if a user searches for "affordable lodging" and a listing only uses the phrase "budget hotels", BM25 will return zero results.

Comparison: Keyword Search (BM25) vs Vector Search vs Hybrid Search
FeatureKeyword Search (BM25)Dense Vector SearchHybrid Search (BM25 + Vector)
Exact Token MatchingExceptional (SKUs, IDs, Names)Poor (diffuses exact characters)Exceptional
Synonym & Concept MatchingFails without manual thesaurusExceptional (semantic embeddings)Exceptional
Out-of-Vocabulary TermsNative (matches exact string)Poor (compresses into average vector)Native
Compute / Indexing CostExtremely cheap (CPU-only)Expensive (GPU embedding models)Moderate
Failure ModesVocabulary mismatchFalse-positive semantic hallucinationsExtremely Low

How Hybrid Search merges both worlds: Reciprocal Rank Fusion

Hybrid search does not attempt to create a single magic algorithm; it runs both BM25 and vector search in parallel and combines their results.

The challenge in hybrid search is score normalization: BM25 returns arbitrary positive unbounded float scores (e.g. 18.4), while vector search returns cosine similarity floats between 0.0 and 1.0. Directly adding these numbers together leads to one search method dominating the other.

The standard production solution is Reciprocal Rank Fusion (RRF). Instead of looking at raw scores, RRF evaluates the rank position of each document in both result sets using the formula `Score = 1 / (60 + Rank)`. A document that finishes in the top 3 of either search — or consistently places in the top 10 of both — gets boosted to the top of the final output.

Frequently asked questions

What is hybrid search?

Hybrid search combines traditional keyword-based lexical search (like BM25) with semantic vector search (dense embeddings) to find documents that match both exact keywords and conceptual meanings.

Why does pure vector search fail?

Vector search projects words into broad semantic clusters. It frequently fails when looking for exact alphanumeric tokens like serial numbers, software error codes, API function names, and product model numbers.

What is Reciprocal Rank Fusion (RRF)?

RRF is an algorithm used to merge ranked lists from different search engines without needing to calibrate their raw scores. It assigns document weights based on their reciprocal position rank in each search list.

Can PostgreSQL do hybrid search?

Yes. PostgreSQL combines built-in full-text search (`tsvector`) with the `pgvector` extension, allowing you to perform hybrid keyword and semantic vector queries in a single database transaction.

Is hybrid search better than pure vector RAG?

Yes. Empirical benchmarks consistently show that hybrid search delivers higher retrieval accuracy, lower hallucination rates, and superior handling of edge-case user queries compared to pure vector RAG.

Further reading

Check this against your own resume

Scan your CV against a real job description, or build a parse-safe one from scratch. Your first scan costs nothing.

Keep reading

Referenced in these guides

All career guides