Skip to content
derpx06.dev
WritingExplainersNotesAbout
works on my machineit's always DNSship itLGTMTODO: sleepoff by oneread the docsgit push --force-with-lease404: sleep not foundhave you tried turning it off and on againrubber duck says: explain itpremature optimisationworks on my machineit's always DNSship itLGTMTODO: sleepoff by oneread the docsgit push --force-with-lease404: sleep not foundhave you tried turning it off and on againrubber duck says: explain itpremature optimisation

Learning in public.

A student's notebook on system design, distributed systems and databases. Shared as I learn.

ReadWritingExplainersNotesAbout
ElsewhereGitHubLinkedInHugging FaceLeetCode
Say hellomanaskhairnar1511@gmail.com
derpx06
NORMALmain© 2026 Derpx06Pune, Indiatop ↑
Learn/LangChain Mastery/Part 6 · 5. Retrieval & RAG Patterns
Lesson 43 of 68

Parent Document Retrieval

Embed small chunks. Retrieve big context.

Derpx0610 Jan · 1 min read
LangChain Mastery
The Retriever InterfaceSimilarity vs MMRMulti-Query RetrievalRAG-FusionQuery DecompositionParent Document RetrievalContextual CompressionPost-Retrieval Re-RankingConversational RAG & History
Contents
1. The Context Trade-off2. Best of Both Worlds: Decoupled Indexing3. Benefits4. Summary
0% read · 1 min leftBack to top ↑
Course outline & contents0%
LangChain Mastery
The Retriever InterfaceSimilarity vs MMRMulti-Query RetrievalRAG-FusionQuery DecompositionParent Document RetrievalContextual CompressionPost-Retrieval Re-RankingConversational RAG & History
Contents
1. The Context Trade-off2. Best of Both Worlds: Decoupled Indexing3. Benefits4. Summary

1. The Context Trade-off

Small Chunks: Great for similarity search. They are dense and specific. Big Chunks: Great for LLM comprehension. They provide continuity and background.

If you embed big chunks, you lose search precision. If you return small chunks, the LLM loses context.

2. Best of Both Worlds: Decoupled Indexing

Parent Document Retrieval separates "What we search" from "What we deliver."

  1. Split: Take a large document (Parent). Split it into 10 small pieces (Children).
  2. Index: Embed the Children.
  3. Store: Store the Parent in a key-value store (using doc ID).
  4. Retrieve:
    • Search matches Child #4.
    • Look up Parent ID of Child #4.
    • Return the Parent to the LLM.

3. Benefits

The retrieval signal is laser-focused (Child), but the context window is rich (Parent). This is excellent for Q&A on technical manuals where the answer depends on the surrounding paragraphs.

4. Summary

Don't force the embedding model and the generation model to see the same text. Optimize one for math (embeddings) and one for reading (generation).

Key Intuition: "Search for the needle, return the haystack."

Track your progressSign in and your progress follows you across devices.
Sign in to track progress Next lesson
← Previous lessonQuery DecompositionNext lesson →Contextual Compression