Curiosity · Concept

Vector Database

A vector database stores embeddings — dense numerical vectors that represent the meaning of text, images, or audio — and lets you retrieve the closest ones to a query vector in milliseconds. Under the hood they use ANN indexes like HNSW, IVF, or ScaNN to avoid a brute-force scan over millions of vectors. Popular options include Pinecone, Weaviate, Qdrant, Milvus, Chroma, and pgvector; most also bolt on metadata filtering, hybrid search, and multi-tenancy.

Quick reference

Proficiency
Beginner
Also known as
vector store, vector DB, embedding database
Prerequisites
embeddings, cosine similarity

Frequently asked questions

What is a vector database?

A vector database is a specialized store that indexes high-dimensional embeddings and serves fast approximate nearest-neighbor (ANN) search. Given a query vector, it returns the top-k most similar vectors (and attached metadata) in milliseconds.

Do I need a dedicated vector DB, or can I use Postgres?

For small corpora (well under a million vectors) pgvector or SQLite-based stores like Chroma work fine. Dedicated services (Pinecone, Weaviate, Qdrant, Milvus) pay off at higher scale, with stricter latency SLAs, or when you need managed sharding and replication.

What indexes are used inside a vector DB?

HNSW (graph-based, default for most systems), IVF (inverted-file partitioning, often with product quantization), and ScaNN. They trade recall, query latency, memory, and build time differently — no single index dominates.

How does hybrid search fit in?

Modern vector DBs combine dense vector search with sparse keyword (BM25) scoring, then fuse the rankings. This catches both semantically similar passages and exact-keyword matches (names, IDs, code).

Sources

  1. Malkov & Yashunin — Efficient and robust approximate nearest neighbor search using HNSW — accessed 2026-04-20
  2. Pinecone — What is a vector database? — accessed 2026-04-20