Skip to content
Vector Databases & RAG Pipelines

09.01 · Concept

Embeddings and Vector Search

Explain embedding vectors, similarity metrics, nearest neighbor search, recall, precision, and ranking in retrieval systems.

Embedding vectors turn text, images, audio, or code into points that can be compared by meaning rather than exact tokens. Vector search finds nearby stored items using similarity metrics and indexes, then balances recall, precision, ranking, latency, memory, and filtering so retrieval returns useful records for search or RAG.

What this lesson answers

  • what is an embedding vector in search
  • cosine similarity versus dot product for embeddings
  • recall versus precision in vector retrieval

Notes

Embeddings are numeric vectors that represent the meaning or features of data such as text, images, audio, or code. An embedding model maps similar items to nearby points in a high-dimensional space, so a question like “How do I reset my password?” should land close to documents about account recovery even if they do not use the exact same words. In data engineering systems, embeddings are often generated in batch or streaming pipelines, stored alongside record IDs and metadata, and indexed in a vector database.

Common questions

What is an embedding vector?
An embedding vector is a numeric representation of some input, such as text, code, audio, or an image. The embedding model is trained so that related inputs end up close together in vector space. That lets a system retrieve semantically related records even when the query and the stored document use different wording.
Why use approximate nearest neighbour search?
Exact search compares a query vector with every stored vector, which becomes expensive as the corpus grows. Approximate nearest neighbour indexes avoid checking everything, giving much faster lookup at the cost of occasionally missing a better match. The engineering trade-off is recall versus latency, memory, and compute.
How do ranking and precision affect RAG quality?
A RAG system depends on the records placed into its context window, not just on whether vector search found something nearby. Precision measures how much of the returned set is actually relevant, while ranking decides what appears first. Filtering and reranking are often needed to prefer authorised, current, and genuinely useful records.