Install
openclaw skills install memory-toolsAgent-controlled memory plugin for OpenClaw with confidence scoring, decay, and semantic search. The agent decides WHEN to store/retrieve memories — no auto-capture noise. v2 uses file-based storage with optional QMD search (no external APIs required).
openclaw skills install memory-toolsAgent-controlled persistent memory for OpenClaw.
Traditional memory systems auto-capture everything, flooding context with irrelevant information. Memory Tools follows the AgeMem approach: the agent decides when to store and retrieve memories.
memory_store, memory_update, memory_forget, memory_search, memory_summarize, memory_listclawhub install memory-tools
cd skills/memory-tools
npm install
npm run build
openclaw plugins install --link .
openclaw plugins enable memory-tools
openclaw gateway restart
npm install -g @tobilu/qmd
Without QMD, basic filtering works. With QMD, you get semantic search (BM25 + vector + reranking).
NODE_MODULE_VERSION mismatch), memory-tools falls back to basic mode.MEMORY_TOOLS_DISABLE_QMD=true.~/.openclaw/memories (or configured memoriesPath).before_agent_start when autoInjectInstructions=true.~/.openclaw/memory/tools/memory.db when autoMigrateLegacy=true.autoInjectInstructions and autoMigrateLegacy are false.Memories are stored as markdown files in ~/.openclaw/memories/:
~/.openclaw/memories/
├── facts/
│ └── abc123-def4-5678-90ab-cdef12345678.md
├── preferences/
│ └── def456-7890-abcd-ef12-345678901234.md
├── instructions/
│ └── ghi789-0abc-def1-2345-678901234567.md
└── .deleted/
└── old-memory.md
Each memory file:
---
id: abc123-def4-5678-90ab-cdef12345678
category: preference
confidence: 0.9
importance: 0.7
created_at: 2024-01-15T10:30:00Z
tags: [ui, settings]
---
User prefers dark mode in all applications.
| Category | Use For | Example |
|---|---|---|
| fact | Static information | "User's dog is named Rex" |
| preference | Likes/dislikes | "User prefers dark mode" |
| event | Temporal things | "Dentist Tuesday 3pm" |
| relationship | People connections | "Sarah is user's wife" |
| instruction | Standing orders | "Always respond in Spanish" |
| decision | Choices made | "We decided to use PostgreSQL" |
| context | Situational info | "User is job hunting" |
| entity | Named things | "Project Apollo is their startup" |
memory_store({
content: "User prefers bullet points",
category: "preference",
confidence: 0.9,
importance: 0.7,
tags: ["formatting", "communication"]
})
memory_search({
query: "formatting preferences",
category: "preference",
limit: 10
})
memory_update({
id: "abc123",
content: "User now prefers numbered lists",
confidence: 1.0
})
memory_forget({
query: "bullet points",
reason: "User corrected preference"
})
memory_summarize({
topic: "user's work projects",
maxMemories: 20
})
memory_list({
category: "instruction",
sortBy: "importance",
limit: 20
})
# Show memory statistics
openclaw memory-tools stats
# List memories
openclaw memory-tools list
openclaw memory-tools list --category fact
# Search memories (requires QMD)
openclaw memory-tools search "dark mode"
# Export all memories as JSON
openclaw memory-tools export
# Force re-index with QMD
openclaw memory-tools reindex
# Show storage path
openclaw memory-tools path
Memories are plain markdown files — just read them:
cat ~/.openclaw/memories/facts/*.md
ls ~/.openclaw/memories/
Export all memories:
openclaw memory-tools export > memories.json
v2 automatically detects v1 databases and migrates them:
~/.openclaw/memory/tools/memory.dbTo enable auto-migration, set autoMigrateLegacy: true in plugin config.
MIT — Purple Horizons