Retrieval that finds the right thing — top-k, thresholds, and the rerank step everyone skips — step 8 of 9
Write retrieve(scored, k, threshold) that returns the top-k
candidates, filtered by score >= threshold, deduped by
chunk_id (keep the highest-scoring occurrence). Order the
output by descending score.
Two cases run. Expected output:
['policy/p2', 'policy/p4', 'policy/p7']
[]
⌘↵ runs the editor.read, then continue.
Write retrieve(scored, k, threshold) that returns the top-k
candidates, filtered by score >= threshold, deduped by
chunk_id (keep the highest-scoring occurrence). Order the
output by descending score.
Two cases run. Expected output:
['policy/p2', 'policy/p4', 'policy/p7']
[]
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.