参考MCP 工具remember

Tool Reference

remember

仅在满足 capture policy、scope 和 secret-redaction 边界后写入持久 memory。

确认写入已落地

不要只相信写入响应;通过带 scope 的 search 重新读取 memory。

search_memory({
  query: "OAuth for hosted ChatGPT connections",
  limit: 3
})

公开 MCP 工具

remember

用途

保存已批准的 agent 之后应能检索到的持久信息。这是直接的 durable-write API;事件流在调用它之前应先经过 capture policy。

适用场景

  • 用户明确要求保存持久 fact、偏好、decision 或经过审核的 handoff note。
  • 这项信息在当前 chat 或 task 结束后仍然有用。
  • 调用者能够提供所属 path 以及已授权的 project、scope 或 team boundary。

不适用场景

  • 不要存储临时 chat 指令、一次性答案或高容量原始 tool output。
  • 不要持久化 password、bearer token、API key 或 private-key material;先 redact 或拒绝 secret。
  • 不要用 generic memory 保存 financial record;transaction 和 reminder 应使用 ledger。
  • REST API 接受的 field set 比 public MCP tool 更宽;scope、bucket、team 和 provenance filter 见 /docs/api/memory。

所需权限范围

  • public MCP write surface 需要 memory:write。
  • 经过认证的 owner 必须获准写入 resolved path/scope;team write 还需要 team membership。

参数列表

参数名类型描述
contentstring · 必填持久 memory body。保持事实性、范围明确且不含 secret。
pathstring · 必填用于将 memory 关联到 project 或持久 namespace 的逻辑位置。
create_projectboolean · 默认值: false仅适用于 Generic public profile:当 path 暗示某个 project 时创建所属 project。ChatGPT 或 Claude plugin profile 不接受此参数。

返回模式

成功文本包含已保存 memory 的 reference/ID、逻辑 path、writer identity、account 和 device label。Public client 应将 reference 视为 opaque identifier。

使用示例

保存明确的持久 decision
remember({
  content: "Use OAuth for hosted ChatGPT connections.",
  path: "projects/memory-os/decisions"
})

错误信息

  • 401/403:MCP token 缺失或不包含 memory:write。
  • Validation failure:content 或 path 为空,提供了 malformed JSON,或某个值违反 storage contract。
  • Authorization failure:调用者无权写入请求的 scope、project 或 team。
  • Safety rejection:类似 secret 的 content 或保留的 identity metadata 被阻止或清理。
  • recall — 保存持久 fact 后获取少量相关 memory。
  • recall_context — 在后续 task 前构建有界的 context pack。
  • ledger — 使用受治理的 Ledger record,而不是 generic memory。

来源: MCP 工具界面