Hybrid search
Hybrid search is an information-retrieval technique that combines multiple retrieval methods or relevance signals to find or rank relevant results.
AI Agents in Action, Second Edition
Hybrid search combines multiple retrieval methods, typically including vector-based and lexical or structured search, to improve information retrieval.
- How it is used
- Supplies RAG agents with context that combines exact-term precision and meaning-based recall.
- How deep it goes
- Explains parallel searches and RRF’s rank formula, then shows agent-directed tool use; does not develop search-backend internals.
- Examples
- Uses an exact error-code lookup and a script-question agent whose vector-only search misses a key time term.
- What you can do after
- Apply it via semantic and keyword search tools, then verify that answers cite the retrieved passages.
Read how AI Agents in Action, Second Edition explains hybrid search →
AI-Powered Search
Hybrid keyword and vector search combines lexical term matching with vector-similarity retrieval or ranking.
- How it is used
- Combines complementary search result lists to improve relevance when lexical matching or vector similarity alone may be insufficient.
- How deep it goes
- Works through rank-fusion mechanics, the k parameter, and Python calls for separate searches and engine-supported merging.
- Examples
- Compares lexical, vector, and fused movie results for “singin' in the rain” and “the hobbit.”
- What you can do after
- Apply it via collection.hybrid_search with lexical and vector requests, selecting reciprocal rank fusion and configuring k.
Building Reliable AI Systems
A retrieval technique that combines multiple approaches to find relevant information.
- How it is used
- Improves candidate document retrieval for RAG and search when embedding similarity or keyword matching alone misses relevant information.
- How deep it goes
- Works through BM25 and embedding setup, candidate combination, and optional cross-encoder reranking, including the reranker’s speed limitation.
- Examples
- Uses an employee-policy chatbot with resignation, adoption-leave, and termination queries and displayed ranked results.
- What you can do after
- Build it from scratch as a BM25-plus-E5 retriever with cross-encoder reranking of initial candidates.
Read how Building Reliable AI Systems explains hybrid search →
Domain-Specific Small Language Models
A retrieval method that combines keyword-based and vector-based search to improve retrieval quality.
- How it is used
- Deploys combined lexical and semantic retrieval inside RAG and agentic-AI systems to improve downstream document retrieval.
- How deep it goes
- Implements BM25, embeddings, LanceDB storage, weighted ensembling, and agent tooling, but does not detail ranking fusion internals.
- Examples
- Demonstrates smart-home document chunks retrieved through BM25, semantic search, and a weighted hybrid tool selected by CodeAgent.
- What you can do after
- Builds a weighted hybrid retriever with LangChain, LanceDB, Hugging Face embeddings, and smolagents.
Read how Domain-Specific Small Language Models explains hybrid search →
Generative AI in Action
Hybrid search combines multiple search methods, such as text-based, categorical, numerical, and vector-based retrieval, in one query.
- How it is used
- Retrieves relevant indexed content for search and for prompts in a retrieval-augmented chat application.
- How deep it goes
- Defines combined search types and shows Redis query construction, but does not elaborate reciprocal rank fusion internals.
- Examples
- Uses a Redis search for three similar blog posts and an end-to-end chat application that retrieves five results.
- What you can do after
- Apply it via Redis to retrieve indexed posts for a query and supply matching chunks to an LLM prompt.
Essential GraphRAG
Hybrid search is an information-retrieval technique that combines multiple retrieval methods, such as vector similarity search and full-text search.
- How it is used
- Improves RAG retrieval by combining precise keyword matching with broader semantic matching.
- How deep it goes
- Implements normalized score merging, deduplication, and top-k selection, but stops short of resolving limitations from unstructured data.
- Examples
- Demonstrates Neo4j Cypher queries and retrieved passages about Einstein’s upbringing, inventions, patents, and laboratory work.
- What you can do after
- Build it in Neo4j by querying vector and full-text indexes, combining normalized results, and returning top-k passages.
Natural Language Processing in Action, Second Edition
A hybrid search pipeline combines vector-similarity retrieval with full-text retrieval to search by both semantic and lexical signals.
- How it is used
- Combines semantic similarity and lexical retrieval to improve search over language and documents.
- How deep it goes
- Builds from term-frequency retrieval and full-text search toward embeddings and a scalable hybrid pipeline.
- Examples
- Uses keyword search, embedding-based semantic search, PostgreSQL, and pgvector as concrete implementation examples.
- What you can do after
- Operate/configure PostgreSQL with pgvector and full-text indexes for scalable hybrid retrieval.
Read how Natural Language Processing in Action, Second Edition explains hybrid search →
Build an AI Agent (From Scratch)
Hybrid search combines multiple retrieval methods and integrates their scores to rank results.
- How it is used
- Combines retrieval methods to rank results for queries requiring both exact matching and semantic similarity.
- How deep it goes
- Explains score normalization and weighted averaging, but stops short of specifying an implementation or weight-selection procedure.
- Examples
- Uses get_user_by_id, error code 404, natural-language storage questions, sofa and couch, codebases, and extracted zip files.
- What you can do after
- Apply it by combining normalized keyword and vector scores into a weighted final ranking.
Read how Build an AI Agent (From Scratch) explains hybrid search →
Related concepts
- lexical searchuses · Lexical search retrieves or ranks items by matching query terms or other surface-text features against indexed content, often using sparse representations and statistical weighting.
- similarity searchuses · Similarity search is a retrieval technique that finds or ranks items by comparing their representations with a query according to a similarity or distance measure.
- information retrievaluses · Information retrieval is the process of locating and selecting relevant information from an available collection in response to a query or information need.
- reciprocal rank fusionuses · Reciprocal rank fusion is a rank-aggregation technique that combines ranked lists by summing reciprocal-rank contributions for each item across the lists.
- BM25uses · BM25 is a probabilistic information-retrieval ranking function that scores documents for a query using term frequency, inverse document frequency, and document-length normalization.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.







