概述
openclaw memory 管理语义记忆的索引与搜索,由活跃 memory 插件提供(默认 memory-core;设置 plugins.slots.memory = "none" 可禁用)。
openclaw memory status [--deep] [--index] [--fix] [--agent <id>] [--verbose] [--json]
openclaw memory index [--force] [--agent <id>] [--verbose]
openclaw memory search <query> [--max-results N] [--min-score N] [--agent <id>] [--json]
openclaw memory promote [--apply] [--limit N] [--min-score N] [--agent <id>] [--json]
openclaw memory promote-explain <selector> [--agent <id>] [--json]
openclaw memory rem-harness [--agent <id>] [--json]子命令详解
memory status
检查记忆系统状态。
| 选项 | 说明 |
|---|---|
--deep | 探测向量存储、embedding provider、语义搜索就绪状态(不加此项则快速检查,不运行 embedding) |
--index | 若存储脏则重建索引(隐含 --deep) |
--fix | 修复过期的 recall 锁,规范化 promotion 元数据 |
--agent <id> | 限定单个 agent(省略则遍历所有配置的 agent) |
--verbose | 详细日志 |
--json | JSON 输出 |
若显示
Dreaming status: blocked,说明 dreaming cron 已启用但 heartbeat 未触发。
memory index
重建记忆索引。
| 选项 | 说明 |
|---|---|
--force | 强制全量重建 |
--agent <id> | 限定单个 agent |
--verbose | 输出每阶段详情(provider、model、来源、批次活动) |
memory search
语义搜索记忆。
openclaw memory search "meeting notes"
openclaw memory search --query "deployment" --max-results 20 --min-score 0.7--query优先于位置参数;两者都不提供则报错--agent <id>:限定单个 agent(默认:默认 agent)--max-results <n>:限制返回数量--min-score <n>:过滤低分结果
memory promote
预览或应用短期记忆晋升(将 memory/YYYY-MM-DD.md 中的候选写入 MEMORY.md)。
openclaw memory promote # 预览
openclaw memory promote --apply # 写入 MEMORY.md
openclaw memory promote --limit 10 --min-score 0.75晋升评分信号:frequency(频率)、relevance(相关性)、query diversity(查询多样性)、recency(时效性)、consolidation(跨日巩固)、conceptual richness(概念丰富度)。
| 选项 | 说明 |
|---|---|
--apply | 写入 MEMORY.md 并标记已晋升 |
--limit <n> | 最大候选数 |
--min-score <n> | 最低加权晋升分 |
--min-recall-count <n> | 最低 recall 次数 |
--min-unique-queries <n> | 最低不同查询数 |
--include-promoted | 包含已晋升的候选 |
--agent <id> | 限定单个 agent |
memory promote-explain <selector>
解释指定晋升候选的评分明细。<selector> 为候选 key、路径片段或内容片段。
memory rem-harness
预览 REM 反思、候选真相和深度晋升输出,不写入任何内容。
Dreaming(后台记忆巩固)
三个协作阶段:light(整理短期材料)→ REM(反思主题)→ deep(晋升持久事实到 MEMORY.md)。
- 启用:
plugins.entries.memory-core.config.dreaming.enabled: true - 聊天中切换:
/dreaming on|off,查看状态:/dreaming status - 默认调度:每天凌晨 3 点(
0 3 * * *) - 仅 deep 阶段写入
MEMORY.md;human-readable 输出写入DREAMS.md - 深度晋升默认阈值:
minScore=0.8、minRecallCount=3、minUniqueQueries=3
{
"plugins": {
"entries": {
"memory-core": {
"config": { "dreaming": { "enabled": true } }
}
}
}
}相关页面
- memory — 记忆机制概念(文件布局、四种后端)
- dreaming — Dreaming 三阶段详解
- memory-builtin — 默认 SQLite 后端