An embedding is a vector representation used to search by meaning rather than only by matching words. In an agent retrieval pipeline, a new query is converted to an embedding and compared with embeddings stored for existing records. This gives the agent a low-cost way to find candidates without asking a large language model to read every record. section 7.0 section 7.2
The embedding has a specific job in the retrieval pipeline:
- Preparation: represent the incoming query as a vector; stored records have already been represented when they enter the database. section 7.0 section 7.2
- Search: compare the query vector with stored vectors to produce a broad candidate set. Approximate nearest neighbor search is a common choice for dense retrieval. section 7.0 section 7.2
- Judgment: filter or re-rank candidates with a more expensive method. Vector similarity is useful for recall, but does not settle precise relevance. section 7.0 section 7.2
Searching historical insurance claims
For a new claim describing basement water damage from a pipe that burst during a freeze, an agent can search embeddings of historical claims and pull roughly 50 potentially related cases. A specialized evaluator then checks which cases are genuinely relevant in a legal or technical sense, rather than merely similar in vocabulary. section 7.0
A dense embedding is not the only search representation: sparse retrieval uses weighted keyword vectors, while a late-interaction model such as ColBERT uses a matrix of token vectors. The choice affects how the inexpensive first pass finds candidates; result processing remains a separate step. section 7.2
Figure 7.1 The AFD of the Retriever pattern. The input (a query) is first processed into a representation suitable for search. This representation is used to query a data storage, producing a set of candidate results. These candidates are optionally passed through a result-processing step (e.g., a re-ranker or filter) to improve the selection before being returned as the final output.

The retrieval flow shows where an embedding fits: represent the query, search stored data, then optionally filter or re-rank the candidates. section 7.2







































































