Delete Memory
Updated at:
Delete a specified memory node
Deletes a specified memory node.
WarningDeletion is irreversible. Proceed with caution.
Method and endpoint
DELETE https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/memory/memory_nodes/{memory_node_id}
Replace {WorkspaceId} with your actual workspace ID.
Request parameters
| Parameter | Type | Required | Location | Description |
|---|---|---|---|---|
memory_node_id | string | Yes | Path | Memory node ID |
memory_library_id | string | No | Query | Memory library ID. If omitted, the default memory library is used |
Response
| Field | Type | Description |
|---|---|---|
request_id | string | Request ID |
Request example
curl --location --request DELETE 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/memory/memory_nodes/42dfc089dfa7409889966960a95c3b7e?memory_library_id=memory_library_001' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"
from agentscope_runtime.tools.modelstudio_memory import (
DeleteMemory, DeleteMemoryInput,
)
import asyncio
async def main():
delete_memory = DeleteMemory()
try:
await delete_memory.arun(DeleteMemoryInput(
user_id="user_001",
memory_node_id="MEMORY_NODE_ID"
))
print("Memory deleted successfully")
finally:
await delete_memory.close()
asyncio.run(main())
Response example
{
"request_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab"
}
ImportantFor user profile APIs, see Create Profile Schema.
Is this page helpful?