Manage, optimize, and troubleshoot the OpenClaw memory system — MEMORY.md curation, daily logs (memory/YYYY-MM-DD.md), memory_search tuning, compaction survi...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install openclaw-mem或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install openclaw-mem⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/openclaw-mem/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: openclaw-mem description: > Manage, optimize, and troubleshoot the OpenClaw memory system — MEMORY.md curation, daily logs (memory/YYYY-MM-DD.md), memory_search tuning, compaction survival, and vector/hybrid search configuration. Use this skill whenever the user mentions OpenClaw memory, MEMORY.md, daily logs, memory_search, memory_get, compaction flush, memory indexing, QMD, memory recall problems, "the agent forgot", context window issues, or wants to set up, debug, or improve how their OpenClaw agent remembers things. Also trigger when discussing memory plugins (Mem0, Supermemory, Cognee), embedding providers, memory file architecture, or memory search relevance tuning. ---
OpenClaw memory is plain Markdown on disk. The files are the single source of truth. The model only "remembers" what gets written to disk — nothing stays in RAM between sessions. Memory search tools are provided by the active memory plugin (default: memory-core).
---
memory/YYYY-MM-DD.mdmemory_search.MEMORY.mdMEMORY.md and memory.md exist, only MEMORY.md is loaded.bootstrapMaxChars).~/.openclaw/workspace/
├── MEMORY.md # Long-term curated memory (main session only)
├── memory/
│ ├── 2026-03-17.md # Today's daily log
│ ├── 2026-03-16.md # Yesterday's log (also auto-loaded)
│ └── ... # Older logs (searchable, not auto-loaded)
├── AGENTS.md # Operating manual, boot sequence
├── SOUL.md # Persona, tone, values
├── USER.md # Human profile
└── TOOLS.md # Environment-specific config
| Content Type | Destination | Why | |---|---|---| | Durable decisions & preferences | MEMORY.md | Loaded every session | | Iron-law rules the agent must always follow | MEMORY.md | Survives compaction | | Today's work notes, events, context | memory/YYYY-MM-DD.md | Append-only log | | One-time instructions | Chat (or daily log) | Ephemeral by design | | Behavioral rules | AGENTS.md or SOUL.md | Always in context |
---
OpenClaw exposes two agent-facing tools:
memory_search — Semantic RecallfinalScore = vectorWeight × vectorScore + textWeight × textScore.memory_get — Targeted File ReadAdd this rule to AGENTS.md:
## Memory Protocol
- ALWAYS run memory_search before acting on tasks that reference past context.
- Do NOT guess from conversation history alone — check your notes.
Without this, the agent guesses instead of checking its memory files.
---
Long conversations fill the context window. When it hits the threshold, OpenClaw compacts (summarizes/truncates) older messages. Anything only in the conversation — including instructions typed in chat — can vanish.
Before compaction fires, OpenClaw triggers a silent agentic turn that reminds the model to write durable notes to disk.
Default config:
{
"agents": {
"defaults": {
"compaction": {
"reserveTokensFloor": 20000,
"memoryFlush": {
"enabled": true,
"softThresholdTokens": 4000,
"systemPrompt": "Session nearing compaction. Store durable memories now.",
"prompt": "Write any lasting notes to memory/YYYY-MM-DD.md; reply with NO_REPLY if nothing to store."
}
}
}
}
}
contextWindow - reserveTokensFloor - softThresholdTokens.sessions.json).NO_REPLY so user doesn't see it.workspaceAccess: "ro" or "none".memoryFlush.enabled = true with enough buffer.---
local — if memorySearch.local.modelPath is configured + file existsopenai — if OpenAI API key is availablegemini — if Gemini API key is availablevoyage — if Voyage API key is availablemistral — if Mistral API key is availableAlso supported: ollama (local/self-hosted, not auto-selected).
Important: Codex OAuth covers only chat/completions — it does NOT work for embeddings. You need a separate API key for your embedding provider.
{
"agents": {
"defaults": {
"memorySearch": {
"provider": "openai",
"model": "text-embedding-3-small",
"query": {
"hybrid": true
}
}
}
}
}
~/.openclaw/memory/.sqlite .---
Vector + Keyword → Weighted Merge → Temporal Decay → Sort → MMR → Top-K Results
Old notes can outrank recent ones by raw similarity. Enable decay to fix this:
Near-duplicate daily logs can crowd out diverse results. MMR removes redundancy:
memory_search returns redundant/near-duplicate snippets.---
For power users who want better search quality:
{
"memory": {
"backend": "qmd",
"citations": "auto",
"qmd": {
"includeDefaultMemory": true,
"update": { "interval": "5m", "debounceMs": 15000 },
"limits": { "maxResults": 6, "timeoutMs": 4000 },
"paths": [
{ "name": "docs", "path": "~/notes", "pattern": "**/*.md" }
]
}
}
}
...
安装 OpenClaw Memory 后,可以对 AI 说这些话来触发它
Help me get started with OpenClaw Memory
Explains what OpenClaw Memory does, walks through the setup, and runs a quick demo based on your current project
Use OpenClaw Memory to manage, optimize, and troubleshoot the OpenClaw memory system — MEMORY
Invokes OpenClaw Memory with the right parameters and returns the result directly in the conversation
What can I do with OpenClaw Memory in my ai agent & automation workflow?
Lists the top use cases for OpenClaw Memory, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/openclaw-mem/ 目录(个人级,所有项目可用),或 .claude/skills/openclaw-mem/(项目级)。重启 AI 客户端后,用 /openclaw-mem 主动调用,或让 AI 根据上下文自动发现并使用。
OpenClaw Memory 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
OpenClaw Memory 可免费安装使用。请查阅仓库了解许可证信息。
Manage, optimize, and troubleshoot the OpenClaw memory system — MEMORY.md curation, daily logs (memory/YYYY-MM-DD.md), memory_search tuning, compaction survi...
OpenClaw Memory 属于「AI Agent & Automation」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my ai agent & automation tasks using OpenClaw Memory
Identifies repetitive steps in your workflow and sets up OpenClaw Memory to handle them automatically