An e-learning platform builds a RAG system for a technical Q&A assistant covering API documentation. The documentation chunks are 1,500 tokens each. Engineers observe that when users ask narrow questions (e.g., 'What is the default timeout for the connections API?'), retrieved chunks return surrounding context that buries the specific answer in irrelevant content, causing Claude to sometimes hallucinate the value or hedge excessively. What chunking strategy most directly addresses this retrieval precision problem?
Select an answer to reveal the explanation.
Short Explanation
Here's the deal — hierarchical chunking directly solves the precision vs. context tradeoff. You index small child chunks with atomic facts so narrow questions retrieve the exact value, then expand to parent chunks when broader context is needed.
Full Explanation
Hierarchical (parent-child) chunking directly solves the precision vs. context tradeoff. Child chunks of 100-200 tokens contain atomic facts ('Default timeout: 30 seconds') that retrieve with high precision for narrow questions. When Claude needs broader context (understanding why the default is 30 seconds, what parameters affect it), the parent chunk is retrieved. This dual-index approach outperforms single-size chunking for documentation question answering where both atomic fact retrieval and contextual understanding are needed. The approach of increasing chunk size to 3,000 tokens worsens the described problem — more irrelevant content per chunk makes the specific value harder to locate and increases hallucination risk. The approach of reducing chunk size to 200 tokens universally improves narrow-question precision but loses contextual continuity for multi-part questions, and important facts may be split across chunk boundaries. The approach of adding query expansion is a retrieval strategy that may help find relevant chunks but doesn't address the within-chunk noise problem of large chunks burying specific values.