- Conversation turn processed
- LLM extracts facts, events & procedures
- Deduplicated & stored in vector index
- Recalled via semantic search on next turn
Build AI agents that remember, learn and evolve.
Private, persistent memory for .NET AI agents. Semantic, episodic and procedural memory types with automatic extraction, consolidation, time-decay scoring, and multi-user isolation. 100% on-device RAG. Zero cloud dependency.
Stateless agents forget. Yours won't.
Most AI agents treat every conversation as their first. They forget user preferences, lose track of project context, and repeat the same questions. Agent memory solves this by giving your agents persistent, structured recall that survives across sessions.
From stateless to stateful in one API
LM-Kit's AgentMemory integrates directly with
MultiTurnConversation and the Agent framework.
Memory is RAG-backed, KV-cache aware, and designed for production multi-user
deployments.
The agent extracts facts, events, and procedures from every conversation turn without manual intervention.
All memory storage and retrieval runs 100% on-device. No data leaves your infrastructure. HIPAA and GDPR ready.
Serialize memory to disk and restore it at any time. Share memory states between agents and deployments.
- Agent asks the same onboarding questions every session
- User preferences lost after every restart
- Document processing agents forget previous analysis results
- No personalization across multi-user deployments
- Cloud memory services leak sensitive data and add latency
Persistent, private, structured memory that lives on your hardware. Three memory types, automatic extraction, smart consolidation, and multi-user isolation out of the box.
Three types of memory, one unified API.
Modeled after human cognitive memory. Each type serves a distinct purpose, enabling agents to store the right kind of knowledge in the right way.
Type 01 · Facts & knowledge
Semantic memory
General knowledge, facts, and definitions that remain true over time. The foundation for grounded, accurate responses. User profiles, product catalogs, domain expertise, and configuration details.
Type 02 · Events & interactions
Episodic memory
Specific events, interactions, and experiences anchored in time. Enables agents to reference past conversations and track evolving situations. Support tickets, project milestones, and conversation history.
Type 03 · How-to & workflows
Procedural memory
Learned processes, workflows, and step-by-step procedures. Enables agents to remember how users like things done. Runbooks, deployment checklists, troubleshooting guides, and personal routines.
Everything for production memory.
From automatic learning to enterprise-grade capacity management. Every feature you need to ship memory-powered agents at scale.
Capability New
Automatic extraction
LLM-based fact extraction classifies memories by type and importance. Deduplication via vector similarity prevents redundant entries.
Capability New
Memory consolidation
LLM-powered clustering merges semantically similar memories into concise summaries. Reduces storage while preserving knowledge.
Capability New
Time-decay scoring
Exponential decay ensures recent memories rank higher in retrieval. Configurable half-life from hours to months.
Capability New
Multi-user isolation
UserScopedMemory namespaces data by user ID. One shared store, fully isolated retrieval, per-user cleanup.
Capability New
Capacity & eviction
Set maximum entries and choose eviction policies: oldest first, lowest importance first, or a combined strategy. Cancel evictions via events.
Capability
Serialize & restore
Persist memory to binary files and reload across sessions, deployments, and machines. Share memory states between agents.
Memory in five lines of code.
Add persistent memory to any agent or conversation. Automatic extraction, consolidation, multi-user scoping, and persistence are all configured through simple properties.
See memory in action.
Runnable samples that demonstrate every memory capability. Clone, build, and ship.
Memory
Persistent memory assistant
Full-featured demo showcasing auto-extraction, capacity limits, eviction, consolidation, conversation summarization, time-decay, and persistence.
Memory
Multi-turn chat with memory
Side-by-side comparison: conversations with and without memory. Pre-built customer profile with semantic recall.
RAG
RAG chatbot
Chat with eBooks, PDFs, and documents using retrieval-augmented generation. The foundation of memory-powered document intelligence.
Session
Persistent session
Save and restore full conversation state to disk. Resume sessions across application restarts with full context.
Agent
Research assistant
ReAct planning agent with web search. Combine memory with reasoning and tools for complex multi-step research tasks.
Integration
Semantic Kernel + memory
LM-Kit.NET as the LLM backend for Microsoft Semantic Kernel with persistent memory integration.
Step-by-step implementation guides.
Detailed walkthroughs covering every aspect of agent memory, from basic setup to advanced production patterns.
Key API classes.
The core types that power agent memory in LM-Kit.NET.
Class
AgentMemory
Core memory storage, retrieval, extraction, and consolidation.
Class
UserScopedMemory
Multi-user isolation with namespace prefixing.
Enum
MemoryType
Semantic, Episodic, Procedural enum.
Enum
MemoryExtractionMode
None or LlmBased automatic extraction.
Enum
MemoryEvictionPolicy
Oldest, LowestImportance, or combined.
Class
MultiTurnConversation
Conversation engine with Memory property.
Core concepts.
Foundational concepts behind agent memory, retrieval, and knowledge management.
Related capabilities.
Related
AI agent orchestration
Planning strategies, multi-agent workflows, and the full agent framework that memory powers.
Explore AI agentsRelated
Tools & function calling
Combine memory with 70+ built-in tools, custom ITool implementations, and [LMFunction] bindings. Agents that remember and act.
Related
Observability
Trace memory recalls, consolidations, and evictions. OpenTelemetry GenAI semantic conventions out of the box.
Explore observabilityRelated
Conversational AI
Multi-turn conversations, agentic reasoning, and the chatbot capabilities powered by agent memory.
Explore chatbotsRelated
Document intelligence
Document processing agents that remember previous analysis results and build persistent knowledge bases.
Explore documentsRelated
RAG pipelines
The retrieval-augmented generation engine that powers agent memory's semantic search and recall.
Explore RAGRelated
Privacy & compliance
Why on-device memory matters for HIPAA, GDPR, and enterprise deployments with zero data leakage.
Learn moreBuild it. Read it. Try it.
Working console demos on GitHub, step-by-step how-to guides on the docs site, and the API reference for the classes used on this page.
Persistent memory assistant
Agent demo: long-term memory across sessions with RAG.
Open on GitHub → DemoMulti-turn chat with agent memory
Demo: agent that remembers facts across turns and runs.
Open on GitHub → How-to guideUse agent memory for long-term knowledge
How-to: store, recall, evict; episodic vs semantic memory.
Read the guide → How-to guideEnable automatic memory extraction
Have the agent decide what to remember from conversations.
Read the guide →Build agents that actually remember.
Add persistent, private memory to your .NET agents in minutes.