Skip to content
IT glossary
Data and MLUpdated December 3, 2026

Vector database

Векторная база данных

A database that stores numerical representations of things like documents and images and finds the ones most similar to a query. It can find a relevant document even when it shares no keywords with the query.

Also known as: Qdrant, pgvector

What a vector database does

Say someone searches a help center for “I want my money back.” The best article might be titled “Subscription refunds.” A vector database can find that article by comparing numerical representations of the query and the article, rather than looking for shared words. Those representations are called embeddings. An embedding model produces them; the database stores them and finds nearby vectors. A record also typically has an ID and metadata, such as the article's language or product category.

How similarity search works

The application embeds the query in the same vector space as the stored items and asks for the top k matches. A metric defines what counts as close: cosine similarity compares direction, Euclidean distance measures the gap between points, and dot product is affected by both direction and magnitude. Use a metric suited to the embedding model, and make sure the query and index use the same metric.

An exact search scores every eligible vector. That can be a good starting point, especially when a filter leaves only a small set of candidates. At larger scale, an approximate nearest-neighbor (ANN) index can reduce the amount of work. For example, HNSW organizes vectors into a layered graph and follows promising links rather than comparing every vector. Searching more of the graph can recover more true neighbors, but it also takes more time.

Example: retrieval with a filter

Suppose the help center needs to return five English-language articles. The search request includes both the query vector and a language filter. If a system instead gets the five closest articles overall and drops non-English results afterward, it can return fewer than five even when plenty of English articles exist. Check how your database combines filtering and ANN, and benchmark with realistic filters rather than relying only on unfiltered results.

Where it fits

Vector search is used for semantic search, similar-image lookup, recommendations, and retrieval-augmented generation (RAG). In RAG, the retrieved passages become context for the language model; the database doesn't write the answer. Vector search can also complement keyword search: embeddings help with paraphrases, while keyword search is often better for exact identifiers such as error codes. Qdrant is a dedicated vector database. pgvector is a PostgreSQL extension that adds a vector type, comparison operators, and vector indexes, so you can search embeddings alongside relational data.

What interviewers look for

Start with the workload rather than the index name: how many vectors are there, how often do they change, and which metadata filters are common? Use exact search as a baseline and compare it with ANN on p95 latency and recall@k, the fraction of exact top-k neighbors recovered by ANN. Then evaluate relevance separately. An index can reproduce the exact ranking and still surface unhelpful results if the embeddings don't represent what users mean.