使用 ListMemoryDreamTasks 接口列出结构化记忆或文件记忆 Dream 任务。
前提条件
已创建 AgentStorage 实例且状态为
normal,并获取实例访问地址(endpoint)和实例名。已创建 API Key。
Dream 为异步任务,列表接口返回任务概览,确认单个任务最新状态时请调用
GetMemoryDreamTask。
请求参数
字段 | 类型 | 必填 | 说明 |
| string | 是 | 记忆库名称。 |
| object | 是 | Scope,可按层级使用 |
| string | 否 | 任务状态过滤。 |
| int | 否 | 返回数量,默认 |
| string | 否 | 下一页标记。 |
| string | 否 | 时间范围,Unix 毫秒时间戳(不支持 RFC3339)。 |
请求示例
使用 API Key 认证时,通过 x-ots-instancename 和 x-ots-apikey 请求头传入实例名和 API Key。
curl -X POST https://<endpoint>/ListMemoryDreamTasks \
-H "x-ots-instancename: <instance-name>" \
-H "x-ots-apikey: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"memoryStoreName": "agent_memory",
"scope": {
"appId": "app-001",
"tenantId": "*",
"agentId": "*",
"runId": "*"
},
"limit": 50
}'响应
响应在 tasks 数组中返回任务对象,包含 dreamId、status、taskType、effort、applyMode、actions 和时间信息。文件任务还返回 outputScope、maxItems 和文件输入统计。字段语义参见查询 Dream。
{
"memoryStoreName": "agent_memory",
"tasks": [
{
"dreamId": "2a528008111f5dc3500c73fd965089f7",
"taskType": "memory",
"effort": "low",
"applyMode": "proposal",
"status": "completed",
"actions": {
"total": 2,
"proposed": 2,
"applied": 0,
"skipped": 0,
"failed": 0
},
"createdAt": "2026-06-17T07:21:25.329Z",
"updatedAt": "2026-06-17T07:21:32.276Z",
"finishedAt": "2026-06-17T07:21:32.276Z"
}
],
"nextToken": "<next-token>"
}该文章对您有帮助吗?