Services

Resources

Company

Vector database

A vector database is a data store built to save embeddings, which are lists of numbers that represent meaning, and to find the stored vectors closest to a query vector. Retrieval-augmented generation (RAG) apps use it to find text chunks that match a question by meaning rather than by exact keywords. It is also called a vector store.

How it works

Each record holds a vector, the source text and metadata. Comparing a query with every vector is exact but slow, so vector databases build approximate nearest neighbor (ANN) indexes such as HNSW or IVF. These return the top matches in milliseconds at the cost of a small loss in recall. Sizing is predictable: 1 million chunks with 1,536-dimension float32 embeddings take about 6.1 GB (1,000,000 × 1,536 × 4 bytes) before index overhead. The store can be a dedicated system or an extension such as pgvector on PostgreSQL.

Why it matters in production

Vector search is a step on the critical path of every RAG request, so its latency and recall shape answer speed and quality. Index build time, memory use and re-embedding after a model change all need planning.

See also

On the One2N blog

References

  1. pgvector: open-source vector similarity search for Postgres

  2. Approximate nearest neighbor search with HNSW graphs (Malkov and Yashunin, 2016)

Four-panel comic explaining Vector database. A vector database stores embeddings and finds the vectors closest to a query vector, which is how RAG apps look up text by meaning.