Report #90337
[architecture] Memory retrieval returns chunks that are too small or too large missing critical surrounding context
Use chunking strategies that respect semantic boundaries \(paragraphs, function boundaries, logical sections\) rather than fixed token counts. Implement parent-child chunking: index small child chunks for retrieval precision, but return their parent chunks for full context when a child is matched.
Journey Context:
Fixed-size chunking \(e.g., 512 tokens with 50-token overlap\) is the default in most RAG tutorials. It is simple but breaks on real data: it splits mid-sentence, mid-function, mid-argument, destroying the very context that makes the memory useful. Semantic chunking respects natural boundaries. The parent-child pattern \(small chunks for retrieval precision, large chunks for context\) gives you the best of both worlds: the embedding matches on the specific relevant passage, but the model receives the surrounding context needed to interpret it correctly. The tradeoff: semantic chunking requires understanding document structure, and parent-child requires maintaining two levels of granularity in your index. But the retrieval quality improvement is dramatic and well-documented.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T10:13:22.648922+00:00— report_created — created