AI glossary

What is Vector database?

Also called vector store, vector DB, vector search engine ·

A vector database stores embeddings (numeric vectors that represent meaning) and finds the ones closest to a query vector very quickly, which makes it the usual retrieval layer for semantic search and retrieval-augmented generation (RAG).

How it works

You first convert content into embeddings with an embedding model and store each vector with its text and metadata (source, date, permissions). At query time the question is embedded with the same model, and the database returns the nearest vectors.

Comparing a query with every stored vector is exact but slow at scale, so vector databases use approximate nearest neighbour (ANN) indexes. The most common is HNSW, a layered graph that lets search hop quickly toward the closest points. Others, popularised by Meta's FAISS library, cluster or compress vectors. ANN trades a little accuracy for large gains in speed.

Most products also support metadata filters ("only documents from 2026") and hybrid search, which combines vector similarity with keyword matching.

Why it matters

  • It makes RAG practical. Retrieval-augmented generation needs to find the right few passages among millions in milliseconds.
  • Options range widely. Dedicated services and open-source engines exist, alongside vector features in databases you may already run. For a few thousand documents, the database you already have is often the simplest choice.
  • Retrieval quality is the real work. Chunk size, the embedding model, filters and re-ranking usually matter more than which vector database you pick.

Example

A legal team stores 2 million contract clauses as vectors in PostgreSQL with pgvector, tagged by client. A lawyer asks "Which supplier contracts allow termination for convenience?" The query is embedded, filtered to the right client, and the top 20 matching clauses are handed to an LLM to summarise with citations.

Questions people ask

What is a vector in a database?+

A vector is a list of numbers, produced by an embedding model, that represents the meaning of a piece of content. The database stores it alongside the original text or an ID so it can return the content when the vector matches.

Is the vector database outdated?+

No, but a separate vector database is not always needed. Many general databases, such as PostgreSQL with the pgvector extension, now handle vector search, and for small collections a simple index is enough.

Sources

  1. Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs, arXiv (Malkov and Yashunin, 2016)
  2. Billion-scale similarity search with GPUs, arXiv (Johnson, Douze and Jégou, 2017)

Back to the AI glossary