DELETE
/
api
/
v1
/
memories
/
delete
/
{memory_id}
Delete Memory
curl --request DELETE \
  --url https://api.agent-mind.com/api/v1/memories/delete/{memory_id} \
  --header 'Authorization: Bearer <token>'

Overview

Delete a specific memory from your agent’s memory bank by its unique identifier. Only memories owned by the API key holder can be deleted. This operation is permanent and cannot be undone.

Path Parameters

memory_id
string
required
The unique identifier of the memory to delete

Response

Returns confirmation of the deletion operation.

Examples

Delete a Memory

import requests

memory_id = "mem_abc123"
url = f"https://api.agent-mind.com/api/v1/memories/delete/{memory_id}"
headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}

response = requests.delete(url, headers=headers)
result = response.json()

Response Example

{
  "status": "success",
  "id": "mem_abc123",
  "message": "Memory deleted successfully",
  "deleted_at": "2024-03-20T14:30:00Z"
}

Error Responses

400 Bad Request

{
  "error": "Invalid memory ID format"
}

401 Unauthorized

{
  "error": "Invalid or missing API key"
}

404 Not Found

{
  "error": "Memory not found or not owned by user"
}

500 Internal Server Error

{
  "error": "Failed to delete memory"
}

Important Notes

  • Deletion is permanent and cannot be undone
  • Only the owner of a memory can delete it
  • Attempting to delete a non-existent memory returns 404
  • Consider using TTL (time-to-live) when creating memories for automatic expiration
  • Deleted memory IDs cannot be reused