liveBook · Manning

Hybrid search

As explained in Domain-Specific Small Language Models

A retrieval method that combines keyword-based and vector-based search to improve retrieval quality.

Hybrid search combines keyword retrieval with vector-based semantic search, improving the documents returned to downstream RAG and agentic-AI tasks. section 14.2 section 14.4

Keyword search finds terms and related lexical matches, while semantic search compares query and document embeddings. Combining both supports exact-term and meaning-based retrieval. section 14.2

Agentic RAG over smart-home documents

A CodeAgent receives keyword, semantic, and hybrid search tools. For a smart-home query, it can select the hybrid tool against the local LanceDB database and return relevant document chunks.

How Domain-Specific Small Language Models covers it

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 it assumes
Assumes document chunking and basic retriever construction while supplying implementations for keyword, vector, and combined search.
What you can do after
Builds a weighted hybrid retriever with LangChain, LanceDB, Hugging Face embeddings, and smolagents.
How it connects
Connects BM25, semantic search, vector databases, embeddings, RAG, LangChain, and agentic AI.

Also explained in

Compare how 8 books explain hybrid search →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Domain-Specific Small Language Models. The section links point to the parts of the book it draws on.