Vector database
A vector database stores embedding vectors and supports fast approximate-nearest-neighbour search at scale — answering 'find the K vectors most similar to this query vector' in milliseconds across millions or billions of vectors. Examples: Pinecone, Weaviate, Qdrant, Milvus, pgvector (Postgres extension), Chroma.
Exact nearest-neighbour is O(N) and infeasible at scale. Vector databases use approximate algorithms — HNSW (hierarchical navigable small world graphs) is the dominant choice — that trade a small recall loss for orders-of-magnitude speed improvement. The choice between dedicated vector databases and adding vector columns to existing operational databases is mostly an operational question: dedicated vector DBs are faster and more scalable; the operational simplicity of one database (pgvector in your existing Postgres) often wins for smaller corpora. The break-even is roughly 10M+ vectors; below that, pgvector or Mongo Atlas Vector Search usually suffice.
Related terms
- Embedding vector
An embedding vector is a numerical representation of a piece of content (text, image, audio) as a fixed-length vector — typically 384 to 3072 dimensions — produced by a neural network trained so that semantically similar inputs produce vectors close to each other in the embedding space.
- Semantic search
Semantic search retrieves documents based on meaning rather than keyword overlap — using embedding vectors and similarity scoring to match queries to documents that express the same concept in different words.
- Retrieval-augmented generation (RAG)
Retrieval-augmented generation is the pattern where an LLM is given relevant context retrieved from an external source — typically via semantic search over a vector database — before generating its response.