Answer questions whose facts sit in separate documents without letting a plausible first hit become an unsupported final answer.
Multi-hop retrieval: build evidence chains with bounded searches
Represent the missing link
A multi-hop question needs two or more supported joins. A support ticket may name shipment SH-47, while the carrier notice names only its dispatch batch. First retrieve the ticket and extract its batch ID. Then search that exact ID in the permitted carrier corpus. Keep each edge as a tuple of source passage, extracted entity, target passage and match rule. The final answer must cite both ends of the join. Claim support should reject a chain whose second edge is only a semantic resemblance.
Search in a fixed budget
Give each hop its own candidate limit, time limit and permission filter. The planner can propose the next lookup, but application code should validate the proposed identifier against the preceding passage before executing it. Stop after a bounded number of hops; a loop between two documents is a failed search, not deeper reasoning. If the first document names two batches, branch into two explicit chains and keep their evidence separate until a source disambiguates them.
Preserve uncertainty
The chain may support that SH-47 belongs to batch BX-83 and that BX-83 was delayed. It does not prove the customer's delivery date changed unless a permitted source states that consequence. Distinguish a missing edge from a contradictory edge. Missing means the lookup exhausted its budget; contradictory means two eligible sources disagree and require revision or time resolution. Abstention is the correct output when a required edge has no evidence.
Evaluate the joins
Judgments should name the expected intermediate entity and answer-bearing passages, not only the answer text. Record success at hop one, success at hop two, chain precision and final claim support independently. A fluent answer can hide a bad join. Include decoy IDs with similar spelling, revoked passages, duplicate entity names across tenants and an answer that requires three documents. A single overall accuracy score will obscure which hop fails.
Worked contract
from dataclasses import dataclass
@dataclass(frozen=True)
class Evidence:
passage_id: str
tenant: str
entity_id: str
linked_id: str
def trace_shipment(shipment_id: str, tenant: str,
tickets: list[Evidence], notices: list[Evidence]) -> list[tuple[str, str]]:
chains = []
for ticket in tickets:
if ticket.tenant != tenant or ticket.entity_id != shipment_id:
continue
for notice in notices:
if notice.tenant == tenant and notice.entity_id == ticket.linked_id:
chains.append((ticket.passage_id, notice.passage_id))
return chains
tickets = [Evidence("ticket-47-r2", "north", "SH-47", "BX-83")]
notices = [Evidence("notice-83-r4", "north", "BX-83", "late"),
Evidence("notice-83-private", "south", "BX-83", "cancelled")]
assert trace_shipment("SH-47", "north", tickets, notices) == [
("ticket-47-r2", "notice-83-r4")]
assert trace_shipment("SH-47", "south", tickets, notices) == []Performance and operating cost
The transparent nested-loop baseline costs O(TN) time for T tickets and N notices and O(C) space for C chains. Index notices by tenant and entity to reduce the join to O(T + N + C) build-and-probe time. Each extra retrieval hop adds latency and new failure opportunities, so cap depth and branch count before generation.
Common Mistakes
- Using a model-generated intermediate ID that is absent from the cited passage.
- Combining passages from different tenants because the entity text matches.
- Claiming a downstream consequence that neither source states.
- Allowing repeated hops to search indefinitely.
Validation drill
Create 37 questions: 19 valid two-hop chains, six ambiguous branches, five missing second edges, four decoy IDs and three revoked intermediates. Report first-hop and full-chain recall separately.
Read next
- Retrieval query routing: preserve exact constraints before search
- Claim-level citations: verify each answer against its passage
- Retrieval caches and conversation turns: recheck access every time
- Retrieval release gates: evaluate slices before changing an index
