RAG Patterns with Vector Search
Parent: MongoDB Atlas Search and Vector Search · Published reference · snapshot 2026-10-23 · skill mongodb-cohort-2618e44302ce
↓ Facts as markdownall context files
Source-anchored research for RAG Patterns with Vector Search. Run status: COMPLETED.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
Definitions
- More retrieved context is not automatically better evidence use. Lost in the Middle found position-sensitive failures in the models it tested; a 2026 reproducibility study found that ordering and context-size effects interact with model choice, retrieval quality, and evaluation sampling. (medium confidence) [source]
How it works
- Contextual Retrieval prepends chunk-specific document context before embedding and BM25 indexing to preserve information lost when chunks stand alone. (low confidence) [source]
Problems, failure modes and limitations
- An independent experiment with 35 blog documents and 15 questions reported document-level Hit@1 of 1.000 for dense and hybrid retrieval but 0.867 after adding its cross-encoder; its tiny, easy benchmark and absence of answer generation limit generalization. (low confidence) [source]
- Anthropic reported top-20 retrieval failure falling from 5.7% to 2.9% with contextual embeddings plus contextual BM25, and to 1.9% with reranking; these are experimental retrieval results, not universal answer-accuracy gains. (low confidence) [source]
Comparisons and alternatives
- A two-stage pattern retrieves a larger candidate pool, reranks query–chunk pairs, and sends a smaller selected set to the generator. The extra scoring step introduces a quality, latency, and cost trade-off. (low confidence) [source]
- MongoDB's document-intelligence reference architecture illustrates corrective RAG with a retrieval agent, document grader, and query rewriter. Conditional graph edges retry retrieval after relevance checks fail; this is an implementation pattern rather than measured proof of higher accuracy. (low confidence) [source]
Facts and statements
- RAG retrieves relevant external text before generation. With Atlas Vector Search, an application stores document embeddings, embeds the query, retrieves matching documents, and supplies their text to the language model. (high confidence) [source]
- Hybrid retrieval combines semantic candidates with lexical candidates and fuses their rankings. This is useful for identifiers and proper nouns that semantic similarity alone can miss; the MongoDB example uses RRF over $vectorSearch and $search. (high confidence) [source]
- Treat hybrid retrieval and reranking as hypotheses to evaluate. Anthropic reported improvements on its datasets, while a separate small-corpus experiment reported reranking regressions; neither result establishes a universal best pipeline for an Atlas application. (medium confidence) [source]
- For multi-turn RAG, MongoDB's reference architecture stores conversation checkpoints in a dedicated collection. It also demonstrates section-specific retrieval prompts for scheduled reports, so different report sections can retrieve different evidence. (low confidence) [source]
- In manually embedded pipelines, verify that query embeddings, stored embeddings, and the vector index have matching dimensions. Test embedding generation on a small subset, batch larger ingestion jobs, and evaluate result relevance before scaling. (low confidence) [source]
- The MongoDB example repository forwards a source constraint as a server-side pre_filter on an indexed filter field. This illustrates narrowing retrieval by metadata; the example does not establish an application-wide authorization policy. (low confidence) [source]
- MongoDB's local RAG tutorial separates local embedding generation, vector indexing, retrieval, and local answer generation. It explicitly scopes local Atlas deployments to testing and directs production users to deploy a cluster. (low confidence) [source]
- RAG combines a language model with custom data by retrieving relevant context before generating a response; MongoDB documents this as a Vector Search application pattern. (high confidence) [source]
- A baseline pipeline splits documents into chunks, embeds them, retrieves semantically similar chunks for a query, and supplies retrieved text to the generator. (medium confidence) [source]
- MongoDB documents $rankFusion for reciprocal-rank fusion of $vectorSearch and $search results, and $scoreFusion for combining normalized relevance scores. (low confidence) (verified as of 2026-10-23) [source]
- MongoDB documents a shared-collection constraint for fusion sub-pipelines, serial execution, and no pagination; cross-collection retrieval requires a different construction such as $unionWith. (low confidence) (verified as of 2026-10-23) [source]
- Retrieving a candidate pool and reranking it before selecting final context is a separate stage from first-stage hybrid fusion. (high confidence) [source]
- Do not assume more prompt context always helps: Anthropic warns about distraction, and Lost in the Middle found position-dependent degradation on multi-document QA and key-value retrieval for the models tested in 2023. (high confidence) [source]
- Evaluate retrieval configurations on representative queries before adopting them: tune chunk boundaries and context size, compare dense/hybrid/reranked retrieval, and assess generated-answer quality separately from retrieval metrics. (medium confidence) [source]
Children
- Hybrid lexical and vector retrieval (frontier)
- Context-preserving chunking (frontier)
- Reranking and candidate selection (frontier)
- Corrective retrieval loops (frontier)
- RAG evaluation and abstention (frontier)
- Hybrid lexical and semantic retrieval (frontier)
- Candidate reranking (frontier)
- Retrieval and answer evaluation (frontier)
Frontier under this node: Candidate reranking, Context-preserving chunking, Corrective retrieval loops, Hybrid lexical and semantic retrieval, RAG evaluation and abstention, Reranking and candidate selection, Retrieval and answer evaluation