What is Vector Database?
A vector database stores embeddings and quickly finds the vectors most similar to a query, which makes it the search engine behind semantic search and most RAG systems.
Traditional databases find exact matches (“customer_id = 42”). Vector databases find nearest neighbours: the items whose meaning is closest to a query.
How it works
Vector databases use approximate nearest-neighbour (ANN) indexes such as HNSW to search millions of vectors in milliseconds. Most also store metadata (source, date, permissions) so you can filter results, e.g. “only documents this user can see, from the last year”.
Popular options
- pgvector: a vector extension for PostgreSQL. A great default if you already use Postgres.
- Qdrant, Weaviate, Milvus: open-source, dedicated vector databases.
- Pinecone: a fully managed vector database service.
- In-memory / NumPy: perfectly fine for prototypes with a few thousand chunks.
Do you need one?
Not always. For small document sets, a simple in-memory index works. Move to a vector database when you need scale, filtering, frequent updates or concurrent users.
Related terms
The Agent Brief
One practical email a week on AI agents, RAG and generative AI, for builders and business owners. No hype, no spam.