Skip to content
agentscamp
Term · Term

Vector Database

A vector database stores embeddings and answers nearest-neighbor queries fast — the retrieval layer under RAG and semantic search, using ANN indexes like HNSW.

Updated Jun 11, 2026
vector-databaseembeddingsragsearchhnsw

A vector database stores embeddings and answers the query "which stored vectors are closest to this one?" fast enough for production — the retrieval layer beneath RAG and semantic search.

The hard problem it solves is scale. Exact nearest-neighbor search means comparing the query against every vector — fine at ten thousand, hopeless at a hundred million. Vector databases use approximate nearest neighbor (ANN) indexes, dominated by HNSW graphs, to get sub-millisecond lookups at a small, tunable recall cost. Around that core they layer the production necessities: metadata filtering ("only docs from this tenant"), hybrid keyword+vector search, quantization to shrink memory, and replication.

The market splits three ways: Postgres-native (pgvector) riding your existing database, open-source engines (Qdrant, Weaviate, Milvus, Chroma, LanceDB), and managed services (Pinecone). The honest decision guide — including when plain pgvector is the right answer — is Best Vector Database in 2026; tuning the index you pick is the embedding-index-tuner skill's job.

Frequently asked questions

Do I need a dedicated vector database?
Not always. pgvector adds vector search to the Postgres you already run, and at small-to-medium scale it's often the pragmatic choice. Dedicated engines (Qdrant, Pinecone, Weaviate, Milvus) earn their place with scale, filtering performance, hybrid search, and operational features — the decision tree is in our vector database guide.
What is HNSW?
Hierarchical Navigable Small World — the dominant approximate-nearest-neighbor index. It builds a layered graph over vectors so queries hop toward neighbors in logarithmic time instead of scanning everything, trading a little recall for orders-of-magnitude speed. Its parameters (M, efConstruction, efSearch) are the main tuning knobs.

Related