What happens when your chatbot confidently invents a refund policy that doesn’t exist? In most cases, the problem isn’t the language model. It’s the retrieval layer underneath it. That layer is usually a vector database, and picking the wrong one is one of the most common reasons a RAG (retrieval-augmented generation) system feels impressive in a demo and unreliable in production.
The uncomfortable truth is that there is no single “best” vector database for RAG. There are databases that fit certain constraints well and others that quietly create operational debt six months in. This guide walks through the real trade-offs, the candidates worth shortlisting, and the mistakes teams make when they choose based on benchmark charts instead of their own workload.
What a vector database actually does in a RAG pipeline
RAG was introduced in a 2020 paper by Lewis and colleagues, who paired a dense retriever with a generator so the model could ground its answers in external documents. The architecture has three moving parts: an embedding model that turns text into vectors, an index that finds similar vectors quickly, and a generator that writes the answer. The vector database owns the middle layer.
That middle layer does more than store arrays of floats. In production it has to handle filtering by tenant, metadata, or date; keep up with document updates and deletions; return results fast enough for a chat interface; and survive a node failure without losing the index. A plain similarity search library won’t do any of that for you.
The index most systems rely on
Almost every vector database on the market implements HNSW, the Hierarchical Navigable Small World graph method published by Malkov and Yashunin. HNSW builds a layered graph where each node links to nearby vectors, letting a query hop through the graph instead of scanning every record. It’s fast and accurate, and it’s the default in most engines for good reason.
The trade-off is memory. HNSW graphs live in RAM, so a large corpus with high-dimensional embeddings can get expensive quickly. That single fact drives many architecture decisions later on.
The shortlist: how the main options compare

