There is no single best vector database. AIMultiple benchmarked seven open-source engines as the retrieval layer of a RAG pipeline, with identical bge-m3 embeddings and every engine tuned to the same Recall@10 of 0.95. Retrieval quality tied: nDCG@10 varied by only 0.014 across the set. What separated the engines was everything else. Single-thread throughput spanned 10x and peak memory spanned 3.7x at 2.25 million vectors. The best open source vector database for your team is the one whose throughput, memory, filtering, hybrid search and operating burden fit your workload, and you only find it by measuring the candidates on your own embeddings at matched recall.
The workload questions to answer before looking at any engine are these: how selective your metadata filters are, how often the corpus changes, how large it will grow and who will run the cluster. The rest of this comparison works through each of those. Our AI in cloud overview covers the cloud platform layer that retrieval runs inside.
What Are the Leading Open-Source Vector Databases for AI Workloads, and How Do They Compare?
The leading open-source engines differ far more on speed, memory, filtered throughput and write handling than on accuracy. The table below takes its figures from the AIMultiple benchmark, which ran Qdrant v1.18.1, Milvus v2.6.0, Weaviate 1.38.0, pgvector 0.8.x on Postgres 17, Chroma 1.5.0, Redis 8.2 and LanceDB 0.34.0 from pinned Docker images. All throughput figures are at the matched Recall@10 of 0.95.
Engine Comparison at Matched Recall
| Engine | Where it measured well | Where it measured weakly | Workload it suits |
|---|---|---|---|
| Redis | Highest single-thread throughput (764 QPS), lowest memory (559 MB at 50k), about 1.6 ms single-query latency with persistence off | Lowest filtered recall floor in the set (0.968); 44-minute index build at 2.25M vectors | Latency-sensitive, low-concurrency RAG |
| Qdrant | 377 QPS single-thread; largest hybrid-search lift (+0.067 nDCG, native); Recall@10 of 0.999 at 2.25M | None reported in this benchmark | Hybrid dense plus keyword retrieval |
| Milvus | 5,063 QPS multi-worker; 0.984 filtered recall at up to 732 filtered QPS; leanest at scale (17.0 GB at 2.25M, index offloaded to disk); 8-minute scale build; 149 writes/s under churn | Heaviest at 50k vectors (3,300 MB) | Filtered or multi-tenant RAG, large corpora, frequent updates |
| Weaviate | Highest multi-worker throughput (8,330 QPS); 1.00 filtered recall | Weaker BM25 arm (0.782), so a smaller hybrid lift | High-concurrency serving |
| pgvector | 257 QPS dense; 4,832 QPS multi-worker; full recall under filters | 10 to 56 filtered QPS; slowest build (88 s at 50k, 92 min at 2.25M); client-side hybrid at 12 QPS | Teams already running Postgres |
| Chroma | 197 QPS single-thread | 11 to 19 filtered QPS; heaviest at scale (62.4 GB at 2.25M); 12 writes/s under churn | Prototyping and small to medium collections |
| LanceDB | Fastest builds (7 s at 50k, about 7 minutes at 2.25M, €0.04 per million vectors) | 70 QPS single-thread; 2.6 writes/s under churn | Batch-built corpora that rarely change |
Chroma’s own documentation places its single-node mode at small to medium workloads, typically fewer than 10 million records, with a separate distributed mode for large production use. Pinecone, a managed option, is a proprietary closed-source service and was not among the seven engines benchmarked. Licensing matters for Milvus in particular, and our answer to is Milvus open source covers its licence and governance.
These numbers come from one benchmark, one embedding model and one hardware setup, so read them as the shape of each engine’s trade-offs rather than a ranking that will hold for your data. A separate study on HPC systems found that Weaviate, Qdrant and Milvus reached different recall even with identical index parameters: on a 10M-vector Yandex text-to-image subset, Recall@10 was 0.738, 0.837 and 0.876 respectively. Matching index parameters therefore does not match accuracy, which is one more reason comparisons at a fixed setting mislead.
Which Is the Best Vector Database for RAG?
For RAG, the database decided speed and memory much more than answer quality in this benchmark. In the AIMultiple benchmark, the database’s approximation cost at most 0.023 nDCG points against an exact-search oracle. When the corpus grew 45-fold to 2.25 million vectors, nDCG@10 fell from about 0.81 to about 0.56 for every engine and for the exact oracle as well. Over the same growth, every index still reported Recall@10 above 0.973. That ceiling is shared by every engine and the exact oracle, so the RAG choice comes down to your secondary needs: Milvus for filtered or multi-tenant retrieval, Qdrant or Milvus for native hybrid search, Redis for the lowest latency, and pgvector if you are already on Postgres. How retrieval latency then feeds into generation is covered in our piece on vector databases for LLMs and retrieval latency as a GPU bottleneck.
What Index Types Does Each Engine Use, and How Do HNSW, IVF and DiskANN-Style Indexes Trade Recall Against Memory?
HNSW is the dominant index across these engines. It is a layered proximity graph whose search knob (ef) sets how many candidates are visited, so a larger ef raises recall and lowers QPS. pgvector documents the trade-offs plainly. HNSW has a better speed-recall trade-off than IVFFlat but builds more slowly and uses more memory. IVFFlat splits vectors into lists and searches the ones closest to the query, which gives faster builds and less memory at a lower speed-recall trade-off. Because IVFFlat has a training step, it needs data in the table before it can be built, while HNSW does not.
For HNSW, a higher ef_construction improves recall at the cost of build time and insert speed, and a higher ef_search improves recall at the cost of query speed. For IVFFlat, more probes gives better recall and slower queries. More on how partition-based search prunes the space is in our explainer on the inverted file index (IVF).
DiskANN-style indexes keep the index on disk rather than in RAM, and the AIMultiple results show what that does at scale. Milvus’s architecture offloads its index to disk and went from the heaviest engine at 50k vectors to the leanest at 2.25M, while the all-RAM HNSW engines grew fastest. Engines also tune a recall knob beyond the standard HNSW parameters: segmentation. Qdrant and Milvus split each shard into segments with their own HNSW graphs and merge the results, while Weaviate keeps one HNSW graph per shard. In one follow-up test, moving Qdrant from 1 to 8 segments raised recall from 0.962 to 0.9854 but increased total search time from 4.19 s to 22.65 s.
Worked Example: Raw Memory for 1 Million 1,024-Dimensional Embeddings
pgvector stores each single-precision vector in 4 × dimensions + 8 bytes, and each half-precision vector in 2 × dimensions + 8 bytes. For a 1,024-dimensional embedding (the size bge-m3 produces in the AIMultiple setup), the working is:
- float32: 4 × 1,024 + 8 = 4,104 bytes per vector, or about 4.1 GB per million vectors before any index.
- halfvec: 2 × 1,024 + 8 = 2,056 bytes per vector, or about 2.06 GB per million.
AIMultiple measured 7.5 GB to 27.7 GB of peak RAM per million vectors for the in-memory engines at 2.25M. Set against the 4.1 GB of raw float32 data, that is roughly 1.8x to 6.8x. Half precision, binary quantisation with re-ranking, and disk-resident indexes are the levers that bring this down.
How Does Metadata Filtering Break Approximate Nearest Neighbour Search?
Filtering breaks ANN search because the index is built to find the nearest vectors, not the nearest vectors that also pass your predicate. The key variable is selectivity, meaning the fraction of indexed items that satisfy the filter. When most items pass, post-filtering works: you run a normal vector search and discard results that fail. When very few pass, pre-filtering works: you select the valid subset first and search it exactly. Between those extremes there is a wide middle band. There the valid set is too small for post-filtering to find enough results without a huge scan, and too large for brute force to be fast.
Graph indexes have their own failure on top of that. HNSW searches the query’s immediate neighbourhood first. If almost nothing in that neighbourhood satisfies the filter, the search cannot find enough qualifying points and latency climbs. Correlation makes this worse. A query that pairs a vector with unusual metadata, such as “deep learning” papers from before 1980, forces traversal through distant, dissimilar parts of the graph. HNSW’s pruning also ignores metadata, so it can remove the edges a filtered search would need to reach valid nodes.
The two generic strategies fail in different ways. Under pre-filtering, a restrictive filter thins out the true neighbours, including those around the query. Under post-filtering, the candidate pool shrinks after the scan and the result set is cut short if too few candidates pass. In a standard HNSW implementation, filtered-out nodes compete with valid ones for slots in a single priority queue. When 90% of the data is filtered out, the search beam fills with invalid nodes and recall drops sharply.
The usual ranking of indexes can even reverse. An academic study of filtering inside FAISS, Milvus and pgvector found that IVFFlat often beats HNSW at low selectivity because of cluster pruning. It recommends considering IVFFlat when expected selectivity is about 5% or below, and HNSW at about 20% and above or for mostly unfiltered queries.
How Do the Engines Differ on Filtered and Hybrid Search?
Under metadata filters, worst-case Recall@10 across the AIMultiple engines stayed between 0.968 and 1.00, but filtered throughput differed by 20 to 40 times. Hybrid search lifted nDCG@10 by 0.030 to 0.067, with smaller gains where an engine’s keyword arm was weak.
Filtered Search: Each Engine Uses a Different Strategy
Each engine combines predicates with vector similarity in its own way. Qdrant keeps separate metadata indices (hash maps for keywords, B-trees for numeric ranges) and uses them to build a bitset that masks the vector search. Weaviate looks up an inverted index to get an allow-list of object IDs, then applies it while exploring the HNSW graph. Milvus mainly pre-filters. It keeps valid and invalid nodes in separate queues (a “Dual-Pool” traversal), and when more than 93% of vectors are filtered out it skips the index and runs a brute-force scan that guarantees full recall. pgvector post-filters after the index scan, and the same study found its cost-based optimiser often picks an approximate index scan even when an exact sequential scan would give perfect recall at similar latency. Pinecone says it uses a custom graph index with filtering built in, but its implementation is not public.
AIMultiple tested selectivities of 1%, 5%, 20% and 50%, with both scattered and clustered predicates. Chroma and pgvector held recall but ran 20 to 40 times slower than the rest under filters. The filtering study points the same way: robust engines such as Milvus set a latency floor and will not return fast, low-quality results. If your tenant or permission filters regularly go below 1% selectivity, or correlate negatively with the query, those are the cases to test yourself.
Hybrid Search: BM25 Plus Dense Vectors, and What Fusion Costs
Hybrid search runs a dense search and a sparse keyword search (usually BM25) on the same query and merges the two ranked lists. AIMultiple fused the two arms through reciprocal rank fusion (RRF, k=60), and pgvector and Weaviate gained least because their keyword arms were weaker. Qdrant reports that default RRF beat the stronger single retriever on four of five public datasets.
RRF uses only each document’s rank, so it can combine a cosine score and a BM25 score without comparing their scales. Distribution-based score fusion keeps the size of the score gaps, so a strong lead from one retriever can carry through. Weaviate offers rankedFusion, which was its default up to v1.23, and relativeScoreFusion, which rescales each search’s scores to a 0-to-1 range before summing.
Hybrid search also adds storage, indexing and query work. In Qdrant’s own test on one container, adding a BM25 retriever raised median query latency by 0.60 to 1.47 ms, on top of an extra sparse vector and a second index per point. Milvus ran the fastest native fusion at 340 QPS, while pgvector’s hybrid search, assembled client-side from Postgres full-text search, reached 12 QPS.
Do I Need a Dedicated Vector Database, or Is Pgvector in Postgres Enough?
pgvector suits teams already running Postgres whose main need is dense search. It becomes the constraint when filtered throughput, hybrid search or index build time is the bottleneck. pgvector’s advantages are real. You keep ACID compliance, point-in-time recovery, JOINs and the rest of Postgres, and the vectors live next to the data they describe without a migration. The academic literature describes this as a split between native systems built for vectors and extended systems that add vector capabilities to an existing database. Our piece on data infrastructure for ML covers where a vector store sits among the other data stores.
In the AIMultiple run, pgvector served dense RAG at 257 QPS with full recall under filters. It also had the slowest builds of the seven, filtered throughput of 10 to 56 QPS and client-side hybrid search at 12 QPS. pgvector’s optimiser also often fails to switch to sequential or attribute-index scans that would give perfect recall at competitive latency. For multi-tenant applications, pgvector’s own guidance is that a shared approximate index lets one tenant’s vectors affect recall and speed for others, so isolation needs list partitioning or separate tables.
We would stay on pgvector while the workload is mostly dense search with permissive filters. Move to a dedicated engine when a measured requirement (filtered QPS, native hybrid search, or re-index time that blocks content freshness) is missed by a margin that tuning HNSW parameters and quantisation cannot close. If the question is broader, about key-value against document stores, see choosing between key-value and document databases for AI workloads.
Self-Hosted or Managed Vector Database: What Does Each Cost to Run in the Cloud?
Running your own cluster hands the operational responsibility to your team, whereas a managed service charges according to usage. Which is cheaper depends on scale, predictability and how much operational responsibility your team can take on. Our page on AI infrastructure and production SaaS covers how we help teams run retrieval and serving layers in production.
On the managed side, Pinecone’s serverless pricing meters storage per GB, read units, write units and egress. A query costs 1 read unit per GB of namespace size, with a minimum of 0.25, so the same query against a 10 GB namespace costs 10 read units. Paid plans carry monthly minimums of $20 (Builder), $50 (Standard) and $500 (Enterprise). Upserts cost 1 write unit per KB with a minimum of 5, plus the size of any record being overwritten. Actian notes that changing embedding models also adds write units during migration, on top of the embedding cost.
Actian, a vendor, puts the point where self-hosting becomes materially cheaper at 60 to 100 million queries per month. It suggests re-evaluating deployment options once monthly vector database spend passes $1,500, and modelling the cost of owned infrastructure once query volume passes 50 million a month. Actian also argues that embeddings, reranking, backups, re-indexing and egress can double real production spend compared with headline pricing.
Self-Hosting: What Sharding, Replication and Multi-Tenancy Cost
- Sharding and replication. These solve different problems. Weaviate describes sharding as the fix when memory runs out before throughput does, and replication as the fix for concurrent query load and zero-downtime maintenance. The replication modes behind high availability are covered in our piece on asynchronous versus synchronous replication for AI data serving.
- Scaling returns. More hardware does not reliably buy more throughput. The HPC study measured up to 30.67% lower query throughput from adding cores, and only a 5.46x improvement from 16x more workers. It also measured 2.8x write amplification in Milvus.
- Multi-tenancy limits. Milvus offers four tenancy models. Database-level allows 64 tenants by default, collection-level up to 65,536 per cluster, and partition-level 1,024 per collection. Partition-key-level supports millions of tenants but gives weaker isolation. Qdrant advises against a collection per tenant and recommends payload-filter partitioning for many small tenants, with dedicated shards for large ones. It suggests promoting a tenant to its own shard at about 20,000 points and creating no more than a thousand dedicated shards per cluster. With payload partitioning, BM25 statistics are shared across tenants unless they are scoped with the idf parameter (available from v1.19.0).
- Backup and upgrades. pgvector inherits Postgres point-in-time recovery.
How Should I Benchmark Candidate Engines on My Own Embeddings?
Benchmark vector databases at matched recall, on your own embeddings, queries and filters, on the hardware you will deploy to. Published QPS figures are only comparable at matched recall on the same machine. This follows a position we hold generally: best practice only makes sense in context, and context comes from profiling, not blog posts.
A Benchmarking Procedure for Vector Database Selection
- Use current embeddings from your own model. The VIBE authors argue that classic ANN benchmark datasets no longer represent modern embedding workloads such as RAG. Recall varies with embedding geometry as well: GIST needed a more intensive search than dbpedia-openai to reach 0.95 recall.
- Build two ground truths. Exact kNN over your vectors measures what the index costs you (geometric recall). Labelled queries scored with nDCG@10 measure whether answers are relevant.
- Sweep the search knob and compare at one recall level. Draw each engine’s recall-versus-QPS curve and read every engine at the same recall. Comparing engines at one fixed setting rewards whichever gives up the most accuracy.
- Replay your real filter distribution. Cover the selectivity range and correlation your queries actually have, since global selectivity drives plan choice and poorly correlated filters lose recall.
- Run reads and writes together and watch P99. Concurrent insertion raised P99 latency by averages of 280% and 345% on the HPC study’s two datasets, far more than it moved average latency.
- Grow the corpus to its projected size. Answer quality can drop while index recall stays near perfect, and a benchmark that only checks geometry will miss it.
- Time the build and re-index. At 2.25M vectors, builds ranged from 7 minutes to 92 minutes across engines, which sets how long a full re-index will take you.
- Test the core count you plan to buy. Adding cores degraded query throughput in some configurations.
For tooling, VectorDBBench provides repeatable insertion, vector search, filtered search and full-text workloads. It supports Milvus, Qdrant, Weaviate, pgvector, Chroma, Redis, Pinecone and others, and is built to test custom scenarios. It uses default server-side configurations for the system under test. For HPC clusters, the VECHINI framework was released for the same purpose. Qdrant’s benchmark page, for example, concludes that Qdrant leads in almost all scenarios. Its method is still sound: same machine, relative comparison, results compared only at equal precision.
What Does a Migration Between Vector Databases Involve?
Moving vectors is the easy part of a migration. The harder work is re-creating the behaviour around them. You export vectors and metadata and rebuild the index with parameters re-tuned for the new engine, because identical parameters do not give identical recall. Filter logic has to be re-validated, because each engine filters differently (bitset masks, allow-lists, pre-filtering with brute-force fallback, post-filtering) and recall under a restrictive filter will change. Hybrid ranking has to be re-checked if the fusion method changes, for example from RRF to relativeScoreFusion. Tenancy usually has to be redesigned, because a Milvus partition-key layout and a Qdrant tiered-shard layout are different models. Run the new engine on shadow reads against the evaluation set before switching any traffic.
How Much Does Migrating Between Vector Databases Actually Cost?
The cost depends on whether the embedding model changes with the engine. If it stays the same, the main compute cost is the index rebuild, which AIMultiple normalised to between €0.04 and €0.58 per million vectors. If the model changes, every document has to be re-embedded. Actian, a vendor, estimates $8,000 to $15,000 in embedding costs alone for a 100-million-vector dataset. A managed target adds write units for the bulk load, and a self-hosted target adds storage overhead from write amplification.
Avoiding Lock-in at the Retrieval Layer
Lock-in at the retrieval layer is mostly self-inflicted, and three habits keep it cheap to escape:
- Keep the raw text, metadata and model-versioned embeddings in your own store, not only inside the vector engine.
- Express filters in your application’s own terms and translate them per engine.
- Treat the labelled evaluation set from the benchmark as the contract any engine must meet.
The evaluation set matters most of the three.
FAQ
Is Faiss a Vector Database?
No. FAISS is a vector search library: it indexes and searches vectors loaded into memory but does not handle persistent storage, and filtered queries need an externally supplied bitset. Researchers class it separately from specialised vector databases such as Milvus and Weaviate and from relational extensions such as pgvector.
What Is the Difference Between Pgvector and PostgreSQL?
PostgreSQL is the relational database, and pgvector is an open-source extension that adds vector types and exact and approximate similarity search to it. Using pgvector keeps Postgres features such as ACID transactions, point-in-time recovery and JOINs.
What Does Multi-Tenancy Mean in a Vector Database?
Multi-tenancy means serving several users or organisations from one shared deployment while each tenant sees only its own data. Engines enforce it in different ways, from a tenant field filtered at query time to separate partitions, collections or databases, each with its own isolation and scaling limits.