Query Memory List

Last Updated on : 2026-02-26 09:17:13download

Based on the device ID, query the memory list for the specified AI agent role.

API address

GET: /v1.0/cloud/agent/ai/chat/b/devices/{device_id}/memories

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringpathtrueThe ID of the specified device.
bind_role_typeIntegerquerytrueThe type of role to bind. Valid values:
  • 0: Custom role
  • 1: Template-based role
  • 2: Single role (There is no role, and data is at the agent level)
When role_id has a value, this parameter value must be passed.
role_idStringquerytrueThe ID of the specified role.

Return parameter

Parameter nameTypeDescription
effective_scope_nameStringThe effective scope name of the memory.
effective_scopeIntegerThe ID of the memory scope.
memory_listListThe list of memory information.

Description of memory_list

Parameter nameTypeDescription
memory_valueStringThe memory content.
memory_keyStringThe memory key.
memory_nameStringThe memory name.
effective_scope_nameStringThe effective scope name of the memory.
effective_scopeIntegerThe ID of the memory scope.

Request example

GET: /v1.0/cloud/agent/ai/chat/b/devices/{device_id}/memories
{
  "device_id": "6c3585ebfe301b40a8u***",
  "bind_role_type": 1,
  "role_id": "94300***"
}

Return example

[
    {
        "effective_scope_name": "Role's memory",
        "memory_list": [
            {
                "memory_value": "Playing football, playing basketball, writing code, reading",
                "memory_name": "Hobbies",
                "effective_scope_name": "Role's memory",
                "memory_key": "sys.memoryInterests",
                "effective_scope": 3
            },
            {
                "memory_value": "100 years old",
                "memory_name": "Age",
                "effective_scope_name": "Role's memory",
                "memory_key": "sys.memoryAge",
                "effective_scope": 3
            },
            {
                "memory_value": "July 7",
                "memory_name": "Birthday",
                "effective_scope_name": "Role's memory",
                "memory_key": "sys.memoryBirthday",
                "effective_scope": 3
            },
            {
                "memory_value": "Tuyaya",
                "memory_name": "Name",
                "effective_scope_name": "Role's memory",
                "memory_key": "sys.memoryUserFullName",
                "effective_scope": 3
            }
        ],
        "effective_scope": 3
    }
]

Error code

For more information, see error code.