<!-- llms-explorer concept facts · https://llms-explorer.com/tree/mongodb-atlas-vector-search/ · pack 2026-09-08 · ~3044 tokens -->

# MongoDB Atlas Vector Search

> ```python

Parent: [MongoDB Atlas](https://llms-explorer.com/tree/mongodb-atlas/) · 15 facets · 46 facts · page: https://llms-explorer.com/tree/mongodb-atlas-vector-search/

## HNSW Tuning Parameters

- Recommendation: Start with defaults. Only tune if ANN recall < 0.90 in production. — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#hnsw-tuning-parameters)

## Quantization

- Scalar quantization (int8): Reduces index size by ~4x; recall typically >95% vs full float — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#quantization)
- Binary quantization: Reduces by ~32x; recall ~90%; useful when memory is the constraint — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#quantization)

## ANN (Approximate Nearest Neighbor)

- numCandidates: Controls recall-latency tradeoff. Higher = better recall + slower. Rule of thumb: 10-20x the limit. Hard minimum equals limit. — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#ann-approximate-nearest-neighbor)

## ENN (Exact Nearest Neighbor)

- ENN guarantees perfect recall but O(N) scan. Use only for: small collections (<100K docs), high-accuracy requirements, offline batch evaluation. Do not use in production at scale. — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#enn-exact-nearest-neighbor)

## 3. Hybrid Search ($rankFusion / $scoreFusion)

- Combines semantic vector search with keyword full-text search. — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#3-hybrid-search-rankfusion-scorefusion)

## $rankFusion (Reciprocal Rank Fusion — recommended)

- RRF is robust to score magnitude differences between vector and full-text scores. Better than $scoreFusion when scores are on different scales. — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#rankfusion-reciprocal-rank-fusion-recommended)

## 4. Voyage AI Auto-Embedding

- Atlas Vector Search + Voyage AI auto-embedding lets you skip the embedding pipeline entirely - Atlas embeds at index-build time and at query time. — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#4-voyage-ai-auto-embedding)
- Voyage 4 model family (as of 2026): — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#4-voyage-ai-auto-embedding)
  - voyage-4-large: 1024 dims, best quality — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#4-voyage-ai-auto-embedding)
  - voyage-4-lite: 512 dims, fastest + most economical — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#4-voyage-ai-auto-embedding)
  - voyage-4-finance: Finance-domain specialized — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#4-voyage-ai-auto-embedding)
  - voyage-4-code: Code and programming specialized — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#4-voyage-ai-auto-embedding)

## Parent-Document Retrieval

- Index small chunks for precise retrieval, but return the parent document for full context: — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#parent-document-retrieval)

## Dedicated Search Nodes

- Vector Search in production should use dedicated Search Nodes to avoid resource contention with OLTP queries. HNSW graphs must fit in RAM for fast ANN. — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#dedicated-search-nodes)
  - 1M vectors × 1536 dims × float32 ≈ 6 GB raw; with HNSW graph ≈ 9-12 GB — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#dedicated-search-nodes)
  - Use S30_HIGHCPU_NVME or larger for production vector workloads — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#dedicated-search-nodes)
  - Use Storage-Optimized tiers when index exceeds RAM — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#dedicated-search-nodes)

## 7. Anti-Patterns

- Wrong similarity metric: Using euclidean with normalized embeddings (should use dotProduct); using cosine with unnormalized embeddings and comparing absolute distances — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#7-anti-patterns)
- No filter fields declared in index but using filter in $vectorSearch: Causes full ANN scan before filtering, not pre-filter → worst of both worlds — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#7-anti-patterns)
- numCandidates too low: Values close to limit severely degrade recall — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#7-anti-patterns)
- ENN in production at scale: O(N) scan; destroys query latency for collections > 100K docs — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#7-anti-patterns)
- Not sizing Search Nodes for vector workload: Embedded mongot on shared cluster causes OLTP latency spikes — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#7-anti-patterns)
- Dimension mismatch: numDimensions in index must match exactly what the embedding model outputs — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#7-anti-patterns)
- Querying without the vector index active: Atlas returns an error or falls back to collection scan; wait for index build to complete — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#7-anti-patterns)

## References

- Atlas Vector Search Documentation — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#references)
- $vectorSearch Aggregation Stage — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#references)
- Hybrid Search with $rankFusion — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#references)
- Voyage AI Auto-Embedding — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#references)
- Atlas Vector Search Quantization — [source](https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-vector-search/#references)

## Where this helps

- Building semantic search or RAG retrieval on top of an existing MongoDB/Atlas deployment, without standing up a separate vector database. — [source](https://llms-explorer.com/tree/mongodb-atlas-vector-search/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Combining keyword and semantic relevance in one query via $rankFusion when neither pure full-text nor pure vector search alone returns good results. — [source](https://llms-explorer.com/tree/mongodb-atlas-vector-search/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Recommendation and similarity-matching features where embeddings already exist and need low-latency ANN lookup at query time. — [source](https://llms-explorer.com/tree/mongodb-atlas-vector-search/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Prototyping retrieval-augmented generation with Voyage AI auto-embedding, when the team wants to skip building and operating a separate embedding pipeline. — [source](https://llms-explorer.com/tree/mongodb-atlas-vector-search/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*

## Project ideas

- Build a RAG chatbot backed by Atlas Vector Search: chunk documents, auto-embed with Voyage AI, and retrieve top-k results via $vectorSearch to ground LLM answers. — [source](https://llms-explorer.com/tree/mongodb-atlas-vector-search/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Build a hybrid product-search endpoint that fuses full-text keyword matches and vector similarity with $rankFusion so shoppers get both exact-term and semantically related results. — [source](https://llms-explorer.com/tree/mongodb-atlas-vector-search/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Implement parent-document retrieval: index small chunks for precision but return the full parent document for LLM context, avoiding retrieval fragments that lack surrounding context. — [source](https://llms-explorer.com/tree/mongodb-atlas-vector-search/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Prototype a near-duplicate detector using ENN on a small collection where exact recall matters more than query speed. — [source](https://llms-explorer.com/tree/mongodb-atlas-vector-search/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*

## Common mistakes

- Mismatching the similarity metric to how embeddings are normalized — using euclidean on normalized vectors, or cosine while comparing raw absolute distances — both silently degrade ranking quality. — [source](https://llms-explorer.com/tree/mongodb-atlas-vector-search/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Declaring no filter fields on the vector index but still passing a filter to $vectorSearch, forcing a full ANN scan before filtering instead of a true pre-filter. — [source](https://llms-explorer.com/tree/mongodb-atlas-vector-search/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Deploying ENN on a production query path at scale, turning what should be a low-latency ANN lookup into an O(N) collection scan. — [source](https://llms-explorer.com/tree/mongodb-atlas-vector-search/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Skipping dedicated Search Nodes for production vector workloads, letting embedded mongot compete with OLTP traffic on the same cluster and causing latency spikes on both sides. — [source](https://llms-explorer.com/tree/mongodb-atlas-vector-search/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*

## Known issues

- HNSW graphs must fit in RAM for fast ANN search, so 1M vectors at 1536 dimensions in float32 needs roughly 9-12GB with the graph — an undersized Search Node silently degrades toward disk-bound latency. — [source](https://llms-explorer.com/tree/mongodb-atlas-vector-search/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- numCandidates too close to the requested limit severely reduces recall, but pushing it too high trades latency for marginal recall gains — it needs real tuning, not a fixed default. — [source](https://llms-explorer.com/tree/mongodb-atlas-vector-search/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Querying a collection before its vector index finishes building returns an error or falls back to a collection scan rather than partial results. — [source](https://llms-explorer.com/tree/mongodb-atlas-vector-search/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- numDimensions in the index definition must exactly match what the embedding model outputs; switching embedding model tiers without re-embedding breaks the index silently. — [source](https://llms-explorer.com/tree/mongodb-atlas-vector-search/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*

## Context files

- [MongoDB Atlas Vector Search](https://llms-explorer.com/downloads/sources/mdb-context-hub/mongodb-atlas-vector-search.md)
