全部产品
Search
文档中心

表格存储:更新记忆库

更新时间:Oct 21, 2026

使用 UpdateMemoryStore 接口更新记忆库的描述、抽取指令或输出类型。接口采用 PATCH 语义:仅更新请求中提供的字段,未提供的字段保持不变。

前提条件

  • 已创建 AgentStorage 实例且状态为 normal,并获取实例访问地址(endpoint)和实例名。

  • 已创建 API Key。

  • 目标记忆库已存在;inputType 创建后不可修改,本接口不接受该字段。

请求参数

字段

类型

必填

说明

memoryStoreName

string

是

记忆库名称。

description

string

否

新描述,最长 1024 字节(UTF-8);传空字符串清除。

extractInstructions

string

否

新的自定义抽取指令,最长 4096 个字符;传空字符串清除。

outputTypes

array

否

完整替换当前输出类型集合。

  • messages 输入支持 ["structured"]、["file"] 或 ["structured", "file"];

  • file 输入仅支持 ["file"]。

inputType 创建后不可修改,因此本接口不接受该字段。更新成功后的响应结构与 GetMemoryStore 相同。

请求示例

使用 API Key 认证时,通过 x-ots-instancename 和 x-ots-apikey 请求头传入实例名和 API Key。

curl -X POST https://<endpoint>/UpdateMemoryStore \
  -H "x-ots-instancename: <instance-name>" \
  -H "x-ots-apikey: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
  "memoryStoreName": "agent_memory",
  "outputTypes": ["structured", "file"]
}'

只更新描述:

{
  "memoryStoreName": "agent_memory",
  "description": "用于购物助手的对话记忆"
}