Skip to main content

Get Event

Query the execution status and results of async add-memory events

GET
/events/{event_id}
cURL
curl --request GET \
  --url 'https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/memory/events/{event_id}' \
  --header 'Authorization: Bearer <YOUR_API_KEY>'
{
  "request_id": "<string>",
  "events": [
    {
      "event_id": "<string>",
      "event_type": "<string>",
      "resource_type": "<string>",
      "resource_id": "<string>",
      "memory_library_id": "<string>",
      "user_id": "<string>",
      "status": "PENDING",
      "created_at": 0,
      "updated_at": 0,
      "result": [
        {
          "memory_type": "observation",
          "content": "<string>",
          "event": "ADD",
          "memory_node_id": "<string>",
          "old_content": "<string>"
        }
      ]
    }
  ]
}
Queries the execution status and results of events generated by Add Memory Async.

Request parameters

ParameterTypeRequiredDescription
event_idstringYesEvent ID (path parameter)

Response

FieldTypeDescription
request_idstringRequest ID
eventsarrayEvent list
events[].event_idstringEvent ID
events[].event_typestringEvent type, for example ADD_ASYNC
events[].resource_typestringTask source type: observation / skill / profile
events[].resource_idstringTask source ID
events[].memory_library_idstringMemory library ID of the task
events[].user_idstringMemory entity ID of the task
events[].statusstringTask status: PENDING / SUCCEEDED / FAILED / UNRECORDED
events[].created_atintegerTask creation timestamp
events[].updated_atintegerTimestamp of the last task status update
events[].resultarrayExecution result, appears after status becomes SUCCEEDED
events[].result[].memory_typestringMemory type: observation / skill / user_profile
events[].result[].contentstringThe added content when event is ADD, the new content when UPDATE, the old content when DELETE
events[].result[].eventstringOperation type: ADD / UPDATE / DELETE
events[].result[].memory_node_idstringMemory node ID. Not present when memory_type is user_profile
events[].result[].old_contentstringContent before update, only present when event is UPDATE

Code examples

Replace {workspaceId} with your actual workspace ID.
cURL
curl -X GET "https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/memory/events/{event_id}" \
  --header "Authorization: Bearer $DASHSCOPE_API_KEY"

# response
{
  "events": [
    {
      "event_id": "07c054c4...",
      "event_type": "ADD_ASYNC",
      "resource_type": "profile",
      "resource_id": "profile_schema_001",
      "status": "PENDING",
      "created_at": 1784602119,
      "updated_at": 1784602161,
      "user_id": "user_001"
    },
    {
      "event_id": "07c054c4...",
      "event_type": "ADD_ASYNC",
      "resource_type": "observation",
      "resource_id": "project_001",
      "status": "SUCCEEDED",
      "result": [
        {"content": "The user wants to go to Africa", "event": "DELETE", "memory_node_id": "3127d744..."}
      ],
      "created_at": 1784602119,
      "updated_at": 1784602150,
      "user_id": "user_001"
    }
  ],
  "request_id": "bb499327-79c6-..."
}
When status is PENDING, the task is still running in the background. Query again later.

Authorizations

string
header
required

Path Parameters

string
required

事件 ID

Response

200-application/json
string
object[]