Skip to main content
Hybrid search combines vector similarity (semantic meaning) with keyword matching (exact terms) to get the best of both approaches. It’s the recommended search type for most production use cases.

How It Works

Hybrid search runs two searches in parallel:
  1. Vector search finds semantically similar content (meaning-based)
  2. Keyword search finds exact term matches (text-based)
  3. Fusion combines results using Reciprocal Rank Fusion (RRF)
The RRF algorithm merges rankings with the formula: RRF(d) = Σ 1/(k + rank) This ensures documents that rank well in both searches appear at the top, while documents that only match one method still surface.
Not all vector databases support hybrid search or RRF.
Use vector-only if your queries are always conceptual with no specific terms. Use keyword-only if you need exact matching (e.g., search by ID or code).

Configuration

Basic Setup

With Reranking

Add a reranker to improve result ordering after fusion:

RRF Constant

The k constant in RRF controls how much weight lower-ranked results receive. Higher values (e.g., 60) smooth out rankings; lower values make top results more dominant.

Example

hybrid_search.py

Supported Vector Databases

Hybrid search is available in: Check individual vector database docs for specific hybrid search capabilities.