列出请求记录

更新时间:
复制 MD 格式

使用 ListMemoryStoreRequests 接口查询记忆库请求审计记录。

前提条件

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

  • 已创建 API Key。

  • 请求记录为审计用途,按 Scope 维度查询。

请求参数

字段

类型

必填

说明

memoryStoreName

string

是

记忆库名称。

scope

object

是

Scope,可按层级使用通配符 *。

operation

string

否

操作名称,例如 AddMemories 或 SearchMemories。

limit

int

否

返回数量。

nextToken

string

否

下一页标记。

minTimestamp

string

否

最小时间,RFC3339 格式。

maxTimestamp

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
}'

响应

字段

说明

requestId

请求 ID。

operation

操作名称。

scope

请求使用的 Scope。

requestSummary

请求摘要。

responseStatus

响应状态。

latencyMs

处理耗时,单位毫秒。

targetId

操作目标 ID,例如记忆 ID。

createdAt

记录创建时间。

{
  "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>"
}