Skip to main content

Vector Search

Vector search retrieves items whose embeddings are nearest a query vector, enabling semantic retrieval that powers RAG and recommendation.

Vector search, also called similarity or nearest-neighbor search, retrieves the data items whose embedding vectors are closest to a query vector. Instead of matching exact terms, it matches meaning, returning results that are semantically related even when they share no keywords with the query.

How It Works

Content is converted into embeddings and stored in an index. At query time the query is embedded the same way, and the system computes similarity, commonly cosine similarity or dot product, between the query vector and stored vectors. Exact search compares against every vector, which is slow at scale, so production systems use approximate nearest neighbor (ANN) algorithms such as HNSW or IVF that trade a small amount of accuracy for large speed gains. Vector databases and many traditional databases now provide these indexes.

Why It Matters

Vector search is the retrieval engine behind semantic search, recommendation, deduplication, and retrieval-augmented generation. It lets applications surface relevant documents, products, or passages based on intent, improving recall over keyword-only systems. Hybrid approaches combine vector search with keyword search to capture both meaning and exact matches.

Related Terms

Vector search operates over embedding vectors and supplies relevant context to retrieval-augmented-generation so an large-language-model can answer grounded in that data.