OpenClaw Memory Knowledge skill
Hook and skill for OpenClaw: reorganize the memory and knowledge folders into L0/L1/L2 layers with a relation graph
- 128 ★ on the repository
- Last commit
Extended access
Why this level
- The hook runs in every new session and restructures the agent's memory.
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/openclaw-memory-knowledgeDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The hook runs in every new session and restructures the agent's memory.
This is third-party code. Review the repository files before installing.
What it does
The tool rebuilds the memory and knowledge of an OpenClaw agent into one layered structure. Old `memory/*.md` files stay untouched, and the new structure is created beside them in the `.adaptr-v1/` directory. Content is sorted into eight buckets: people, preferences, events, skills, facts and others. Each bucket gets L0, L1 and L2 indexes, from short summaries to atomic records. Entities and relations are extracted from the text to form a queryable knowledge graph. New data is ingested incrementally by version replacement, and profiles, events and working memory get different lifetimes: permanent, 90 and 7 days. Periodic self-repair removes duplicates and checks consistency. Before the first rebuild the old data is copied to a neighboring directory.
Who it is for. OpenClaw users whose memory folder has grown, whose `MEMORY.md` gets truncated and whose memory search misses entries.
Good fit when
- `MEMORY.md` hits its limit and new entries get truncated.
- One topic is scattered across three diary files and search finds only one.
- A knowledge directory without a common structure needs to be linked with a graph.
- New notes should be deduplicated automatically when added.
Not a fit when
- You do not use OpenClaw: the hook and trigger are tied to its workspace.
- Memory is nearly empty and there is nothing to rebuild yet.
- You need a vector database with an external embedding service.
Example request
Install this hook, rebuild my memory and show the report from `last_status.json`.Limitations
The tool works only in OpenClaw and runs at every new session through a hook: the first rebuild is full and later runs handle changes. Success is checked through the `last_status.json` file written after a run. Deduplicating search relies on OpenClaw's built-in `memory search`, so no external embedding service is needed. The description is mostly in Chinese, with an English version. The repository does not state a license. Before using it, check the backup of the old memory and do not run the rebuild without one.
How to disable. Remove the hook and skill from the OpenClaw workspace. Delete the `.adaptr-v1/` directory and the copy of old data by hand if the structure is no longer needed.
FAQ
How do I install the hook?
Send OpenClaw the `memory-knowledge-auto-migrate-hook.zip` archive and ask it to install the hook. The agent reads `INSTALL.md` inside the archive and installs it.
How do I check that the rebuild worked?
Open a new session, wait one to three minutes and find `.adaptr-v1/state/last_status.json`. A `summary.status` of `ok` means success.
What happens to my old files?
Original `memory/*.md` files stay untouched. Before the first rebuild old data is copied to a neighboring directory.
Can it run without the hook?
Yes, a manual mode handles a one-time rebuild. The main script entry is `python scripts/auto_migrate.py`.
Is an external embedding service required?
No. Neither an external embedding HTTP service nor third-party Python dependencies are required.
Discussion
No questions or reviews yet.
Related
SkillsA memory skill that stores turns, facts and episodes, verifies recall and refreshes stale entries, with an OpenClaw plugin.
Self-Improving Agent
self-improving-agent
Skill for OpenClaw: the agent logs errors, corrections and missing features to .learnings files and promotes verified lessons into workspace memory
A long-term memory plugin for the OpenClaw agent on LanceDB: captures preferences and decisions itself, hybrid search, noise fading
Long-term memory for AI agents: a skill and the mindmemos command store facts from conversations and recall them in later sessions
hipocampus gives an agent file-based memory: a 3,000-token topic index loads each session and shows what came up before
ClawMem gives Claude Code, OpenClaw and Hermes local memory: note search, session hooks and a 33-tool MCP server with no API keys
README in short
The project adapts agent memory research ideas (AdaMem and others) to a local file-based implementation for OpenClaw and explains the simplifications.
README badge
Original SKILL.md
--- name: openclaw-memory-knowledge description: 在 OpenClaw 中执行 memory/knowledge 的深度重构与持续增量入库。用于以下场景:已有 memory/knowledge 数据分散且结构混乱;需要一次性迁移到统一分层架构;需要后续新增数据自动按相同架构入库并去重;需要生成可审计报告以便排查与回滚。 triggers: - 用户上传文件名匹配 memory-knowledge-auto-migrate-hook.zip 或 memory-knowledge-auto-migrate-hook-*.zip 的压缩包,且明确表达“安装”意图 --- # OpenClaw Memory Knowledge ## 概览 这个 skill 负责两类事情: 1. 读取并重构已有 `memory/`、`knowledge/`,统一写入 AdaMem-lite + OpenViking 分层结构。 2. 对后续新增或变更内容做增量入库、版本替换、检索增强去重和自修复。 在当前版本里,除了原有 8 桶与 L0/L1/L2,还会额外生成: - `layers/profile_snapshot.json` - `layers/preferences_snapshot.json` - `layers/retrieval_protocol.json` 并为每条 L2 记录补齐: - `memory_function` - `formation_mode` - `trust_tier` - `memory_policy` 默认运行入口: ```bash python scripts/auto_migrate.py ``` 这条命令会自动发现 OpenClaw 工作区并决定: - 首次执行:`bootstrap` - 后续执行:`ingest` - apply 后:仅在有实质变更时执行 `self_evolve` 依赖边界: - 不依赖任何外部 embedding HTTP 服务 - 检索增强去重依赖 OpenClaw 原生 `memory search` - Python 侧无第三方 pip 依赖 ## 首次安装 当用户上传 `memory-knowledge-auto-migrate-hook.zip` 或 `memory-knowledge-auto-migrate-hook-*.zip`,且明确要求安装时: