Definition
A vector database is a data store purpose-built to hold embedding vectors — the high-dimensional numeric representations that capture the meaning of text, images, or other data — and to find the vectors most similar to a given query vector very quickly. Where a traditional database matches exact values or ranges, a vector database searches by geometric closeness, making it the backbone of semantic search and retrieval-augmented generation.
How it works
When you embed a document, you get a list of numbers (for example, 1,536 dimensions). A vector database stores millions of these and, given a query vector, returns the closest matches by a similarity metric such as cosine similarity or dot product. Doing this by brute force over millions of vectors would be slow, so vector databases rely on approximate nearest-neighbour (ANN) indexes.
ANN algorithms: HNSW and IVF
Two indexing approaches dominate:
- HNSW (Hierarchical Navigable Small World) builds a layered graph of vectors that can be traversed greedily, giving excellent recall and very low latency. It is the default in many engines.
- IVF (Inverted File Index) partitions the vector space into clusters and searches only the most promising clusters at query time, which scales well to huge datasets.
Both trade a small amount of exactness for a massive speed-up, which is almost always worthwhile in practice.
Major platforms
Popular vector databases include Pinecone and Weaviate (managed, developer-friendly services), Qdrant (open-source and self-hostable), and pgvector, an extension that brings vector search directly into PostgreSQL so you can keep vectors alongside relational data. Many traditional databases and search engines have also added vector support.
Why it matters
Vector databases are the retrieval layer of modern AI systems. In a retrieval-augmented generation (RAG) pipeline, documents are embedded, stored in the vector database, and the most relevant chunks are fetched at query time to ground an LLM’s answer in real source material. They also power semantic search, recommendations, deduplication, and clustering — anywhere meaning-based matching beats exact keyword matching.