Skip to main content

DELETE /memory/

Delete a specific memory by its unique identifier.

Path Parameters

string
required
The unique identifier of the memory to delete.

Response

boolean
Indicates whether the operation was successful.
object
Confirmation of the deletion operation.

Example Request

Example Response

Error Responses

string
Error message describing what went wrong.
500 Internal Server Error

DELETE /memory/user/

Delete all memories for a specific user. This is a destructive operation that removes all stored memories associated with the user ID.
This operation is irreversible. All memories for the user will be permanently deleted.

Path Parameters

string
required
The unique identifier of the user whose memories should be deleted.

Response

boolean
Indicates whether the operation was successful.
object
Confirmation of the deletion operation.

Example Request

Example Response

Use Cases

User Account Deletion When a user deletes their account, remove all their memories:
Privacy Compliance Handle GDPR “right to be forgotten” requests:
Testing & Development Clear test data between test runs:

Selective Deletion

Currently, the API doesn’t support selective deletion by memory type (e.g., delete only SHORT_TERM memories). To achieve this, you would need to:
  1. Search for memories with the specific type filter
  2. Delete each memory individually using /memory/{memory_id}
Example: Delete All Short-Term Memories

Error Responses

500 Internal Server Error
Common Error Scenarios
  1. Invalid Memory ID: The provided memory doesn’t exist (single delete)
  2. User Not Found: No memories found for the user ID (user delete)
  3. Database Connection: Failure to connect to the vector store
  4. Partial Deletion: Some memories deleted but operation failed partway through

Implementation Details

  • Single Delete Source: backend/main.py:332
  • User Delete Source: backend/main.py:344
  • Cascade Deletion: Removes vectors from Supabase and relationships from Neo4j (if enabled)
  • Atomic Operations: Single deletes are atomic; user deletes may be partial on errors