← back to the archiveCover illustration for “Vector database: storage built for similarity search”
TERM8mo ago·Published · Updated ·by Andy Padia

Vector database: storage built for similarity search

In short: A vector database stores embeddings and returns the ones nearest to a query, and for many teams the vector support in a database they already run is enough.

A vector database is a data store built to hold embeddings with their metadata and to return the vectors most similar to a query vector. To stay fast on large collections it uses approximate nearest-neighbour indexes such as HNSW, published in March 2016, and it usually adds metadata filtering. Dedicated products exist, and general databases offer vector extensions such as pgvector for Postgres.

Vector database in plain words

A library shelved by meaning instead of title. Ask for "books like this one" and the librarian walks straight to the right aisle.

How it works

You insert records with an ID, a vector and metadata such as source, date or permissions. The database builds an index, and queries return the top-k nearest vectors with similarity scores, optionally filtered by metadata.

The index is a trade. The pgvector README, read in November 2026, says exact search is the default and gives perfect recall, while adding an approximate index trades some recall for speed. It also warns that with approximate indexes, filtering is applied after the index is scanned, so a filtered query can return fewer rows than you asked for.

Example

With Postgres and pgvector:

CREATE TABLE chunks (id bigserial, doc_id int, body text, embedding vector(1024));
CREATE INDEX ON chunks USING hnsw (embedding vector_cosine_ops);
SELECT body FROM chunks
ORDER BY embedding <=> $1
LIMIT 5;

Where you'll meet it

  • Dedicated products such as Pinecone, Weaviate, Qdrant and Milvus
  • Vector extensions in Postgres, Elasticsearch, OpenSearch, MongoDB and Redis
  • RAG stacks and AI search features
  • Database documentation on index types such as HNSW and IVFFlat

What it changes for you

For most teams, the first question is whether your existing database's vector support is enough, because one fewer system is a real saving. For platform teams, a dedicated vector database is worth evaluating when scale or latency targets outgrow that. For security, filter by permissions at query time so retrieval never returns documents a user cannot see.

Vector database vs search engine

A search engine ranks by keywords and relevance signals. A vector database ranks by embedding similarity. Many systems combine the two, which is called hybrid search.

Common mistake

My view: choosing the vector database before testing retrieval quality. The database rarely decides whether answers are right; chunking, embedding model and reranking do. Prototype on what you already run.

Embeddings · Vector search · HNSW · Hybrid search · Retrieval-augmented generation

From the archive: Why your RAG pipeline returns irrelevant results

Test retrieval quality on the database you already run before you choose a new one.

#field-guide#retrieval#vector-search#databases#rag

Sources

  1. github.com/pgvector/pgvector
  2. arxiv.org/abs/1603.09320
← older drop
Tokens per second: how fast an AI model writes
newer drop →
Vector search: finding results by meaning, not keywords

related drops

explore all 557 drops →
← back to the archiveday 175