- In short
- Retrieval method should match the shape of the data. Dense vector retrieval excels at semantic or conceptual matching where the query and answer use different words for the same idea. Sparse or keyword retrieval excels at exact-term matching such as product codes, legal citations, or proper nouns. Structured data such as tables or databases is often better served by a direct query (SQL, API call) than by embedding-based retrieval.
Three methods, three data shapes
Retrieval is not one technique but several, and the exam's foundational point for this task statement is that the right method depends on the shape of the underlying data. Dense vector retrieval, sparse keyword retrieval, and direct structured queries each excel at a different kind of matching, and choosing among them is a design decision, not a default. The common error is reaching for vector retrieval reflexively because it is the fashionable RAG technique, when the data's shape actually calls for keyword matching or a direct query. Matching method to data shape is the skill.
Each method's strength is tied to what kind of question it answers well. Getting the fit right is upstream of everything else in retrieval strategy, so it is where the topic starts.
- Retrieval method selection by data shape
- Choosing a retrieval method to fit the underlying data: dense vector retrieval for semantic/conceptual matching, sparse keyword retrieval for exact-term matching (codes, citations, proper nouns), and direct structured queries (SQL, API) for tables and databases, rather than defaulting to vectors regardless of shape.
Dense for meaning, sparse for exact terms
Dense vector retrieval represents both the query and the content as embeddings and matches by semantic closeness. Its strength is conceptual matching: when the query and the answer express the same idea in different words, dense retrieval finds the connection because the embeddings are near each other even without shared vocabulary. For questions phrased differently from the source text, this is exactly right.
Sparse or keyword retrieval matches on the actual terms. Its strength is exact-term matching: product codes, legal citations, proper nouns, part numbers, anything where the specific string must match rather than a paraphrase. Here dense retrieval can actually underperform, because embeddings blur exact identifiers into a semantic neighbourhood, and a query for part 'XR-4471' does not want the semantically nearest part, it wants that exact part. When the corpus is dominated by exact identifiers, keyword retrieval outperforms vectors.
Structured data wants a direct query
The third case is structured data, tables, databases, records with fields. Embedding a structured database into a vector index is usually the wrong move: it discards the structure that makes the data queryable and turns precise lookups into fuzzy similarity searches. Structured data is often far better served by a direct query, a SQL statement, an API call, that uses the structure to fetch exactly the right rows. Asking a database 'return orders where status = shipped and date > X' is precise and correct; embedding those rows and hoping similarity surfaces them is neither.
So the design instinct for structured data is to expose it through a direct-query tool rather than folding it into the vector index. The structure is an asset; a direct query uses it, and embedding throws it away. This connects to live-state retrieval, where a direct tool call is also the right answer for current, changing values.
What the exam trips candidates on
Two traps. The first is using vector retrieval alone for a corpus dominated by exact identifiers, where keyword matching would outperform it, because embeddings blur the exact terms the queries need. The second is embedding a structured database into a vector index instead of exposing it through a direct query tool, discarding the structure that makes precise lookups possible. The credited answer matches the method to the data shape.
Worked example
A team is building retrieval for a parts-catalogue assistant. The corpus is a structured database of parts, each with an exact part number, and most queries look up a specific part number or filter by attributes like voltage and material. The team's default plan is to embed every part record into a vector index and use dense retrieval. Evaluate.
The default plan is a double data-shape mismatch, and both are traps in this knowledge point. First, the queries are dominated by exact part numbers, and dense vector retrieval is poor at exact-identifier matching: embeddings place 'XR-4471' in a semantic neighbourhood of similar-looking parts, so a lookup for that exact number may surface near-matches instead of the exact part. For exact-term matching, sparse or keyword retrieval is the right tool, because it matches the actual identifier rather than a paraphrase of it. Using vectors alone here is the first trap.
Second, and more fundamentally, the source is a structured database with fields like voltage and material, and many queries filter by those attributes. Embedding the records into a vector index throws away exactly the structure that makes those filters precise, converting 'voltage = 12 and material = copper' into a fuzzy similarity search that cannot reliably enforce the constraint. That is the second trap, embedding structured data instead of querying it. The right design exposes the parts database through a direct-query tool (SQL or an API) so exact part-number lookups and attribute filters run against the structure precisely, and reserves embedding-based retrieval, if used at all, for any genuinely free-text fields like part descriptions where semantic matching adds value. The method follows the data shape: direct query for the structured lookups and filters, keyword for exact identifiers, dense only where meaning matters.
Common misreadings to avoid
Misconception
Vector retrieval is the best general-purpose method, so use it for any corpus.
What's actually true
Misconception
Structured databases should be embedded into a vector index so the agent can retrieve from them.
What's actually true
How this shows up on the exam
Expect a corpus with a specific shape, exact identifiers, structured records, conceptual text, and a retrieval method to evaluate. The reliable reading is to fit the method to the data: dense for meaning, sparse for exact terms, direct query for structured data. This foundational knowledge point unlocks live-state vs static retrieval and hybrid retrieval and re-ranking, relates to the RAG pipeline stages, and feeds the scenario-matching capstone.
A parts-catalogue assistant queries a structured database mostly by exact part number and attribute filters. The team plans to embed all records into a vector index and use dense retrieval. What is the better approach?
People also ask
When should you use dense vector retrieval?
What is sparse or keyword retrieval good for?
Should structured data be embedded or queried?
Watch and learn
Official Anthropic Academy lessons first, then hand-picked walkthroughs. Videos load only when you press play.
No videos curated for this concept yet
We are still curating the best official and community videos for this topic.
Official prep for this domain
Anthropic's own free prep module for this part of the syllabus, on the official prep course. Free with an Anthropic Academy sign-in.
References & primary sources
Master this concept with Archie
Practice it inside an adaptive study session. Archie, your Socratic AI tutor, tracks your mastery with Bayesian Knowledge Tracing and schedules the perfect next review.