Method FindMatches
FindMatches(string, int, float)
Finds skills that match a user request based on description keywords.
This is a simple keyword-based matching implementation. For more sophisticated matching, consider using FindMatchesWithEmbeddings(string, Func<string, float[]>, int, float) with an embedding model.
public IReadOnlyList<SkillMatch> FindMatches(string userRequest, int maxResults = 5, float minScore = 0.1)
Parameters
userRequeststringThe user's request text.
maxResultsintMaximum number of matches to return.
minScorefloatMinimum score threshold (0.0 to 1.0).
Returns
- IReadOnlyList<SkillMatch>
A list of skill matches sorted by relevance (highest first).
Examples
Finding skills matching a user request:
var registry = new SkillRegistry();
registry.LoadFromDirectory("./skills");
var matches = registry.FindMatches("help me review my code for bugs");
foreach (var match in matches)
{
Console.WriteLine($"{match.Skill.Name}: {match.Score:P0}");
}
// Output: code-review: 85%