Hybrid BM25 + embedding search
A retrieval pattern combining classical BM25 lexical search with dense vector similarity, used by AI agents to recover both literal-match results and semantically-related passages from a codebase or knowledge base.
BM25 is precise but brittle — it cannot recover a result whose wording differs from the query. Embeddings are robust to phrasing but can miss exact identifier matches. Hybrid retrieval runs both and merges scores, which is why production agentic search systems converge on this pattern rather than picking one.
Placeholder body. Replace with the full glossary entry per playbook §9. Cite Anthropic’s “agentic search > semantic search” stance and the SpIDER / AgentIR-4B 2025–2026 papers.
When to use
- Agent-facing search over a large code or document corpus where both identifier-grade lookups and concept-grade lookups are valid queries.
- MCP servers exposing a single search tool to the agent — hybrid keeps the contract simple while serving both query styles.
Compare with
Pure-embedding search saves the BM25 index but loses precision on identifier queries. Pure-BM25 saves the embedding cost but loses recall on conceptual queries. Hybrid pays both costs and avoids both failure modes.