Package com.tnsai.skills
Interface SkillResolver
- All Known Implementing Classes:
KeywordSkillResolver,LLMSkillResolver
public interface SkillResolver
Ranks
Skills by their relevance to a user message (TNS-289).
This is the bridge between "every skill description is in the
always-on system prompt" (cheap, naive) and "every skill is loaded
into context" (expensive, wasteful). The resolver picks the
top-N candidates whose descriptions go in the prompt; the
full body only loads on invocation.
Implementations
KeywordSkillResolver— word-overlap scoring againstname,description, andwhenToUse. Default; no extra round-trip cost.LLMSkillResolver— opt-in; routes the user message and skill descriptions through an LLM scorer. Higher accuracy at the cost of one extra LLM call per turn.- Operators with strict requirements ship a custom resolver (e.g. embedding-based) via the same SPI.
Concurrency
Resolvers MUST be safe to call from multiple agent threads; lookup happens on the LLM dispatch hot path.- Since:
- 0.10.0 (TNS-289)
-
Method Summary
-
Method Details
-
resolve
Pick 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).- 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
-