Berk Bayri

Vector database

A database built to store vector embeddings and quickly find the ones closest in meaning to a query. It is the usual retrieval layer behind RAG systems and semantic search.

A vector database stores vector embeddings, the lists of numbers that represent the meaning of a piece of text or an image, and answers one kind of question fast: which stored items are closest to this one? A query is embedded the same way, and the database returns the nearest neighbors, usually using approximate search methods so it stays fast across millions of entries.

This is the retrieval step in most RAG systems. A user asks about parental leave in Germany, the question is embedded, the database returns the policy passages closest in meaning and those passages are placed in the model's context window.

Dedicated products exist, but many teams now use vector search features inside databases they already run, such as Postgres with the pgvector extension. That choice is often about operations and access control more than raw speed.

Where projects go wrong

Similarity is not relevance. A search for "termination for convenience" can return passages about termination for cause because the wording is close. Exact identifiers such as product codes, names and dates are also handled poorly by embeddings alone, which is why many systems combine vector search with keyword search.

The database is rarely the hard part. Most poor retrieval results trace back to how documents were split into chunks, missing metadata, stale content or permission rules that were never carried over. If a user cannot open a document in the source system, the retrieval layer should not hand it to the model either.