Skip to content

Glossary

Vector search

Vector search retrieves items by comparing numerical representations of their content or meaning.

Context engineering

Vector search represents queries and candidate items as vectors and ranks candidates by a chosen similarity or distance measure. Embedding models can place related phrases near one another even when they share few words. That makes semantic retrieval possible, but similarity is not identity, truth, or legal equivalence. A nearby passage may discuss a related entity, a different date, or a negated claim, and the numerical score alone does not resolve those differences.

Effective use requires choosing an embedding model, defining the indexed units, and testing retrieval on real information needs. Exact identifiers, names, and dates often deserve lexical or structured matching alongside semantic search. Access filters must apply before results reach a requester. Index refresh, model changes, and source deletion can change the candidate set, so a reproducible retrieval result needs more than the final similarity score.

Vector search helps find potentially relevant evidence in large collections, particularly when vocabulary differs between a question and a source. It is a candidate-generation method, not an adjudication rule. Reranking can order retrieved candidates more carefully, while grounding checks whether a selected passage supports an answer. Entity resolution and temporal interpretation remain separate obligations when the organization must defend a specific value.

Example

A search for a registration change finds a differently worded notice about Halden Therapeutics AG (fictional), then verifies its identifier and effective date before use.

Embeddings and approximate nearest neighbours

Vector search represents items as points in a high-dimensional space using an embedding model, and retrieves the items nearest to the query's point under a distance measure such as cosine similarity. In the dense retrieval approach of Karpukhin and colleagues, a trained encoder maps questions and passages into the same space so that a passage containing the answer lies close to the question, even when they share few words. Exact search over millions of vectors is slow, so practical systems use approximate nearest-neighbour methods. The HNSW algorithm organises vectors in a layered graph for fast search, and the FAISS library implements several index types, including GPU search over billions of vectors. The Wikipedia article on nearest neighbour search gives the general background.

Approximation has a cost: the index may fail to return a true nearest neighbour. Measure recall of the index against exact search on a sample, and tune the trade-off between speed and recall. Treat the numbers as part of the system's documented behaviour, since a missed passage is an invisible error.

What similarity does and does not capture

Embedding similarity measures topical and semantic closeness as learned by the model. It does not measure truth, currency or authority, and it does not reliably separate contradictory statements: a sentence and its negation may be very close in the space. Exact identifiers such as a registry number, a rare drug name or a clause number are often better found by lexical search, and many systems combine lexical and vector search and merge the results. ColBERT shows a middle path, matching individual tokens of the query and the passage in a late-interaction scheme to keep more detail than a single vector.

Because similarity ignores identity, vector search can retrieve passages about a different entity with a similar name; pair it with entity disambiguation and with metadata filters on entity, date and source. Embeddings also change with the model: when the embedding model is replaced, the whole index must be rebuilt, and results from old and new vectors must not be mixed. Record the model version with the index, as discussed in the article on RAG fault isolation.

A worked example

A search over contracts for Halden Therapeutics AG (fictional) is asked for clauses limiting liability. A vector search returns clauses on indemnity, insurance and limitation of liability, ranked by closeness, which is useful for exploration. The same search is asked for the clause numbered 14.3. The embedding places many clauses with similar numbering near the query, and the one required is eleventh. A lexical filter on the exact clause number returns it first. A third search, for the supplier named Halden Pharma GmbH, returns passages about Halden Therapeutics AG as nearer than the right entity because the names are similar; a filter on the entity identifier removes them. The combination of vector search, lexical match and metadata filters does what none does alone.

Checks a reviewer can run

Measure index recall against exact search. Test identifier lookups and negations. Test entity names that are similar. Confirm that the embedding model version is recorded and that the index is rebuilt on change. Check that access controls are applied to results, not only to the documents, since an index can leak snippets across permissions.

Related terms and boundaries

Vector search is the retrieval step of most retrieval-augmented generation systems, over units made by chunking and improved by reranking. It can generate candidates for entity resolution, where it plays the role that blocking plays in classical pipelines, and it must respect need-to-know access.

Common misreadings

  • Treating high similarity as proof of a claim.
  • Relying on embeddings alone for exact identifiers.
  • Letting access-restricted passages enter a visible result set.

Related terms

Appears in

Found an error on this page? See corrections for what counts as one, how to report it and the dated log.

Enquiry

Where does "Vector search" bear on a decision of yours?

This entry sits under context engineering. If a decision in your organization turns on it, send the entity concerned, the sources you fuse to describe it and who may read which of them. We reply with what a first record would cover.

Or write to [email protected] in your own words.