Get Free Community License
AI Chatbot & Agent SDK

Build Intelligent ChatbotsThat Remember, Reason & Act.

The complete .NET SDK for chatbot agents. Multi-turn conversations with persistent memory, agentic reasoning, function calling, MCP integration, vision, and agent skills. Run Qwen, Gemma, DeepSeek, GLM, GPT-OSS and more 100% on-device with zero cloud dependency.

3 Memory Types ReAct Planning MCP & Tools Agent Skills On-Device
Persistent Memory
Semantic, episodic & procedural memory with auto-extraction and consolidation
New
Agentic Reasoning
ReAct, Chain-of-Thought, and Tree-of-Thought planning strategies
New
Function Calling & MCP
4 execution modes, built-in tools, and Model Context Protocol servers
Core
Agent Skills
Drop-in SKILL.md files for zero-code domain expertise
New
Vision & Multimodal
Process images in any turn with VLM-capable models
Core
Enterprise-Grade Security
Tool permission policies, risk levels, and approval workflows
New
100%
On-Device
18
Agent Templates
60+
Built-in Tools
4
Orchestrators

From Simple Chat to Agentic Assistants

Building chatbots that maintain context, remember users, reason through problems, and take action has traditionally required stitching together multiple cloud services. LM-Kit unifies all of this into a single, on-device .NET SDK.

MultiTurnConversation

Full conversation context with history, tools, memory, vision, MCP, and skills in a single API.

AgentMemory

Three memory types with automatic extraction, consolidation, and multi-user isolation.

Agent Framework

Planning strategies, orchestrators, skills, resilience policies, and observability built in.

LM-Kit Agent
What's the status of my order?
Checking your order history... Your order #4521 shipped yesterday and arrives Thursday, Sarah.
Memory: recalled customer name and order history
Can you update my shipping address?
Done. I've updated the delivery address for order #4521.
Tool: UpdateAddress("123 New St, Austin TX")
Memory + Tool Calling Demo View on GitHub

Everything You Need to Build Chatbot Agents

A complete SDK covering conversations, memory, reasoning, tools, skills, vision, and enterprise security.

Multi-Turn Context

Maintain conversation history across exchanges. The model references past turns for coherent, contextual responses.

RAG-Backed Memory Enhanced

Semantic, episodic, and procedural memory with automatic extraction, consolidation, and multi-user isolation.

Function Calling & MCP

4 execution modes, [LMFunction] attributes, ITool interface, built-in tools, and Model Context Protocol servers.

Agent Skills New

Drop-in SKILL.md files for zero-code domain expertise. Manual slash commands or model-driven activation.

Agentic Reasoning New

ReAct, Chain-of-Thought, Tree-of-Thought, and Plan-and-Execute planning strategies for complex tasks.

Vision & Multimodal

Process images alongside text at any turn with VLM-capable models. Build visual assistants that analyze and describe.

Streaming & Structured Output

Real-time token streaming for responsive UX. Constrain responses to valid JSON schemas with grammar enforcement.

On-Device & Secure Enhanced

All inference runs locally. Tool permission policies with risk levels, approval workflows, and category-based access control.

Conversation APIs

Choose the right conversation pattern for your use case, from fast Q&A to extended dialogues with memory, tools, and agentic reasoning.

Single-Turn Conversation

Fast question-answer interactions without history retention. Optimized for stateless queries, classification tasks, and one-shot completions.

Stateless Low latency System prompts JSON output

Multi-Turn Conversation

Extended dialogues with full history tracking, memory, function calling, vision, and agent skills. The foundation for chatbot agents.

History Tools Memory Vision MCP Skills Persistence

Smart Memories

Transform stateless chatbots into assistants that evolve with each interaction. Memory is RAG-backed, KV-cache aware, and designed for production multi-user deployments.

Agents That Remember What Matters

