列出 Memory Version

更新时间:
复制 MD 格式

按创建时间倒序列出记忆库的历史版本。

前提

已完成 Endpoint 与鉴权配置,详见API 总览与认证。

接口

GET/memory_stores/{memory_store_id}/memory_versions

路径参数

memory_store_idstring必填

记忆库 ID

查询参数

memory_idstring可选

仅返回该记忆的版本;不传则返回整个记忆库的版本

operationcreated / modified / deleted可选

按产生版本的操作类型过滤

created_at.gtestring可选

版本产生时间下界(含),ISO 8601 UTC

created_at.ltestring可选

版本产生时间上界(含),ISO 8601 UTC

viewbasic / full可选

basic 不含正文(默认);full 返回未擦除的正文

limitinteger可选

单页条数。basic 为 1-100 默认 20;full 为 1-20

pagestring可选

分页游标。翻页时保持全部查询条件与 limit 不变

响应字段

dataarray<object>

版本数组;view=full 且未擦除时包含正文

idstring

版本 ID,格式 memver_xxx

typestring

固定为 memory_version

memory_store_idstring

所属记忆库 ID

memory_idstring

对应的记忆 ID

operationcreated / modified / deleted

产生该版本的操作类型

pathstring

该版本快照中的路径

contentstring

该版本正文;已擦除时不含此字段

content_sha256string

该版本正文的 SHA256 哈希

content_size_bytesinteger

该版本正文的 UTF-8 字节数

redacted_atstring | null

正文被擦除的时间;未擦除时省略或为 null

created_atstring

版本产生时间,ISO 8601 UTC

next_pagestring | null

下一页游标;无更多数据时不含该字段

请求示例

curl "$AGENTSTUDIO_URL/memory_stores/memstore_xxx/memory_versions" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"

响应示例

{
  "data": [
    {
      "id": "memver_xxx",
      "type": "memory_version",
      "memory_store_id": "memstore_xxx",
      "memory_id": "mem_xxx",
      "operation": "modified",
      "path": "/notes/project.md",
      "content": "# 项目约定\n默认开发环境为预发环境。\n变更需要补充回归测试。\n",
      "content_sha256": "a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90",
      "content_size_bytes": 68,
      "created_at": "2026-09-17T08:30:00Z"
    }
  ],
  "next_page": null
}

错误码

状态码错误码说明
400invalid_request_error参数、路径、limit 或分页游标非法
401InvalidApiKeyAPI Key 缺失、错误或失效
403permission_error身份或资源访问权限不足
404not_found_error资源不存在或不属于当前工作空间