Vector database

A store built for finding the nearest vectors to a query vector quickly, across millions of items.

Comparing a query against every stored embedding works fine for a few thousand documents and becomes too slow beyond that. A vector database uses approximate nearest-neighbour indexes to return the closest matches in milliseconds, trading a small amount of recall for a large amount of speed.

Dedicated options include Qdrant, Weaviate, Milvus and Pinecone. Extensions such as pgvector for PostgreSQL and vector types in Elasticsearch and Redis add the same capability to a database you already run, which is usually the better starting point.

Most production systems combine vector search with keyword search, because exact terms - error codes, product SKUs, names - are exactly what embeddings handle worst.

Tagged

Where this comes up

Prompts, configs and tutorials in the library that touch this term.