AgentMemory integrates with MultiTurnConversation to store and recall semantic, episodic, and procedural knowledge across sessions. Memory is KV-cache aware, injecting only missing context to keep outputs grounded without repetition.

Enable automatic memory extraction and the system learns from every conversation turn. Facts, events, and procedures are classified, deduplicated, and stored without manual intervention. Over time, memory consolidation merges similar entries into concise summaries.

Introducing AgentMemory Blog Post

Semantic Memory

Facts & Knowledge

Store facts, definitions, and general knowledge. User preferences, product details, domain expertise.

Episodic Memory

Events & Interactions

Remember specific events and interactions. User history, support tickets, conversation milestones.

Procedural Memory

How-To & Workflows

Retain learned procedures and workflows. Remember how users like things done.

Auto-Extraction New

LLM-based extraction classifies and stores memories automatically from every conversation turn.

Consolidation New

Merge semantically similar memories into concise summaries using LLM-powered clustering.

Multi-User Isolation New

UserScopedMemory namespaces data by user ID. Scoped retrieval and per-user cleanup.

KV-Cache Aware Recall

Memory injection is optimized for the model's key-value cache. Only missing context is added.

Time-Decay Scoring New

Exponential decay ensures recent memories rank higher. Configurable half-life and eviction policies.

Serialize & Restore

Persist memory to disk and reload across sessions. Share memory states between agents.

Agentic Reasoning & Orchestration

Go beyond simple Q&A. Equip chatbots with planning strategies that decompose complex tasks, and orchestration patterns that coordinate multiple specialized agents.

Planning Strategies New

Give chatbots the ability to think step-by-step before acting. Select the planning strategy that fits your task complexity.

ReAct Chain-of-Thought Tree-of-Thought Plan-and-Execute Reflection 18 Agent Templates

Enterprise Resilience New

Production-grade reliability with built-in resilience policies and full observability via OpenTelemetry.

Retry policies Circuit breaker Rate limiting Timeout & fallback OpenTelemetry tracing Agent metrics

Multi-Agent Orchestration

Coordinate multiple specialized agents for complex workflows. Each orchestrator handles a different collaboration pattern with real-time streaming output.

Pipeline

Sequential agent chain. Each agent refines the output of the previous one.

Parallel

Run multiple agents concurrently and merge results.

Router

Intelligent routing to the best-fit specialist agent.

Supervisor

Supervisor delegates tasks to workers and synthesizes output.

Function Calling & Tool Use

Let chatbots call your code dynamically, connect to external services via MCP, and use 60+ built-in tools across 8 categories.

[LMFunction] Attribute

Decorate C# methods with [LMFunction] to expose them as callable tools. The SDK generates JSON Schema automatically from method signatures and XML documentation.

Auto schema Type-safe Async support Descriptions

ITool, Built-in Tools & MCP

Use 60+ atomic built-in tools (file system, HTTP, web search, database, PDF), implement ITool for custom tools, or connect MCP servers for external tool catalogs.

8 tool categories MCP protocol Permission policies Risk levels

Execution Modes

Simple

One function call per turn with sequential execution.

Multiple

Chain multiple calls in sequence within a single turn.

Parallel

Execute independent calls concurrently for speed.

Parallel + Multiple

Combine parallel and sequential chaining.

Agent Skills

Give chatbots domain expertise without writing code. Drop a SKILL.md file and your agent gains new capabilities instantly.

Zero-Code Expertise

Agent Skills are reusable instruction files that teach your chatbot how to handle specific domains or tasks. Define a skill once, share it across agents and projects.

Manual Mode

Users activate skills via slash commands like /explain or /pros-cons.

Model-Driven Mode

The model autonomously discovers and activates the right skill via function calling.

Skills support progressive loading, keyword and semantic matching, and multiple sources (filesystem, URLs, GitHub repositories).

email-writer.SKILL.md
--- name: Email Writer command: /email description: Draft professional emails activation: manual keywords: [email, compose, draft, write] --- # Instructions You are a professional email writer. Analyze the user's intent and draft a clear, concise email with: - Appropriate greeting and sign-off - Action items highlighted - Professional tone matching context

