Match the retrieval method to the question
Given data sources and example questions, identify the retrieval method each needs (keyword, semantic, hybrid, structured query or agentic search) and explain why one method alone fails some of them.
Scenario
An industrial distributor wants one assistant for its sales staff. The team has already put everything into a vector database: 40,000 product data sheets, 9,000 support articles, the order history (a SQL table with 30 million rows) and the internal wiki.
Early testers ask four kinds of question:
- "Data sheet for bearing 6204-2RS-C3?"
- "Which seal should I offer a food plant that washes down with hot caustic?"
- "How many orders did Nordic Foods place in Q2, and what was their total value?"
- "Why did our margin on hydraulic hoses fall this year? Check pricing, supplier and returns notes."
The demo handled the second question well and the other three badly. Before reading why, decide what each needs.
Explanation
Each method answers a different shape of question:
| Method | How it works | Good for | Fails on |
|---|---|---|---|
| Keyword (BM25) | Ranks text by matching terms | Part numbers, error codes, names, exact phrases | Paraphrases and synonyms |
| Semantic (embeddings) | Ranks by closeness of meaning | Questions in the user's own words, concepts | Exact identifiers that look alike |
| Hybrid | Runs both, merges with rank fusion | Collections that get both kinds of question | Filters and totals |
| Structured query | Claude writes SQL or an API query through a read-only tool | Filters, counts, sums, joins over records | Free-text meaning |
| Agentic search | Claude runs several searches with tools, reading as it goes | Multi-step, comparative or open questions; navigating files | Simple lookups, where it adds time and tokens |
Three points from Anthropic's work behind this table:
- Embedding models "can miss crucial exact matches". BM25 is "particularly effective for queries that include unique identifiers or technical terms". Combining the two with rank fusion is the standard hybrid design.
- For data analysis, Claude Code writes targeted queries and stores results instead of loading whole data objects into context: the database does the counting.
- Agentic search trades speed for reach. Runtime exploration is slower than retrieving precomputed results, and without good tools and guidance an agent wastes context on dead ends. Anthropic's research agents search broad first, then narrow, with each result shaping the next query.
Look at the data's shape and the question's shape together. Records with fields want a query. Text that users ask about in their own words wants semantic search; text full of codes needs keyword search too. A question whose next step depends on the last answer wants an agent. A real system often needs several methods, routed by source or by question type. And if the whole knowledge base fits comfortably in context, you may not need retrieval at all.