Reclaw Memory System
Reclaw is an append-only event log that replaces daily memory files. It assumes the current OpenClaw environment already has the Reclaw plugin installed. All memory lives in log.jsonl as structured entries. Extraction happens automatically at session end — you don't write to the log directly. Your job is to state information clearly in conversation so the extraction hook captures it.
How Memory Works
- 1. MEMORY.md is auto-loaded into every session. It has a manual section (goals, preferences) and a generated Reclaw memory snapshot updated nightly.
- Reclaw session summary is written into
MEMORY.md after each session extraction. - Subject markdown projections are generated under
~/.openclaw/reclaw/memory/ so OpenClaw can semantically index event-log content through its builtin markdown memory path. memory_search finds entries by keyword, type, subject, or status when the Reclaw plugin has registered that tool in the current OpenClaw environment, and can hit semantic results from MEMORY.md plus generated subject projections.memory_get retrieves a specific entry by ID, reads MEMORY.md, or fetches a full session transcript when the Reclaw plugin has registered that tool in the current OpenClaw environment.
Start with what's already in context (steps 1-3). Only call tools when you need something specific.
Entry Types
| Type | What it captures | Key detail |
|---|
| INLINECODE7 | Action items, follow-ups | Has status: open or INLINECODE10 |
| INLINECODE11 |
User-specific information learned | Preferences, events, observations, milestones |
|
decision | A choice with reasoning | Use
detail for the "why" |
|
question | An unresolved open loop | Resolved by later entries on the same subject |
|
session_summary | Session boundary state | One per session, summarizes what's in-flight |
Subjects
Every non-session_summary entry has a subject — a kebab-case slug like auth-migration or reclaw. Subjects are tracked in a registry with a type: project, person, system, or topic (default).
When discussing something new, use a clear kebab-case slug. The extraction hook auto-creates subjects it hasn't seen. To explicitly manage subjects:
CODEBLOCK0
Using memory_search
Combines structured log filters with keyword search and semantic search over MEMORY.md plus generated subject projections.
CODEBLOCK1
At least one of query, type, subject, or status is required.
Markdown Projections
Reclaw keeps one generated markdown file per subject under ~/.openclaw/reclaw/memory/. These files are derived from log.jsonl and exist so OpenClaw's builtin markdown indexer can semantically search event-log content.
- - Treat projection files as generated output — don't manually edit them
- Successful live extraction refreshes touched subject projections automatically
- Successful non-dry-run imports refresh the full projection set automatically
- If the index seems stale, rebuild with INLINECODE32
Using memory_get
Three lookup modes based on the path value:
CODEBLOCK2
Reading an entry by ID increments its usage score, which helps it persist in the nightly memory snapshot.
Citations
When referencing a prior event in conversation, cite it as [<12-char-id>] (e.g., [r7Wp3nKx_mZe]). This format is tracked for usage scoring — cited entries are more likely to appear in future memory snapshots.
Corrections and Updates
The log is append-only. To correct something:
- - State the correction clearly in conversation. Extraction writes a new entry on the same subject.
- To mark a task done, say so explicitly. Extraction emits a new
task entry with status: "done". - To answer a question, discuss the resolution. Extraction captures the answer as a
fact or decision.
Old entries are never modified. Current state is reconstructed by reading a subject's entries chronologically.
Hard Filter
Only user-specific information belongs in the log. Ask: "Would I need to know this person to know this?" If a general-purpose LLM could produce the content without user context, it should not be extracted. No generic knowledge, no dependency lists, no boilerplate.
CLI Commands
CODEBLOCK3
Reclaw 记忆系统
Reclaw 是一个仅追加的事件日志,用于替代日常记忆文件。它假设当前的 OpenClaw 环境已安装 Reclaw 插件。所有记忆都以结构化条目的形式存储在 log.jsonl 中。提取会在会话结束时自动进行——你无需直接写入日志。你的任务是在对话中清晰地陈述信息,以便提取钩子能够捕获这些内容。
记忆如何工作
- 1. MEMORY.md 会在每个会话中自动加载。它包含一个手动部分(目标、偏好)和一个每晚更新的自动生成的 Reclaw 记忆快照。
- Reclaw 会话摘要 会在每次会话提取后写入 MEMORY.md。
- 主题 Markdown 投影 生成在 ~/.openclaw/reclaw/memory/ 下,以便 OpenClaw 通过其内置的 Markdown 记忆路径对事件日志内容进行语义索引。
- memorysearch 可在 Reclaw 插件在当前 OpenClaw 环境中注册了该工具时,通过关键词、类型、主题或状态查找条目,并能从 MEMORY.md 和生成的主题投影中获取语义结果。
- memoryget 可在 Reclaw 插件在当前 OpenClaw 环境中注册了该工具时,通过 ID 检索特定条目、读取 MEMORY.md 或获取完整的会话记录。
从上下文中已有的内容开始(步骤 1-3)。仅在需要特定内容时才调用工具。
条目类型
| 类型 | 捕获内容 | 关键细节 |
|---|
| task | 行动项、后续事项 | 具有 status:open 或 done |
| fact |
学到的用户特定信息 | 偏好、事件、观察、里程碑 |
| decision | 带有推理的选择 | 使用 detail 记录原因 |
| question | 未解决的开放循环 | 由同一主题的后续条目解决 |
| session_summary | 会话边界状态 | 每个会话一个,总结进行中的内容 |
主题
每个非 session_summary 条目都有一个 subject——一个短横线命名法的标识符,如 auth-migration 或 reclaw。主题在注册表中跟踪,类型包括:project、person、system 或 topic(默认)。
在讨论新内容时,使用清晰的短横线命名法标识符。提取钩子会自动创建它未见过的主题。要显式管理主题:
bash
列出所有主题
openclaw reclaw subjects list
添加带类型的主题
openclaw reclaw subjects add auth-migration --type project
openclaw reclaw subjects add alice-chen --type person
重命名主题(更新注册表和所有日志条目)
openclaw reclaw subjects rename old-slug new-slug
使用 memory_search
结合结构化日志过滤器与关键词搜索,以及对 MEMORY.md 和生成的主题投影的语义搜索。
关键词搜索
memory_search({query: webhook retries})
结构化过滤器
memory_search({type: decision, subject: auth-migration})
memory_search({type: task, status: open})
memory_search({type: question})
组合搜索
memory_search({query: backoff, type: fact, subject: auth-migration})
至少需要 query、type、subject 或 status 中的一个。
Markdown 投影
Reclaw 在 ~/.openclaw/reclaw/memory/ 下为每个主题维护一个生成的 Markdown 文件。这些文件源自 log.jsonl,目的是让 OpenClaw 的内置 Markdown 索引器能够对事件日志内容进行语义搜索。
- - 将投影文件视为生成的输出——不要手动编辑它们
- 成功的实时提取会自动刷新受影响的主题投影
- 成功的非模拟导入会自动刷新完整的投影集
- 如果索引看起来过时,使用 openclaw reclaw projection refresh 重建
使用 memory_get
基于 path 值的三种查找模式:
按条目 ID(来自搜索结果的 12 位 nanoid)
memory
get({path: r7Wp3nKxmZe})
按会话记录(来自条目的 session 字段)
memory_get({path: session:abc123def456})
按文件路径
memory_get({path: MEMORY.md})
按 ID 读取条目会增加其使用评分,这有助于它在夜间记忆快照中持久保存。
引用
在对话中引用先前的事件时,使用 [<12-位-id>] 格式(例如 [r7Wp3nKx_mZe])。此格式用于使用评分跟踪——被引用的条目更有可能出现在未来的记忆快照中。
更正和更新
日志是仅追加的。要更正某些内容:
- - 在对话中清晰地陈述更正内容。提取会在同一主题上写入一个新条目。
- 要将任务标记为已完成,请明确说明。提取会发出一个新的 task 条目,status 为 done。
- 要回答问题,请讨论解决方案。提取会将答案捕获为 fact 或 decision。
旧条目永远不会被修改。当前状态通过按时间顺序读取主题的条目来重建。
严格过滤
只有用户特定的信息才属于日志。问自己:我需要了解这个人才能知道这个吗?如果通用 LLM 可以在没有用户上下文的情况下生成该内容,则不应提取。没有通用知识,没有依赖列表,没有样板内容。
CLI 命令
bash
最近的日志条目
openclaw reclaw log
openclaw reclaw log --type decision --subject auth-migration --limit 10
带过滤器的搜索
openclaw reclaw search webhook
openclaw reclaw search --type task --status open
openclaw reclaw search --subject auth-migration --from 2026-02-01 --to 2026-03-01
追踪主题的时间线历史
openclaw reclaw trace
openclaw reclaw trace --subject auth-migration
openclaw reclaw trace
主题管理
openclaw reclaw subjects list
openclaw reclaw subjects add --type
openclaw reclaw subjects rename
刷新生成的主题 Markdown 投影
openclaw reclaw projection refresh
openclaw reclaw projection list
立即重新生成 MEMORY.md 记忆快照
openclaw reclaw snapshot refresh
从日志强制刷新 MEMORY.md 会话摘要块
openclaw reclaw summary refresh
导入历史对话
openclaw reclaw import
openclaw reclaw import status
openclaw reclaw import resume
设置
openclaw reclaw init
openclaw reclaw verify
openclaw reclaw uninstall