RAG Patterns
Parent: MongoDB Atlas Vector Search · Published reference · snapshot 2026-10-23 · skill mongodb-cohort-77fb33304703
↓ Facts as markdownall context files
Source-anchored research for RAG Patterns. 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
- Increasing the number of context chunks is not a universal improvement. Retrieved evidence quality, model choice, and document ordering affect the useful context budget; tune these choices on the target workload. (high confidence) [source]
Structure and components
- The LangChain MongoDB integration repository lists full-text, hybrid, parent-document, and self-query retriever components. Component names establish available integration paths, not production behavior or compatibility for an arbitrary installed version. (low confidence) (verified as of 2026-10-23) [source]
How it works
- Cross-encoder rerankers jointly process the question and candidate text. They can assess finer relevance than independent embeddings, but add runtime processing and should operate on a narrowed candidate set. (high confidence) [source]
- For questions that require dynamic source selection or repeated refinement, agentic RAG lets an agent choose searches, assess intermediate results, and iterate until it has sufficient context. Fixed query decomposition can instead use a predetermined orchestration flow. (low confidence) [source]
Problems, failure modes and limitations
- Hybrid retrieval combines lexical matching for identifiers and technical terms with semantic matching for paraphrases; fuse and deduplicate candidates before constructing the generation context. This addresses complementary retrieval failure modes without guaranteeing improvement on every corpus. (high confidence) [source]
- Reranking changes the ordering of retrieved candidates; it cannot recover an omitted passage without another retrieval step. Candidate recall therefore needs separate evaluation from final ranking quality. (medium confidence) [source]
- Anthropic reported reducing its top-20 retrieval failure rate from 5.7% to 1.9% using contextual embeddings, contextual BM25, and reranking together. This is a result from its evaluated datasets and configuration, not a measured Atlas performance guarantee. (low confidence) [source]
Comparisons and alternatives
- Reciprocal rank fusion merges ranked candidate lists using document positions rather than directly adding incompatible lexical and vector similarity scores. A model-based reranker can then refine the merged ordering. (high confidence) [source]
- Anthropic contextual retrieval prepends chunk-specific context derived from the full document before both embedding the chunk and constructing the BM25 index. This is an ingestion-time pattern, rather than just a generation prompt change. (low confidence) [source]
- Optional query transformation includes rewriting vague queries, decomposing multipart questions into separate searches, and HyDE, which embeds a generated hypothetical answer for retrieval. A hypothetical answer is a retrieval aid rather than source evidence. (low confidence) [source]
- Increasing final top-k is a tradeoff: more chunks may recover necessary evidence but can add distraction, token cost, and context-position sensitivity. The 2023 Lost in the Middle study demonstrated position effects in its tested models and tasks; it does not establish the magnitude for every current model. (high confidence) [source]
Facts and statements
- The basic Atlas RAG pattern separates ingestion, retrieval, and generation: chunk and embed documents, store them in MongoDB, retrieve chunks relevant to a question, and supply those chunks with the question to the generator. (high confidence) [source]
- For manually generated embeddings, MongoDB stores the embedding alongside document data. MongoDB Vector Search supplies retrieval; the application connects retrieval results to an LLM through an integration, an API call, or a locally loaded model. (low confidence) [source]
- A staged RAG pipeline retrieves a broad candidate set, optionally merges multiple retrieval lists, reranks candidates against the question, and sends a smaller final selection to the generator. (high confidence) [source]
- Small isolated chunks can lose document context. Parent-document retrieval addresses this by matching small child chunks and returning their larger parent documents; contextual retrieval instead enriches chunks before indexing. (medium confidence) [source]
- In alexsavio’s April 11, 2026 experiment, a reranker reduced Hit@1 from 1.000 for dense or hybrid retrieval to 0.867. The benchmark used only 15 questions and 35 documents and measured document retrieval, not generated-answer quality. (low confidence) [source]
- Evaluate retrieval relevance and downstream answer quality separately. Context size and ordering conclusions from idealized evidence selection may not transfer to a deployed RAG pipeline with imperfect retrieval. (medium confidence) [source]
- The inspected langchain-mongodb repository lists MongoDBAtlasHybridSearchRetriever, MongoDBAtlasParentDocumentRetriever, and MongoDBAtlasSelfQueryRetriever, giving Atlas users implementation entry points for advanced retrieval patterns. (low confidence) (verified as of 2026-10-23) [source]
- MongoDB documents $rankFusion for rank-based fusion and $scoreFusion for score-based fusion, with an optional $rerank stage after either fusion stage. These are query implementation options; deployment availability and prerequisites must be checked separately. (low confidence) (verified as of 2026-10-23) [source]
- A two-stage pipeline retrieves a broader candidate pool, then scores query-candidate pairs and passes a smaller reranked subset to the generator. Tune the initial candidate count separately from the final context count. (high confidence) [source]
- Reranking adds query-time work, while reducing the final context can reduce generation work. Measure total latency, cost, retrieval relevance, and answer quality on representative queries before adopting the extra stage. (high confidence) [source]
- A 2026 financial text-and-table benchmark reports that BM25 exceeded dense retrieval, while HyDE, multi-query expansion, and adaptive retrieval offered limited benefit for precise numerical questions. Its abstract also reports strong hybrid-plus-reranking results. Treat these as workload-specific findings, not an Atlas benchmark or proof that all added stages help. (low confidence) [source]
Children
- Hybrid lexical and vector retrieval (frontier)
- Rank fusion and candidate reranking (frontier)
- Parent-document retrieval (frontier)
- Contextual chunk enrichment (frontier)
- Query reformulation and self-query retrieval (frontier)
- RAG retrieval and answer evaluation (frontier)
Frontier under this node: Contextual chunk enrichment, Hybrid lexical and vector retrieval, Parent-document retrieval, Query reformulation and self-query retrieval, RAG retrieval and answer evaluation, Rank fusion and candidate reranking