Retrieval that finds the right thing — top-k, thresholds, and the rerank step everyone skips — step 6 of 9
AI wrote retrieve(scored, k=3) that takes the top-3 candidates
regardless of how low their scores go. The test query has zero
relevant chunks in the corpus, so the top-3 returns three garbage
chunks the model would treat as real.
Add a threshold filter (>= 0.5) BEFORE the slice. The function should return an empty list when nothing clears the bar.
Expected output:
[]
AI wrote retrieve(scored, k=3) that takes the top-3 candidates
regardless of how low their scores go. The test query has zero
relevant chunks in the corpus, so the top-3 returns three garbage
chunks the model would treat as real.
Add a threshold filter (>= 0.5) BEFORE the slice. The function should return an empty list when nothing clears the bar.
Expected output:
[]
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.