使用 ListMemoryStoreRequests 接口查询记忆库请求审计记录。
前提条件
已创建 AgentStorage 实例且状态为
normal,并获取实例访问地址(endpoint)和实例名。已创建 API Key。
请求记录为审计用途,按 Scope 维度查询。
请求参数
字段 | 类型 | 必填 | 说明 |
| string | 是 | 记忆库名称。 |
| object | 是 | Scope,可按层级使用通配符 |
| string | 否 | 操作名称,例如 |
| int | 否 | 返回数量。 |
| string | 否 | 下一页标记。 |
| string | 否 | 最小时间,RFC3339 格式。 |
| string | 否 | 最大时间,RFC3339 格式。 |
请求示例
使用 API Key 认证时,通过 x-ots-instancename 和 x-ots-apikey 请求头传入实例名和 API Key。
curl -X POST https://<endpoint>/ListMemoryStoreRequests \
-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": "*"
},
"operation": "AddMemories",
"limit": 50
}'响应
字段 | 说明 |
| 请求 ID。 |
| 操作名称。 |
| 请求使用的 Scope。 |
| 请求摘要。 |
| 响应状态。 |
| 处理耗时,单位毫秒。 |
| 操作目标 ID,例如记忆 ID。 |
| 记录创建时间。 |
{
"memoryStoreName": "agent_memory",
"requests": [
{
"requestId": "4b41a912f8c8a66202896e880a505d4a",
"operation": "AddMemories",
"scope": { "appId": "app-001", "tenantId": "user-001", "agentId": "assistant", "runId": "session-001" },
"requestSummary": "acceptedMessages=2",
"responseStatus": 200,
"latencyMs": 120,
"targetId": "98ebdf1de01b620bfa96f55c8925061f",
"createdAt": "2026-06-17T07:19:59.962Z"
}
],
"nextToken": "<next-token>"
}该文章对您有帮助吗?