AI / LlamaIndex Interview Questions
When should you use auto-merging retrieval?
Auto-merging retrieval is built for cases where relevant information tends to span more than one adjacent chunk, and you don't want retrieval fragmented across several small, disconnected pieces.
It relies on a HierarchicalNodeParser that builds parent-child chunk hierarchies, for example large parent chunks split into smaller child chunks. The AutoMergingRetriever retrieves at the child level for precision, but if enough children of the same parent get retrieved, it automatically merges them back into the larger parent chunk instead of returning several fragmented pieces.
Use it when your documents have long, coherent sections, like technical manuals or legal contracts, where a query often needs a whole paragraph or section rather than one isolated line. If most queries genuinely target a single precise fact, sentence-window retrieval is usually the better fit instead.
More Related questions...