All Products
Search
Document Center

Tablestore:Delete memory

Last Updated:Sep 24, 2026

Use the DeleteMemory interface to delete a single long-term memory.

Prerequisites

  • An AgentStorage instance has been created and is in the normal state, and the instance endpoint and instance name have been obtained.

  • An API Key has been created.

  • Scope rule: scope is optional. When provided, all four fields (appId, tenantId, agentId, and runId) are required, and the wildcard * is not allowed.

Request parameters

Field

Type

Required

Description

memoryStoreName

string

Yes

The name of the memory store.

memoryId

string

Yes

The memory ID.

scope

object

No

The optional full Scope used to verify memory ownership. When provided, all four fields are required, and the wildcard * is not allowed.

Request example

When using API Key authentication, pass the instance name and API Key through the x-ots-instancename and x-ots-apikey request headers.

curl -X POST https://<endpoint>/DeleteMemory \
  -H "x-ots-instancename: <instance-name>" \
  -H "x-ots-apikey: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"memoryStoreName":"agent_memory","memoryId":"<memory-id>","scope":{"appId":"app-001","tenantId":"user-001","agentId":"assistant","runId":"session-001"}}'

Response

Field

Description

deleted

Whether the deletion succeeded.

memoryId

The ID of the deleted memory.

memoryStoreName

The name of the memory store.

{
  "deleted": true,
  "memoryId": "1b88d0d65a5b6c0d9142e9b7c7347048",
  "memoryStoreName": "agent_memory"
}