Permanently removes a memory entry from the user’s memory store. This action cannot be undone.
This operation is irreversible. Once a memory is deleted, it cannot be recovered.
curl -X DELETE 'https://api.memchat.io/memories/mem_123abc' \
-H 'X-API-Key: YOUR_API_KEY'
Path Parameters
The unique identifier of the memory to delete
Query Parameters
Whether to cascade delete related data (e.g., derived insights, profile updates)
Whether to create a backup before deletion (for compliance/audit purposes)
Response
Indicates if the deletion was successful
ISO 8601 timestamp when the memory was deleted
Information about related data that was also deleted (if cascade=true)
Number of profile updates removed
Number of derived insights removed
Number of embedding vectors removed
ID of the backup created (if backup=true)
{
"success": true,
"memory_id": "mem_123abc",
"deleted_at": "2024-01-15T16:45:00Z",
"cascade_deletions": {
"profile_updates": 2,
"derived_insights": 1,
"embeddings": 1
},
"backup_id": "backup_456def"
}
Error Responses
Memory not found{
"error": "Memory not found",
"code": "MEMORY_NOT_FOUND",
"memory_id": "mem_123abc"
}
Unauthorized access{
"error": "Invalid or expired token",
"code": "UNAUTHORIZED"
}
Access denied - memory belongs to another user{
"error": "Access denied",
"code": "FORBIDDEN"
}
Cannot delete - memory is being processed{
"error": "Memory is currently being processed and cannot be deleted",
"code": "DELETION_CONFLICT",
"processing_status": "embedding_generation"
}
Internal server error during deletion{
"error": "Failed to delete memory",
"code": "DELETION_FAILED",
"retry_after": 30
}
Batch Deletion
For deleting multiple memories at once, use the batch endpoint:
POST /memories/batch-delete
{
"memory_ids": ["mem_123abc", "mem_456def", "mem_789ghi"],
"cascade": true,
"backup": true
}
Recovery Options
While deleted memories cannot be restored through the API, backups are created for compliance purposes:
- Backups: Available for 30 days for compliance/audit purposes
- Contact Support: For accidental deletions, contact support with the backup_id
- Data Export: Consider using the data export feature before bulk deletions
Impact on User Profile
Deleting memories may affect:
- Profile Bio: Auto-generated bio may be updated
- Category Profiles: Statistics and insights for the memory’s category
- Derived Insights: Any insights based on the deleted memory
- Search Results: Memory will no longer appear in search results
Use the cascade=true parameter to automatically clean up related data, or cascade=false to preserve derived insights for analysis.