The table below summarizes the candidates most teams end up evaluating. Treat it as a starting map, not a verdict. Feature details shift with every release, so confirm specifics against current documentation before committing.
| Option | Type | Best fit | Main trade-off |
|---|---|---|---|
| pgvector (PostgreSQL) | Extension | Teams already running Postgres | Scaling beyond a few million vectors takes tuning |
| Milvus | Dedicated, open source | Large-scale, self-hosted deployments | Heavier operational footprint |
| Qdrant | Dedicated, open source | Filtering-heavy workloads | Another service to run and monitor |
| Weaviate | Dedicated, open source | Teams wanting built-in hybrid search | More configuration surface |
| Chroma | Embedded, Python-first | Prototypes and small apps | Not built for large production scale |
| Managed cloud search | Fully managed | Teams without infrastructure staff | Cost and vendor lock-in |
pgvector: the pragmatic default
If a team already runs PostgreSQL, the pgvector extension is often the smartest first move. It adds vector column types and approximate nearest-neighbor indexes directly to Postgres, so embeddings sit next to the relational data they belong to. Filtering by customer ID, joining to a permissions table, and running a transaction all work the way they already do. (A clearer way to track cloud data transfer costs)
The appeal is operational simplicity. There’s no second datastore to back up, secure, and monitor. The catch is scale: HNSW indexes in Postgres consume memory, and very large collections need careful partitioning and index tuning. Still, for many internal RAG tools with a few hundred thousand chunks, it’s more than enough. Teams that go this route should also plan a proper recovery drill for a managed database, because restoring a Postgres instance with a large vector index is slower than restoring a plain relational one. (What is a vector database? (Pinecone Learn))
Milvus: built for scale, at a cost
Milvus is a dedicated vector database that originated at Zilliz and graduated from the LF AI & Data Foundation, which is a reasonable signal of neutral, multi-vendor governance rather than single-company control. It’s designed for very large collections and supports multiple index types beyond HNSW.
The honest downside is complexity. Milvus is a distributed system with several components, and running it well requires real infrastructure knowledge. For a team of two building an internal knowledge assistant, that’s usually overkill. For an organization indexing tens of millions of documents with strict latency targets, it’s a serious contender.
Qdrant and Weaviate: filtering and hybrid search
Qdrant, written in Rust, and Weaviate, written in Go, are both server-oriented open-source engines with strong metadata filtering. Filtering matters more than people expect. A pure nearest-neighbor search that ignores permissions is a security incident waiting to happen, and filtering after the search returns poor results when most candidates get discarded.
Weaviate also ships hybrid search that blends dense vectors with keyword scoring. That combination is worth understanding: BM25, the classic keyword ranking function, still outperforms pure embeddings on exact identifiers, product codes, and rare names. Most practitioners recommend hybrid retrieval over pure vector search for RAG, and engines that support it natively save a lot of plumbing.
Chroma: the prototype favorite
Chroma started as an embedded, Python-first store aimed squarely at prototyping. It’s genuinely pleasant to work with when you’re iterating on chunking strategies and prompt design. The mistake is assuming that convenience scales. Teams that start on Chroma and grow often migrate to a server-based engine once concurrency, persistence, and multi-tenant isolation become real requirements.
Managed cloud options
Every major cloud now offers a managed vector path: OpenSearch with k-NN on AWS, Vertex AI Vector Search on Google Cloud, and Azure AI Search with vector support. These make sense when there’s no infrastructure team, when data residency rules push you toward a specific provider, or when you’re already deep in that ecosystem. The cost is lock-in and pricing that can surprise you at scale, especially around data egress. It helps to understand how cloud data transfer costs accumulate before you assume a managed service is cheaper than self-hosting. (Separating tenant data in an enterprise assistant)
Why benchmarks mislead more than they help
ANN-Benchmarks, the academic project from Aumüller, Bernhardsson, and Faithfull, measures recall against queries per second on static datasets. It’s a rigorous piece of work and a useful sanity check. It also tells you almost nothing about your workload.
Real RAG traffic involves filtered queries, incremental updates, deletes, hybrid scoring, and bursts of concurrency. A database that wins on a static benchmark can lose badly once you add a tenant filter to every query. Vendor-published charts compound the problem because they tend to pick datasets and parameters that flatter their engine.
The practical answer is to build a small test setup with your own data. Take a few hundred real questions, generate embeddings with the model you’ll actually use, and measure recall at k=10 alongside p95 latency under realistic filtering. A day of this work beats a week of reading comparison posts.
Common mistakes when choosing a vector database
Choosing by benchmark instead of workload. The top of a leaderboard is not a recommendation. Start from your query patterns.
Ignoring filtering until later. If every query must be scoped to a tenant or user, test that path first. Tenant isolation in an enterprise assistant is an architectural decision, not a feature flag you add at the end.
Skipping the embedding model decision. The database stores whatever the embedding model produces. Switching models later means re-embedding the entire corpus, which is often the most expensive migration a RAG team ever runs. Pick the model deliberately and version it.
Underestimating memory. HNSW indexes live in RAM. A back-of-envelope calculation of vectors times dimensions times bytes per float, plus graph overhead, will save you from a painful bill.
Treating the vector store as a search engine. Vector search finds semantically similar text. It does not replace keyword search for exact matches, and it does not replace a reranker for precision.
What actually works in practice
Teams that ship reliable RAG systems tend to follow a similar path. They start with the simplest store that fits their existing stack, usually pgvector or Chroma, and validate retrieval quality with real queries before optimizing anything. They add a reranker once recall at k=20 is good but the top three results are mediocre. They implement hybrid search when users start complaining that exact product names return nothing useful.
They also keep the vector store behind an interface in their application code. That sounds like over-engineering until the day a migration is needed, at which point it’s the difference between a two-week project and a two-quarter one. The same discipline applies to cost tracking: teams that instrument query volume and storage growth early avoid the nasty surprise of a vector database bill that triples in a quarter.
Finally, they test failure. Delete a node. Restore a backup. Check whether the index rebuilds correctly and how long it takes. A vector database that loses its index on restart is not a database; it’s a cache with ambitions.
Conclusion
The best vector database for RAG is the one that fits your scale, your filtering needs, and your team’s operational capacity, not the one at the top of a benchmark chart. Start with what you already run: pgvector if you’re on Postgres, Chroma if you’re prototyping, Milvus or Qdrant if you need dedicated scale and filtering, and a managed cloud service if infrastructure isn’t your business. Then measure retrieval quality on your own data before you commit, because that’s the only benchmark that reflects how your system will actually behave when a user asks a question it has never seen before.
Frequently asked questions
Do I need a dedicated vector database for RAG?
No. Many production RAG systems run on PostgreSQL with the pgvector extension, and some run on a search engine that already supports vector fields. A dedicated database becomes worthwhile when you need very large collections, heavy filtering at scale, or independent scaling of the retrieval layer.
Is HNSW always the right index?
It’s the most common default because it balances speed and accuracy well. But it’s memory-hungry, and alternatives like IVF or product quantization can be better when RAM is the constraint. The right choice depends on your corpus size, latency target, and recall requirements.
How many vectors can pgvector handle?
It depends heavily on dimensionality, index type, and available memory rather than a fixed ceiling. Teams routinely run collections in the low millions of vectors on well-provisioned instances. Beyond that, partitioning and index tuning become essential, and a dedicated engine often makes more sense.
Should I use pure vector search or hybrid search?
Hybrid search, which combines dense embeddings with keyword scoring like BM25, is usually the safer choice for RAG. Pure vector search struggles with exact identifiers, product codes, and rare proper nouns. Most practitioners add hybrid retrieval once users start reporting misses on specific terms.
How do I evaluate a vector database before committing?
Build a small test set from your own documents and real user questions. Measure recall at k=10 and k=20, p95 latency with your actual filters applied, and behavior during updates and deletes. Vendor benchmarks rarely reflect filtered workloads with changing data, so measurements from your own setup are the more reliable signal.
What’s the biggest hidden cost in a vector database project?
Re-embedding the corpus. If you change embedding models, you must regenerate every vector, which can mean significant compute time and API spend. Choosing and versioning your embedding model carefully at the start avoids the most expensive migration in the stack.







