Table of Contents

Method FindMatchesWithEmbeddings

Namespace
LMKit.Agents.Skills
Assembly
LM-Kit.NET.dll

FindMatchesWithEmbeddings(string, Func<string, float[]>, int, float)

Finds skills that match a user request using embedding-based semantic similarity.

public IReadOnlyList<SkillMatch> FindMatchesWithEmbeddings(string userRequest, Func<string, float[]> embeddingProvider, int maxResults = 5, float minScore = 0.5)

Parameters

userRequest string

The user's request text.

embeddingProvider Func<string, float[]>

A function that computes embeddings for text. Takes text as input and returns a float array.

maxResults int

Maximum number of matches to return.

minScore float

Minimum similarity threshold (0.0 to 1.0).

Returns

IReadOnlyList<SkillMatch>

A list of skill matches sorted by semantic similarity (highest first).

Examples

Finding skills using semantic embeddings:

var registry = new SkillRegistry();
registry.LoadFromDirectory("./skills");

// Use your embedding model to compute embeddings
Func<string, float[]> embedder = text => myEmbeddingModel.Embed(text);

var matches = registry.FindMatchesWithEmbeddings(
    "help me review my code",
    embedder,
    maxResults: 3);