seniorReportedcurated
A question needs facts from three documents, like "compare UK and Netherlands parental leave". How does retrieval change?
30-second answer
- One embedding of a comparison lands between the two topics and retrieves neither side well, which is why the query has to be split rather than deepened.
- A cheap rewriting step emits one sub-question per subject, each retrieves independently, and the prompt assembles both labelled sets in a deliberate order.
- When the second hop depends on the first answer, use an agentic loop with a step budget and a success predicate instead of a fixed two-pass.
- Attribute each retrieved passage to the sub-question it answers, so synthesis can report a missing part rather than merging silently.
- Decomposition and looping add a model call, latency and variance, so route simple FAQ traffic to the single-shot path by question complexity.
Likely follow-ups
Open a question to rehearse the answer.
How do you stop the two sub-questions from retrieving near-identical chunks?
- Deduplicate the merged set by document id and content hash before assembly, since the same passage often arrives from several sub-queries.
- Identical evidence usually means the split produced overlapping needs rather than two subjects, so read the sub-queries and check each modifier still sits with its noun.
- Apply per-source caps so one subject cannot fill the context, and collapse sibling chunks that share a parent section.
What metric tells you decomposition helped rather than just added latency?
- Compare per-question correctness on a labelled multi-part set against a single-shot baseline, sliced by question type rather than averaged.
- Track the share of answers where one requested part went unsupported, since coverage is the property decomposition is supposed to buy.
- Report recall per sub-query next to total latency and sub-queries per request, so a gain that doubles p95 is visible in the same review.
How do you cap an agentic loop so a non-converging question cannot run forever?
- Set budgets for steps, tool calls, tokens and wall-clock outside the model, with one enforcement point that every loop and retry path increments.
- Stop when a retrieval returns no new document IDs, which catches thrashing before a step cap fires, since the cap only ends the run late and expensively.
- Return a structured outcome of success, partial or blocked with the reason, so a capped run is visible instead of shipping as a confident answer.
Red flags
- increase k
- unbounded loop
Concepts this tests
Tags
Source: www.mockingly.ai
More in RAG & retrieval pipelines
- Explain parent-child (small-to-big) retrieval. What problem does it solve and what does it cost you?
- Explain HNSW. What do M, ef_construction and ef_search each control, and which can you change in production?
- How would you tune HNSW for 10 million vectors when the product needs p95 retrieval under 100 ms?