What is Hybrid Search?
A retrieval strategy that combines semantic (vector) search with keyword (full-text) search and merges the results, capturing both meaning and exact matches.
Vector search finds passages that mean the same thing as the query; keyword search finds passages that contain the same strings. Each fails where the other excels: vectors miss exact error codes and product names, keywords miss paraphrases and synonyms.
Hybrid search runs both and merges the ranked lists — commonly with reciprocal rank fusion (RRF), which rewards documents that rank well in either list without needing to calibrate incomparable scores against each other.
For technical documentation, hybrid retrieval is close to mandatory: users search both ways, often in the same query ("ERR_4012 after rotating keys").
How BeforeQuery uses this
Every BeforeQuery retrieval — chat grounding, the Search API, the widget's search mode, MCP's search_docs — runs pgvector cosine similarity and PostgreSQL full-text ranking in parallel, then fuses them with RRF. Source-group filters and document visibility are applied at query time.
Related terms
Semantic Search
Search that ranks results by meaning similarity between the query and documents, using embeddings, rather than by matching keywords.
Embeddings
Numeric vector representations of text in which semantically similar passages end up close together, enabling search by meaning rather than exact words.
Vector Database
A data store optimized for saving embedding vectors and finding the nearest neighbors of a query vector quickly, at scale.
RAG (Retrieval-Augmented Generation)
An AI architecture that retrieves relevant documents from a trusted knowledge source and passes them to a language model, so answers are grounded in real content instead of the model's training data.
From definition to deployment
Connect a knowledge source and see cited AI answers on your own content in minutes — free, no credit card required.
Get Started Free