Table of Contents

Class AgentCapabilities

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

Encapsulates the capabilities available to an agent: tools, skills, and memory.

public sealed class AgentCapabilities
Inheritance
AgentCapabilities
Inherited Members

Examples

Configuring capabilities for an agent:

using LMKit.Model;
using LMKit.Agents;
using LMKit.Agents.Tools;
using LMKit.Agents.Skills;

using var model = new LM("path/to/model.gguf");
var agent = new Agent(model);

// Configure tools
agent.Capabilities.EnsureTools().Register(new CalculatorTool());
agent.Capabilities.EnsureTools().Register(new WebSearchTool());

// Configure skills
agent.Capabilities.EnsureSkills().LoadFromDirectory("./skills");

// Check what's available
Console.WriteLine($"Tools: {agent.Capabilities.Tools?.Count ?? 0}");
Console.WriteLine($"Skills: {agent.Capabilities.Skills?.Count ?? 0}");
Console.WriteLine($"Has memory: {agent.Capabilities.HasMemory}");

Remarks

Capabilities extend what an agent can do beyond basic text generation. They enable the agent to interact with external systems, use specialized workflows, and maintain persistent knowledge across conversations.

Capability Types

  • Tools: External functions the agent can invoke, such as web search, database queries, or API calls.
  • Skills: Modular instruction packages with specialized knowledge and workflows.
  • Memory: Persistent storage enabling context recall across conversations.

Thread Safety

This class is not thread-safe. External synchronization is required if modifying capabilities from multiple threads.

Constructors

AgentCapabilities()

Initializes a new instance of the AgentCapabilities class with no capabilities.

AgentCapabilities(ToolRegistry, SkillRegistry, AgentMemory)

Initializes a new instance of the AgentCapabilities class with the specified components.

Properties

HasMemory

Gets a value indicating whether the agent has memory configured.

HasSkills

Gets a value indicating whether the agent has any skills registered.

HasTools

Gets a value indicating whether the agent has any tools registered.

IsEmpty

Gets a value indicating whether the agent has any capabilities configured.

Memory

Gets or sets the memory system for persistent knowledge storage and retrieval.

Skills

Gets or sets the registry of skills available to the agent.

Tools

Gets or sets the registry of tools available to the agent.

Methods

Clone()

Creates a shallow copy of this capabilities instance.

EnsureSkills()

Ensures the skill registry is initialized and returns it.

EnsureTools()

Ensures the tool registry is initialized and returns it.