Skip to content
AI Glossary

Vector Database

A database built to store embeddings and find the nearest neighbours of a query vector quickly, using approximate nearest-neighbour indexes.

Definition

A vector database stores embeddings, usually alongside the original text and some metadata, and answers one question efficiently: which stored vectors are closest to this query vector? Comparing a query with every row works for thousands of items but not for millions, so these systems build an approximate nearest-neighbour (ANN) index such as HNSW (a layered graph) or IVF (clusters) that narrows the search dramatically.

The category includes dedicated products (Milvus, Qdrant, Weaviate, Pinecone) and extensions to existing databases (pgvector for PostgreSQL, vector support in Elasticsearch, OpenSearch and others). All of them combine similarity search with metadata filtering, which is how you restrict results to one customer, one language or one permission group.

Example: a legal team stores 400,000 contract clauses as vectors. A query for "early termination without penalty" returns the twenty most similar clauses in milliseconds, filtered to the client's own contracts.

A query vector enters the ANN index, which navigates a graph of stored vectors to return the top-k nearest neighbours with their metadata Query vector + filter: client = A ANN index (HNSW graph) walks the graph instead of scanning every row Top-k results #1 clause 8812 0.91 #2 clause 1204 0.88 #3 clause 3310 0.85 text + metadata returned
An ANN index finds near neighbours by walking a graph of vectors, which is why it stays fast at millions of rows.

What it means in practice

  • It is the retrieval engine behind RAG, semantic search and recommendations.
  • The wrong choice shows up later as slow queries, weak filtering or an extra system to operate and secure.
  • Keeping vectors next to your relational data (pgvector) simplifies permissions, backups and transactions.
  • Index settings trade recall against speed and memory; they need measuring on your data rather than left at defaults.

How Teksmobile uses it

We run a structured vector database selection before committing, and we build most knowledge bases on pgvector or Milvus. Both are part of our standard vector search practice, with managed options where the client prefers them.

Part of the Teksmobile AI Glossary. Compare products in our vector database comparison.

FAQ

Frequently asked questions

Do I need a dedicated vector database?

Often not. PostgreSQL with pgvector handles many workloads up to millions of vectors and keeps your data in one place. Dedicated systems such as Milvus, Qdrant, Weaviate or Pinecone earn their place at larger scale or with heavy filtering needs. Try our vector database chooser.

What does "approximate" mean in ANN search?

The index trades a small amount of recall for large speed gains. Instead of comparing the query with every stored vector, it explores a graph or clusters and returns results that are almost always the true nearest neighbours.

Can a vector database filter by metadata?

Yes, and this is essential in practice: restricting results by tenant, document type, date or permission. How well filtering combines with the index is one of the main selection criteria.

Talk to us about your AI project

Tell us what you are trying to do, which systems are involved and what is in the way. We reply within one business day with an opinion and a suggested next step.