读取单个记忆,包含正文。
前提
已完成 Endpoint 与鉴权配置,详见API 总览与认证。
接口
GET
/memory_stores/{memory_store_id}/memories/{memory_id}路径参数
memory_store_idstring必填记忆库 ID
memory_idstring必填记忆 ID
响应字段
idstring记忆 ID,格式 mem_xxx
typestring固定为 memory
memory_store_idstring所属记忆库 ID
pathstring记忆库内路径,以 / 开头
contentstring正文,UTF-8 文本;view=full 或单条读取时返回
content_sha256string正文的 SHA256 哈希,可用作条件更新的乐观锁
content_size_bytesinteger正文的 UTF-8 字节数
memory_version_idstring当前版本 ID,格式 memver_xxx
created_atstring创建时间,ISO 8601 UTC
updated_atstring最近更新时间,ISO 8601 UTC
请求示例
curl "$AGENTSTUDIO_URL/memory_stores/memstore_xxx/memories/mem_xxx" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
响应示例
{
"id": "mem_xxx",
"type": "memory",
"memory_store_id": "memstore_xxx",
"path": "/notes/project.md",
"content": "# 项目约定\n默认开发环境为预发环境。\n",
"content_sha256": "e3b0c44b98fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"content_size_bytes": 47,
"memory_version_id": "memver_xxx",
"created_at": "2026-09-17T08:00:00Z",
"updated_at": "2026-09-17T08:00:00Z"
}
错误码
| 状态码 | 错误码 | 说明 |
|---|---|---|
| 401 | InvalidApiKey | API Key 缺失、错误或失效 |
| 403 | permission_error | 身份或资源访问权限不足 |
| 404 | not_found_error | 资源不存在或不属于当前工作空间 |
该文章对您有帮助吗?