RetrievedCandidate
Interface: RetrievedCandidate
Defined in: src/memory/retrieval/types.ts:58
One candidate the retrieval considered — admitted or not.
rank is the candidate's position by SCORE (1-based, descending),
which is not necessarily the order it appears in the prompt: the
budget picker admits by recency (see RetrievalEvidence.selectionOrder).
Recording both is the point — a reader can see that the best-scoring
chunk was admitted third, and know that was the picker's doing.
Properties
admitted
readonlyadmitted:boolean
Defined in: src/memory/retrieval/types.ts:66
Did this candidate's text reach the prompt?
docUri?
readonlyoptionaldocUri?:string
Defined in: src/memory/retrieval/types.ts:70
Source document, when the indexed value carried one in its metadata.
heading?
readonlyoptionalheading?:string
Defined in: src/memory/retrieval/types.ts:74
Section heading, when the splitter knew one.
id
readonlyid:string
Defined in: src/memory/retrieval/types.ts:60
The store entry's id. For an indexed corpus this is the chunk id.
page?
readonlyoptionalpage?:number
Defined in: src/memory/retrieval/types.ts:72
Page number, when the loader knew one (PDFs).
promptFragment?
readonlyoptionalpromptFragment?:string
Defined in: src/memory/retrieval/types.ts:83
The exact prompt bytes this chunk contributed, set by the formatter
for admitted candidates. Joining every admitted candidate's fragment
in promptPosition order with \n\n reproduces the
injected message exactly — which is what lets one retrieval become
one InjectionRecord PER CHUNK without changing a single byte the
model sees.
promptPosition?
readonlyoptionalpromptPosition?:number
Defined in: src/memory/retrieval/types.ts:94
Where this chunk sat in the injected message, 0-based.
NOT the same as rank, and the difference is the honest part:
rank is how well the chunk scored, promptPosition is where the
budget picker put it. Under the default recency ordering the
best-scoring chunk can land last — which is exactly the kind of thing
a lost-in-the-middle investigation needs to be able to see, and which
a record that only kept one of the two orders could not show.
rank
readonlyrank:number
Defined in: src/memory/retrieval/types.ts:64
1-based position by score, descending, across the whole candidate pool.
reason?
readonlyoptionalreason?:RetrievalRejectReason
Defined in: src/memory/retrieval/types.ts:68
Present exactly when admitted is false.
score
readonlyscore:number
Defined in: src/memory/retrieval/types.ts:62
Similarity as the store reported it. Cosine ([-1, 1]) for every shipped store.
