Get Free Community License
Conversational AI Engine

Intelligent Chatbotsfor .NET Applications.

Build chatbots that maintain context across turns, recall relevant facts from memory, and execute functions on demand. Run Qwen, Gemma, Mistral, DeepSeek, GLM, GPT-OSS and more entirely on-device with zero cloud dependency, full data privacy, and predictable latency. Powered by MultiTurnConversation and AgentMemory APIs.

Multi-Turn Context RAG-Backed Memory Function Calling
User Message
Text input with optional image attachments (VLM support)
Memory Recall
AgentMemory retrieves relevant facts, events, procedures
RAG
Context Assembly
System prompt + history + memory, KV-cache optimized
Tool Execution
Model invokes [LMFunction] methods or MCP tools
Optional
Streamed Response
Token-by-token output with JSON schema constraints
100%
On-Device
3
Memory Types
4
Tool Modes

Why LM-Kit Conversational AI?

Building chatbots that maintain context, remember users, and take actions has traditionally required complex orchestration of multiple cloud services and custom infrastructure. LM-Kit unifies all of this into a single, on-device SDK.

With MultiTurnConversation and AgentMemory, your chatbots can engage in extended dialogues, recall relevant facts across sessions, and invoke your application's functions directly, all while keeping sensitive data within your controlled environment.

Introducing AgentMemory Blog Post
LM-Kit Chat
What's the status of my order?
Your order #4521 shipped yesterday and arrives Thursday, Sarah.
Can you update my address?
Multi-Turn Chat Demo View on GitHub

Key Features

Multi-Turn Context

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

RAG-Backed Memory

AgentMemory stores semantic, episodic, and procedural knowledge. Recall is KV-cache aware for grounded outputs.

Function Calling

Let chatbots invoke your C# methods dynamically. Define tools with [LMFunction] or ITool interface.

Streaming Output

Real-time token streaming for responsive UX. Display responses as they generate for natural conversation flow.

Session Persistence

Save and restore conversation state to disk. Resume sessions across app restarts with full context preserved.

Structured JSON

Constrain responses to valid JSON schemas. Get predictable, parseable outputs for data extraction.

Vision Support

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

On-Device Privacy

All inference runs locally. Conversations never leave your environment. HIPAA and GDPR ready.

Conversation APIs

Choose the right conversation pattern for your use case, from fast Q&A to extended dialogues with history and tool calling.

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. Built for chatbots, assistants, and interactive workflows that span multiple exchanges.

History Tools Memory Vision MCP

Smart Memories

Keep conversations coherent with RAG-backed memory that recalls relevant facts only when needed, without polluting context with irrelevant information.

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.

The memory system supports three types modeled after human cognitive memory, enabling agents to remember facts, events, and procedures relevant to each conversation.

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.

KV-Cache Aware Recall

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

Smart Filtering

Use DataFilter to exclude collections or sections. Apply domain rules via metadata filtering.

Serialize & Restore

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

On-Device Privacy

All memory operations run locally. Embeddings and vector search stay within your environment.

Function Calling & Tool Use

Let chatbots call your code dynamically. Define functions with JSON Schema, and the model decides when and how to invoke them.

[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 Interface & MCP

Implement ITool for custom tool definitions or connect to external tool catalogs via Model Context Protocol (MCP). Full control over validation and error handling.

Custom schemas MCP support Validation Error handling

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.

Built for Developer Velocity

LM-Kit simplifies integration with a single, unified API. No boilerplate. No rework when switching models.

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("bge-small-en");

// Create persistent memory
var memory = new AgentMemory(embedModel);

// Store user preferences
await memory.SaveInformationAsync(
    "user_prefs", "User prefers concise responses.",
    "style", MemoryType.Semantic);

// Create conversation with memory attached
var chat = new MultiTurnConversation(chatModel) { Memory = memory };

// Memory is recalled automatically when relevant
var response = chat.Submit("Explain dependency injection.");
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?");

Common Use Cases

Customer Support

Deploy chatbots that handle complex queries, remember customer history, and call your ticketing APIs.

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 and remember progress across sessions.

E-commerce Assistants

Power product discovery, order tracking, and recommendations. Integrate with inventory and shipping APIs.

Legal & Compliance

Build document Q&A systems for contracts, policies, and regulations. Keep sensitive data on-premises.

Enterprise Knowledge

Deploy chatbots that answer questions from internal wikis, Confluence, or SharePoint without cloud dependency.

Start Building Today

Explore our docs, try the demos, or integrate instantly with LM-Kit.NET's SDK.

Talk to an Expert

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

Speak with an expert