---
name: "getPanelAgentMemoryList"
mode: "api"
versionRequirements:
  - { name: "@tuya-miniapp/cloud-api", version: "1.0.6" }
---

## getPanelAgentMemoryList

> [VERSION] @tuya-miniapp/cloud-api >= 1.0.6

> 💡 This API requires cloud capabilities. Configure authorization under Development Settings - Cloud Capabilities in the [Mini App Developer Platform](https://platform.tuya.com/miniapp/).

### Description

Query the role memory list.

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `GetPanelAgentMemoryListParams` | Yes | Request body |

### Return Value

Type: `Promise<PanelAgentMemoryGroup[]>`

GetPanelAgentMemoryListResult (See type definitions and minituya return parameters for field meanings)

##### PanelAgentMemoryGroup

| Property | Type | Description |
| --- | --- | --- |
| `effectiveScope` | `number` | Memory scope |
| `effectiveScopeName` | `string` | Memory scope name |
| `memoryList` | `PanelAgentMemoryItem[]` | Memory list |

### Referenced Types

##### `interface` GetPanelAgentMemoryListParams

| Property | Type | Description |
| --- | --- | --- |
| `devId` | `string` | Device ID |
| `bindRoleType` | `0 \| 1 \| 2` | 0 - custom agent role, 1 - agent role template, 2 - default role in a single-role scenario |
| `roleId` | `string` | Role ID (its meaning depends on bindRoleType) |

##### `type` PanelAgentMemoryItem

| Property | Type | Description |
| --- | --- | --- |
| `memoryKey` | `string` | Memory key |
| `memoryValue` | `string` | Memory value |
| `memoryName` | `string` | Memory name |
| `effectiveScope` | `number` | Memory scope |
| `effectiveScopeName` | `string` | Memory scope name |


### Examples

#### Request example

```typescript
import { getPanelAgentMemoryList } from '@tuya-miniapp/cloud-api';

const params = {
  devId: 'your_device_id',
  bindRoleType: 0,
  roleId: 'role_12345',
};

getPanelAgentMemoryList(params)
  .then(result => {
    console.log('Memory list:', result);
  })
  .catch(error => {
    console.error('Failed to get memory list:', error);
  });
```

#### Response example

```json
[
  {
    "effectiveScope": 1,
    "effectiveScopeName": "Global memory",
    "memoryList": [
      {
        "memoryKey": "user_preference",
        "memoryValue": "Likes blue",
        "memoryName": "User preference",
        "effectiveScope": 1,
        "effectiveScopeName": "Global memory"
      }
    ]
  }
]
```
