A vector database, or vector db, is a specialized type of database that stores and processes data in vector form. In these databases, embeddings, which are vector representations of data, are utilized where linear distances capture structure in the original datasets. This allows teams to connect their data to large language models (LLMs), with common applications including chatbots that search across a company’s knowledge base or context to answer specific questions.
Build better agents with Arize
Trace, evaluate, and learn. Build agents that work with Arize AX and start tracing your runs today.
Prefer open source? Try Arize Phoenix for self-hosted, open source agent observability.
Key takeaways
- Vector databases store embedding vectors and run approximate nearest neighbor search at scale.
- Indexes (HNSW, IVF, etc.) trade recall, latency, and memory; tune on your query workload.
- Metadata filters (tenant, product, date) combine with vector search for secure multi-tenant RAG.
- Re-embed and reindex when encoder, chunking, or corpus policy changes; never mix embedding versions.
- Monitor query latency, recall@k on golden queries, index freshness, and embedding drift alongside LLM quality.
Core capabilities
Insert and upsert vectors with ids and metadata payloads (source url, title, acl).
Similarity search by query vector with top-k and optional filters.
Hybrid retrieval blending dense vectors with sparse keyword scores in some systems.
Replication and sharding for availability and large corpora.
Distance metrics must match training (cosine, inner product, L2) and normalization conventions.
Role in LLMOps and RAG
Chunk documents, embed with a chosen model, load into the vector db.
At query time, embed the question, retrieve neighbors, pass passages to the LLM prompt.
Update pipelines refresh changed docs; tombstone deleted content to avoid stale answers.
Version index builds with encoder name, chunk size, and corpus snapshot id.
Operational concerns
Memory footprint grows with dimension times vector count.
Cold start after large reindex; plan blue-green index cuts.
ACL metadata enforced at query time so tenants never see other embeddings.
Backup and restore tested; corrupted indexes produce silent retrieval misses.
Introductory RAG context in introduction to retrieval augmented generation links retrieval quality to vector store design.
Practical guidance in getting started with embeddings compares index types and hybrid patterns.
Agent tracing in agent evaluation logs query vectors, hit ids, and scores per request for debugging.
Failure modes
Query encoder updated without re-embedding corpus.
Missing normalization before cosine search.
Oversized chunks hurting precision; undersized chunks losing context.
No monitoring on empty search results or score collapse.
Multi-tenant isolation
Enforce metadata filters in integration tests so a missing filter cannot leak vectors across tenants in CI.
Compaction and deletes
Hard-delete vectors when documents are removed from source systems; soft TTL alone leaves stale answers in RAG paths.
Practitioner checklist
Before changing production settings, confirm labels, thresholds, and monitor windows match the definitions used in your last offline eval. Snapshot dashboards when incidents start so postmortems compare apples to apples.
Run slice-level reviews on high-traffic cohorts weekly even when global metrics look flat. Many failures appear first in one locale, product line, or prompt route.
Document model version, featurizer hash, and data window in every incident ticket. Future you needs that context to interpret drift charts.
When metrics disagree (offline vs online, precision vs recall), write down the business cost of each error type before picking a fix. Metrics are proxies; costs are the decision.
Share eval harness links in release notes so support and PM teams know which golden tasks must pass before they announce improvements.
Related concepts
Vector databases sit between embedding models and RAG generators. Monitor all three layers because failures in encoding, search, or generation look like the same wrong answer to users.
FAQ
Is a vector db the same as a traditional database?
Traditional SQL/NoSQL stores rows and keys; vector dbs optimize similarity search on high-dimensional vectors, often alongside metadata filters.
Do I need a vector db for small corpora?
Brute force in memory may suffice for thousands of vectors; vector dbs matter at scale and for ops features.
How do I choose HNSW versus IVF?
Benchmark recall@k and p95 latency on your hardware with representative queries; HNSW often favors low-latency online search.
How often should I reindex?
When corpus content, chunking, or embedding model changes materially; track retrieval metrics weekly.
Can one vector db serve multiple embedding models?
Use separate collections or namespaces per model version to avoid mixing incompatible vector spaces.