Skip to main content

keywordScore

@forge/monorepo


@forge/monorepo / backend/src / keywordScore

Function: keywordScore()

keywordScore(entry, queryTerms): number

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

The keyword signal: how many of the query's terms this tool mentions, and where.

Weighted by field, because a term in the name is a different claim from a term buried in prose — a query for "issue" should rank github_create_issue above a tool whose description mentions issues in passing. Weights are small integers rather than tuned constants: RRF uses only the rank, so their exact values decide ordering and nothing else, and a fused score cannot be dominated by a badly chosen one.

Parameters

entry

ToolCatalogEntry

queryTerms

readonly string[]

Returns

number