Skip to content

Command Palette

Search for a command to run...

← All concepts
Concept

Hybrid Search

Combining vector (semantic) and BM25 (keyword) search for more robust retrieval.

Simple explanation

Vector search is good at meaning; keyword search is good at exact matches (IDs, names, code). Hybrid search combines both so you catch both types of relevance.

Engineering explanation

Hybrid search runs vector (dense) and BM25 (sparse) queries in parallel, then fuses the rankings using Reciprocal Rank Fusion (RRF) or a learned weighting. RRF is parameter-free: score = Σ 1/(k + rank). Production RAG uses hybrid search because policies/procedures contain IDs and section numbers that pure vector search misses.

Example

Query 'POL-4412 cancellation' → vector finds cancellation chunks, BM25 finds the exact policy number → RRF combines → correct chunk ranks first.

When to use it

Any RAG over mixed content (prose + identifiers). When users search by name, ID, or code. Essentially always in production.

Common misconception

Hybrid search is NOT redundant. Vector and BM25 catch different things. Skipping either loses recall on certain query types.