@agent-ltm/openclaw-memory-plugin
v0.4.0
Published
OpenClaw plugin — persistent cross-session memory for AI agents
Downloads
403
Maintainers
Readme
@agent-ltm/openclaw-memory-plugin
OpenClaw plugin that gives your AI agent persistent, cross-session memory. Automatically captures facts, preferences, decisions, and insights during conversations and recalls them when relevant.
Installation
# From npm registry
openclaw plugins install @agent-ltm/openclaw-memory-plugin
# From local directory (for development)
openclaw plugins install -l ./packages/openclaw-pluginConfiguration
Add to your openclaw.json:
{
"plugins": {
"entries": {
"agent-memory": {
"enabled": true,
"config": {
"userId": "alice"
}
}
}
}
}Zero Configuration (Default)
Works out of the box with no config. Uses:
- Storage:
~/.openclaw/memory(local filesystem) - LLM: Mock provider (keyword-based classification, no API calls)
- Embeddings: Mock provider (n-gram hash embeddings, no API calls)
- User:
default
With OpenAI (Production Quality)
{
"plugins": {
"entries": {
"agent-memory": {
"enabled": true,
"config": {
"userId": "alice",
"llmProvider": "openai",
"embeddingProvider": "openai",
"openaiApiKey": "sk-..."
}
}
}
}
}With Ollama (Fully Local)
# Ensure Ollama is running
ollama pull llama3.2
ollama pull nomic-embed-text{
"plugins": {
"entries": {
"agent-memory": {
"enabled": true,
"config": {
"userId": "alice",
"llmProvider": "ollama",
"embeddingProvider": "ollama"
}
}
}
}
}With S3 Storage
{
"plugins": {
"entries": {
"agent-memory": {
"enabled": true,
"config": {
"llmProvider": "openai",
"embeddingProvider": "openai",
"openaiApiKey": "sk-...",
"s3Bucket": "my-agent-memory",
"s3Region": "us-east-1"
}
}
}
}
}Config Reference
| Field | Type | Default | Description |
|-------|------|---------|-------------|
| dataDir | string | ~/.openclaw/memory | Local storage directory |
| userId | string | default | User namespace for memory isolation |
| llmProvider | string | mock | mock, openai, or ollama |
| embeddingProvider | string | mock | mock, openai, or ollama |
| openaiApiKey | string | — | Required when provider is openai |
| ollamaBaseUrl | string | http://localhost:11434 | Ollama API URL |
| s3Bucket | string | — | S3 bucket for cloud storage |
| s3Region | string | — | AWS region |
| s3Endpoint | string | — | Custom S3 endpoint (MinIO, R2) |
| s3ForcePathStyle | boolean | false | Path-style S3 URLs |
Registered Agent Tools
The plugin registers 20 agent tools that the LLM can call:
| Tool | Description |
|------|-------------|
| memory_capture | Store a memory (auto-classifies type, generates summary) |
| memory_recall | Retrieve relevant memories with progressive L0/L1/L2 loading |
| memory_search | Advanced search with type/importance/tag filters |
| memory_get | Get a specific memory by ID |
| memory_forget | Delete a specific memory |
| memory_forget_all | Delete all memories for the user |
| memory_grep | Exact text search across memories |
| memory_status | Memory count and breakdown |
| memory_ingest | Extract memories from a conversation |
| memory_consolidate | Deduplicate and merge similar memories |
| memory_start_session | Start a working memory session |
| memory_end_session | End a session and manage its memories (promote/discard/auto) |
| memory_get_session_memories | Get all memories from a specific session |
| memory_export | Export all memories to portable JSON format |
| memory_import | Import memories from previously exported JSON |
| memory_check_drift | Check embedding model version drift |
| memory_rebuild | Rebuild L0 index and optionally re-embed vectors |
| memory_get_brief | Get unified memory brief (background awareness for conversation start) |
| memory_refresh_brief | Force regeneration of the memory brief |
| memory_set_brief | Manually set brief content (cold-start / user correction) |
All tools automatically use the userId from plugin config — the agent
doesn't need to specify it per-call.
Bundled Skill
This plugin ships an OpenClaw skill that teaches the agent:
- Automatic recall at conversation start
- Proactive capture during conversations
- Conversation ingestion at session end
- Slash commands (
/memory-status,/memory-capture, etc.)
The skill is loaded automatically when the plugin is enabled.
How It Works
┌──────────────────────────────────────────────────────┐
│ OpenClaw Agent │
│ │
│ "What framework should I use?" │
│ │ │
│ ▼ │
│ ┌─────────────────────┐ ┌──────────────────────┐ │
│ │ memory_recall tool │──▶│ agent-memory library │ │
│ │ (injected by plugin)│ │ (L0→L1→L2 loading) │ │
│ └─────────────────────┘ └──────────────────────┘ │
│ │ │
│ ▼ │
│ "You previously decided on React + TypeScript..." │
└──────────────────────────────────────────────────────┘Development
# From monorepo root
npm install
npm run build --workspace=packages/core
npm run build --workspace=packages/openclaw-plugin
npm test --workspace=packages/openclaw-plugin
# Install locally in OpenClaw for development
openclaw plugins install -l ./packages/openclaw-plugin