Skip to content
1 min read · 115 words

Function: scaledRelevanceFloor()

ts
function scaledRelevanceFloor(utilization: number): number;

Defined in: src/batteries/context/thrift/relevance.ts:84

Scale the relevance floor between RELEVANCE_FLOOR_MIN (empty window, permissive) and RELEVANCE_FLOOR_MAX (full window, strict) by a convex curve on window utilization — see RELEVANCE_FLOOR_CURVE for why convex.

Parameters

ParameterTypeDescription
utilizationnumberHow full the window already is, as a fraction in [0, 1] (values outside the range are clamped). Typically olderTurnsTokens / historyBudget — how much of the OLDER-turn budget is already spent by turns kept unconditionally (e.g. the keepRecent window).

Returns

number

The minimum shared-content-word fraction (see relevanceToQuery) a turn must clear to survive selection at this utilization level.