Skip to main content
DELETE
/
v1
/
memories
Python
# To use the Python SDK, install the package:
# pip install mem0ai

from mem0 import MemoryClient
client = MemoryClient(api_key="your_api_key", org_id="your_org_id", project_id="your_project_id")

# Delete all memories for a specific user
client.delete_all(user_id="<user_id>")

# Delete all memories for every user in the project (wildcard)
client.delete_all(user_id="*")

# Full project wipe — all four filters must be explicitly set to "*"
client.delete_all(user_id="*", agent_id="*", app_id="*", run_id="*")

# NOTE: Calling delete_all() with no filters raises a validation error.
# At least one filter is required to prevent accidental data loss.
{
  "message": "Memories deleted successfully!"
}

Authorizations

Authorization
string
header
required

API key authentication. Prefix your Mem0 API key with 'Token '. Example: 'Token your_api_key'

Query Parameters

user_id
string

Filter by user ID. Pass * to delete memories for all users.

agent_id
string

Filter by agent ID. Pass * to delete memories for all agents.

app_id
string

Filter by app ID. Pass * to delete memories for all apps.

run_id
string

Filter by run ID. Pass * to delete memories for all runs.

metadata
object

Filter memories by metadata (JSON string).

org_id
string

Filter memories by organization ID.

project_id
string

Filter memories by project ID.

Response

204 - application/json

Successful deletion of memories.

message
string
Example:

"Memories deleted successfully!"