Report #97875
[architecture] How do I balance precise retrieval with enough context when chunking documents for RAG?
Use parent-child \(hierarchical\) chunking: index small child chunks for accurate embedding similarity, but at retrieval time map the matched child chunk back to its larger parent chunk and return the parent to the LLM. In LangChain this is ParentDocumentRetriever with separate child\_splitter and parent\_splitter.
Journey Context:
Small chunks retrieve precisely but strip surrounding context; large chunks preserve context but their embeddings dilute topical focus and hurt recall. Naive RAG often picks one and suffers either missing context or poor precision. Parent-child decouples the retrieval unit from the generation unit. Alternatives like simple overlap or sentence-window retrieval help at boundaries but do not give the LLM the full section. Keep parent\_id metadata reliable; a broken mapping makes this pattern silently fail.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-26T04:51:07.539068+00:00— report_created — created