Install
openclaw skills install agent-memory-localLocal-first memory retrieval for Agent/OpenClaw workspaces. Use when the user asks about prior work, decisions, dates, preferences, root causes, todo history, or "what changed" questions and you want explainable retrieval from MEMORY.md + memory/*.md instead of a remote memory platform. Best for Markdown-based long-term memory, local audits, postmortems, and continuity across long-running assistant sessions.
openclaw skills install agent-memory-localSearch and explain facts from MEMORY.md and memory/*.md in a local workspace.
agent-memory-local gives an agent a transparent, local-first memory layer for questions like “我们上次怎么定这个规则的?” or “昨天为什么飞书断联?” without depending on a hosted memory service.
Production note: this retrieval style has already been used in real OpenClaw operating workflows behind jisuapi.com and jisuepc.com. That is a proof point, not a dependency.
Use this skill when you want to:
Best fit:
python custom-skills/agent-memory-local/scripts/agent_memory_local.py build-index
python custom-skills/agent-memory-local/scripts/agent_memory_local.py smart-query "飞书昨天为什么断联了" -k 3
python custom-skills/agent-memory-local/scripts/agent_memory_local.py build-index
python custom-skills/agent-memory-local/scripts/agent_memory_local.py query "昨天更新后为什么记忆搜索变了" -k 6
python custom-skills/agent-memory-local/scripts/agent_memory_local.py smart-query "飞书昨天为什么断联了" -k 6
python custom-skills/agent-memory-local/scripts/agent_memory_local.py smart-query "What changed in our memory retrieval route after yesterday's update?" -k 6
python custom-skills/agent-memory-local/scripts/agent_memory_local.py doctor
python custom-skills/agent-memory-local/scripts/agent_memory_local.py explain "飞书昨天为什么断联了" --smart -k 3
python custom-skills/agent-memory-local/scripts/agent_memory_local.py explain "Why did Feishu disconnect yesterday?" --smart -k 3
Use a different memory system if you need:
MEMORY.mdmemory/learnings.md (if present)memory/YYYY-MM-DD.md.memory-index/ under the workspace rootReturns:
explain view for cleaner public-facing reasoning outputThis makes it useful when the user asks:
The retriever is tuned for queries like:
飞书 掉线记忆搜索 变了主路由 默认入口截图 宿主duplicate plugin idgateway timeoutIt boosts domain phrases, recency, and strong anchors instead of relying only on generic vector similarity.
smart-query rewrites and scores multiple candidate queries automatically.
This helps with fuzzy questions like:
If SILICONFLOW_API_KEY is available, retrieval can optionally rerank the best candidates via SiliconFlow rerank.
If the key is missing, the skill still works locally.
Example command:
python custom-skills/agent-memory-local/scripts/agent_memory_local.py explain "飞书昨天为什么断联了" --smart -k 2
Example result shape:
{
"query": "飞书昨天为什么断联了",
"used_query": "飞书 断联 duplicate plugin id gateway timeout",
"results": [
{
"rank": 1,
"file": "memory/2026-03-10-request-timed-out-before-a-res.md",
"score": 0.5084,
"why_matched": {
"anchor_hits": ["duplicate plugin id", "gateway timeout", "断联", "飞书"],
"overlap_terms": ["duplicate", "duplicate plugin id", "gateway", "gateway timeout"]
}
}
]
}
This is the point of the skill: not just “some memory results”, but a query rewrite + top hits + an explanation of why they matched.
smart-queryMEMORY.md / memory/*.mdbuild-indexdoctor to confirm index freshnessquery / smart-query as the workspace memory routedoctorbuild-indexquerysmart-queryThe scripts resolve the workspace in this order:
--workspace /path/to/workspace CLI argAGENT_MEMORY_WORKSPACE env varAGENT_MEMORY_WORKSPACE — force the workspace rootMEMORY_AUTO_REBUILD=0|1 — disable/enable auto rebuild when staleMEMORY_RERANK=0|1 — disable/enable rerankSILICONFLOW_API_KEY — enable rerank enhancementUse --workspace when running outside the target repo and you want deterministic workspace selection.
The index is stored in .memory-index/ at the resolved workspace root, not inside the skill folder.
Examples:
/repo/project → index at /repo/project/.memory-index/E:/openclaw/.openclaw/workspace → index at E:/openclaw/.openclaw/workspace/.memory-index/Rebuild manually when:
MEMORY.md or memory/*.md changed and you want immediate freshnessdoctor reports a stale indexIf MEMORY_AUTO_REBUILD=1, query flows may rebuild automatically when the index is stale.
agent_memory_local.py — top-level CLI entrypointbuild_index.py — builds .memory-index/retrieve.py — direct retrieval enginememory_query.py — smart rewrite + best-query selectordoctor.py — health / freshness checkerexplain.py — cleaner explanation view for why results matchedbenchmark.py — regression benchmark runner against representative memory queriescommon.py — workspace and path resolution helpersarchitecture.md — design notes and tradeoffspublish-plan.md — packaging / release checklist for ClawHubUse agent-memory-local when you want:
Prefer heavier systems (Mem0 / Letta / Graphiti / Zep-style approaches) when you need: