Package com.tnsai.skills
Class KeywordSkillResolver
java.lang.Object
com.tnsai.skills.KeywordSkillResolver
- All Implemented Interfaces:
SkillResolver
Cheap word-overlap
SkillResolver — scores each candidate by
how many of the user-message tokens occur in its
name, description,
and whenToUse text (TNS-289).
Default resolver in the framework. Adds zero round-trip cost and
is good enough when skill descriptions are written with trigger
phrases in mind. Operators wanting semantic matching plug in
LLMSkillResolver or a custom embedding-based resolver via
the SkillResolver SPI.
Scoring
Per candidate skill, every distinct word inuserMessage
that occurs in the skill's combined searchable text contributes
one point. Field weights:
namematches count 3× (a name match is the strongest signal)whenToUsematches count 2× (authored explicitly to capture intent)descriptionmatches count 1×
Skills that score zero are excluded — surfacing irrelevant candidates would dilute the LLM's prompt budget.
- Since:
- 0.10.0 (TNS-289)
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
KeywordSkillResolver
public KeywordSkillResolver()
-
-
Method Details
-
resolve
Description copied from interface:SkillResolverPick thelimitskills most relevant touserMessage. Returned list is ordered most-relevant-first; size is at mostlimit; an empty list is valid output (no skill matched the threshold).- Specified by:
resolvein interfaceSkillResolver- Parameters:
userMessage- the latest user turncandidates- the full set of registered skills (caller typically passesSkillStore.list())limit- maximum candidates to return; resolvers MUST not exceed this
-