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

## deletePanelAgentMemory

> [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

Delete role memory.

### Parameters

`Params`

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

### Return Value

Type: `Promise<boolean>`

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

### Referenced Types

##### `interface` DeletePanelAgentMemoryParams

| 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) |
| `clearAllMemory` | `boolean` | Whether to clear all memory |
| `memoryKeys` | `string` | memoryKey of memories to delete (comma-separated) |


### Examples

#### Request example

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

// Delete specified memories
const params1 = {
  devId: 'your_device_id',
  bindRoleType: 0,
  roleId: 'role_12345',
  clearAllMemory: false,
  memoryKeys: 'memory_001,memory_002',
};

// Clear all memories
const params2 = {
  devId: 'your_device_id',
  bindRoleType: 0,
  roleId: 'role_12345',
  clearAllMemory: true,
};

deletePanelAgentMemory(params1)
  .then(result => {
    console.log('Delete result:', result);
  })
  .catch(error => {
    console.error('Failed to delete memories:', error);
  });
```

#### Response example

```json
true
```
