Hybrid search
Combining keyword search (such as BM25) with vector search, so results match both exact terms and meaning.
Embeddings find text with similar meaning but are weak on exact strings: product codes, invoice numbers, names, rare jargon. Keyword search is the opposite. Hybrid search runs both and merges the lists, often with reciprocal rank fusion, and a reranker can sort the merged result. In many RAG systems this, not a better model, is what fixes wrong answers.
Related terms
- RAG (retrieval-augmented generation): Finding relevant documents first and putting them into the prompt, so the model answers from them.
- Reranker: A model that rescores the top search results against the query, so the most relevant ones go to the language model first.
- Embeddings: Vectors of numbers that place texts with similar meaning close together.
- Vector database (pgvector and others): A database that stores embeddings and finds the nearest ones to a query vector quickly, which is the search step behind most RAG systems.
