Techniques & methods

Vector Database

A vector database is a data store purpose-built for storing high-dimensional numerical vectors and performing fast approximate nearest-neighbor (ANN) search across millions or billions of them, enabling semantic retrieval at scale.

Whereas a relational database indexes structured columns and a document store indexes field values, a vector database indexes floating-point vectors — the embeddings that represent text, images, or other data. Its primary query is not "find rows where field equals value" but "find the K vectors most similar to this query vector." This requires specialized index structures because brute-force comparison of every stored vector against a query is computationally prohibitive at scale.

Vector databases achieve fast search through approximate nearest-neighbor (ANN) algorithms. The most widely adopted is HNSW (Hierarchical Navigable Small Worlds), a graph-based index in which each node connects to nearby nodes; search navigates the graph greedily, sacrificing perfect correctness for orders-of-magnitude speed gains. Other approaches include IVF (Inverted File Index, which partitions the space into clusters and searches only relevant ones), ScaNN (Google's learned quantization variant), and product quantization, which compresses vectors to reduce memory footprint. Most production systems expose recall-latency trade-off parameters so operators can tune for their requirements.

Vector databases are the infrastructure backbone of retrieval-augmented generation pipelines, semantic search engines, and recommendation systems. Without efficient ANN search, RAG systems would be limited to a few hundred documents rather than millions. Hybrid queries that combine ANN similarity search with attribute filters — for example, restrict search to documents belonging to a specific tenant — are a critical feature for multi-tenant SaaS deployments, and all mature vector databases support this pattern.

The market has consolidated around specialized systems — Pinecone, Weaviate, Qdrant, and Milvus — alongside general-purpose databases that added vector capabilities, including PostgreSQL with pgvector, Redis, MongoDB Atlas, and Elasticsearch. All major cloud providers offer managed vector search services. A notable trend through 2025–2026 is the rise of disk-based vector indexes such as DiskANN that allow billion-scale search without loading all vectors into RAM, significantly reducing infrastructure costs for large deployments.

Example

A legal tech company stores embeddings of 50 million contract clauses in Qdrant; when a lawyer searches for 'indemnification clauses excluding consequential damages,' the ANN index returns the 20 most semantically similar clauses in under 100 milliseconds.

Related terms

Latest news on this topic

← Glossary