Built for Developer Velocity

A single, unified API. No boilerplate. No rework when switching models. Five lines to a working chatbot agent.

using LMKit.Model;
using LMKit.TextGeneration;

// Instantiate a model by ID from the catalog
var model = LM.LoadFromModelID("qwen3:8b");

// Create a multi-turn conversation with system prompt
var chat = new MultiTurnConversation(model)
{
    SystemPrompt = "You are a helpful customer support agent."
};

// First turn
var response1 = chat.Submit("What's your return policy?");
Console.WriteLine(response1.Completion);

// Second turn - context is automatically maintained
var response2 = chat.Submit("How long do I have?");
Console.WriteLine(response2.Completion);
using LMKit.Model;
using LMKit.Agents;
using LMKit.TextGeneration;

// Load chat and embedding models
var chatModel = LM.LoadFromModelID("qwen3:8b");
var embedModel = LM.LoadFromModelID("qwen3-embedding:0.6b");

// Create memory with automatic extraction enabled
var memory = new AgentMemory(embedModel)
{
    ExtractionMode = MemoryExtractionMode.LlmBased,
    ExtractionModel = chatModel
};

// Create conversation - memory auto-learns from every turn
var chat = new MultiTurnConversation(chatModel) { Memory = memory };

// Memory is extracted and recalled automatically
var r1 = chat.Submit("I prefer concise answers. My name is Sarah.");
var r2 = chat.Submit("Explain dependency injection.");
// Agent recalls Sarah's name and preference for brevity
using LMKit.Model;
using LMKit.TextGeneration;
using LMKit.FunctionCalling;

public class WeatherTools
{
    [LMFunction("Get current weather for a city")]
    public static string GetWeather(string city)
    {
        return $"Weather in {city}: 72°F, sunny";
    }
}

var model = LM.LoadFromModelID("qwen3:8b");
var chat = new MultiTurnConversation(model);

// Register tools from a class
chat.Tools.ImportFunctions(typeof(WeatherTools));

// Model calls GetWeather when appropriate
var response = chat.Submit("What's the weather in Tokyo?");
using LMKit.Model;
using LMKit.Agents;
using LMKit.Agents.Planning;
using LMKit.Agents.Tools.BuiltIn;

var model = LM.LoadFromModelID("qwen3:8b");

// Build an agent with ReAct planning and web search
var agent = Agent.CreateBuilder(model)
    .WithPlanning(PlanningStrategy.ReAct)
    .WithTools(tools =>
    {
        tools.Register(BuiltInTools.WebSearch);
        tools.Register(BuiltInTools.Calculator);
    })
    .Build();

// Agent reasons step-by-step, searches the web, and computes
var result = await agent.ExecuteAsync(
    "Research the population of the 3 largest cities in France and calculate the total."
);

Common Use Cases

Customer Support

Deploy chatbots that handle complex queries, remember customer history, call your ticketing APIs, and route to specialists when needed.

Healthcare Companions

Build virtual assistants for patient triage, scheduling, and follow-ups with HIPAA-compliant on-device processing.

Educational Tutors

Create intelligent tutoring systems that adapt to student level, remember progress, and use skills for different subjects.

E-commerce Assistants

Power product discovery, order tracking, and personalized recommendations with memory and function calling.

Legal & Compliance

Build document Q&A systems for contracts, policies, and regulations. RAG over your knowledge base, on-premises.

Enterprise Knowledge

Deploy agentic chatbots that answer questions from internal wikis, search the web, and orchestrate multi-step research tasks.

Start Building Chatbot Agents Today

From simple multi-turn chat to agentic assistants with memory, reasoning, and tools. Get started in minutes with our SDK.

Talk to an Expert

Need help with agent architecture, model selection, or memory workflows? Let's connect.

Speak with an expert