Skip to content

openclaw memory

管理语义记忆的索引与搜索。 由活跃的记忆插件提供(默认:memory-core;设置 plugins.slots.memory = "none" 可禁用)。

相关文档:

示例

bash
openclaw memory status
openclaw memory status --deep
openclaw memory index --force
openclaw memory search "meeting notes"
openclaw memory search --query "deployment" --max-results 20
openclaw memory status --json
openclaw memory status --deep --index
openclaw memory status --deep --index --verbose
openclaw memory status --agent main
openclaw memory index --agent main --verbose

选项

memory statusmemory index

  • --agent <id>:限定到单个 agent。不指定时,这些命令会针对每个已配置的 agent 运行;如果没有配置 agent 列表,则回退到默认 agent。
  • --verbose:在探测和索引期间输出详细日志。

memory status

  • --deep:探测向量存储和嵌入可用性。
  • --index:如果存储有脏数据则运行重建索引(隐含 --deep)。
  • --json:输出 JSON 格式。

memory index

  • --force:强制完整重建索引。

memory search

  • 查询输入:传递位置参数 [query]--query <text>
  • 两者都提供时,--query 优先。
  • 两者都未提供时,命令会报错退出。
  • --agent <id>:限定到单个 agent(默认:默认 agent)。
  • --max-results <n>:限制返回结果数量。
  • --min-score <n>:过滤掉低分匹配。
  • --json:输出 JSON 格式。

注意事项

  • memory index --verbose 打印每个阶段的详情(提供者、模型、来源、批次活动)。
  • memory status 包含通过 memorySearch.extraPaths 配置的任何额外路径。
  • 如果有效活跃的记忆远程 API 密钥字段被配置为 SecretRef,命令会从活跃的 gateway 快照中解析这些值。如果 gateway 不可用,命令会快速失败。
  • Gateway 版本偏差说明:此命令路径需要支持 secrets.resolve 的 gateway;旧版 gateway 会返回未知方法错误。

养龙虾经验:记忆功能是让你的龙虾越用越聪明的关键——定期执行 openclaw memory index --force 确保所有对话记录都被正确索引,后续搜索时才能精准命中。