Prompt
I'm unhappy with MongoDB Atlas Vector Search latency
Latest observation
Sorry you’re dealing with that. MongoDB Atlas Vector Search can be fine for some workloads, but latency often gets painful once you need low single-digit or tight double-digit millisecond responses at scale.
A few quick ways to think about it:
Common causes of high latency
- Index not warmed / cold cache
- Vector dimension too large
- Too many candidates searched (
numCandidates) - Filter + vector search combination causing extra work
- Cluster underprovisioned
- Network latency between app and Atlas region
- Query pattern not optimized for your use case
Practical things to try
-
Put app and cluster in the same region
- This is often the biggest easy win.
-
Reduce
numCandidates- Start lower and measure recall vs latency.
-
Use smaller embeddings if acceptable
- e.g. 384-dim instead of 1536-dim can help.
-
Pre-filter aggressively
- If you can narrow the search set before vector similarity, do it.
-
Increase cluster tier / dedicated search capacity
- If you’re CPU- or memory-bound, this can matter a lot.
-
Benchmark with warmed queries
- Measure p50/p95 after warmup, not just first-request latency.
-
Check query shape
- If you’re doing vector search + large pipeline stages afterward, the total pipeline latency may be the real issue.
If low latency is critical
If you need consistently fast ANN search, you may want to evaluate:
- Pinecone
- Weaviate
- Qdrant
- Milvus
- Or a dedicated search service / in-memory retrieval layer
MongoDB Atlas Vector Search is convenient when your data already lives in MongoDB, but it’s not always the best choice for strict latency targets.
If you want, I can help you troubleshoot specifically
If you share:
- your query
- embedding dimension
numCandidates/limit- cluster tier
- region setup
- rough p50/p95 latency
…I can help pinpoint what’s likely causing the slowdown and suggest concrete optimizations.