Foresight.Recall.RerankWindow (Foresight v0.1.0)

Copy Markdown View Source

Sizes the rerank prefilter shortlist — how many fused candidates are handed to the (expensive) cross-encoder before the final selection.

Parity with Hindsight's rerank_limit = thinking_budget * 2 (memory_engine.py:3294): rerank the top 2× the resolved recall budget. An explicit recall_rerank_window override wins.

Deliberately NOT a function of the answer's max_tokens: Hindsight token-filters AFTER reranking (its step 5.5), so shrinking this shortlist by the answer cap would starve the cross-encoder the same way the pre-seed recall was starved before.

Summary

Functions

Shortlist size for params given the already-resolved recall_budget.

Functions

size(params, recall_budget)

@spec size(map(), non_neg_integer()) :: non_neg_integer()

Shortlist size for params given the already-resolved recall_budget.

Returns an explicit recall_rerank_window override when present and positive (string- or number-typed, matching the recall scalar convention), otherwise recall_budget * 2.