Skip to main content

MIN_KEYWORD_SCORE

@forge/monorepo


@forge/monorepo / backend/src / MIN_KEYWORD_SCORE

Variable: MIN_KEYWORD_SCORE

const MIN_KEYWORD_SCORE: 2 = 2

Defined in: backend/src/tools/find.ts:65

The absolute floor, and why a relative one is not enough.

Fused scores are normalised against the best hit, so a query that matched exactly one tool badly gives that tool a score of 1.0 — the relative floor cannot reject a uniformly poor result set, because something is always the best of it. Knowledge retrieval solves this with an absolute semanticFloor handed to the vector index; this is the same idea for the keyword signal.

2 is one name or category hit, or two words of prose. A single common word appearing somewhere in a description is not evidence: "translate this into Welsh" found parse_csv, whose description happens to say "into", and returned it with a perfect score. That was a real result from the first run of this file's tests, and it is the least-bad-match failure the floor exists to prevent — a model handed the least-bad tool calls it.