# Memories ## Forget a memory **delete** `/v4/memories` Forget (soft delete) a memory entry. The memory is marked as forgotten but not permanently deleted. ### Body Parameters - `containerTag: string` Container tag / space identifier. Required to scope the operation. - `id: optional string` ID of the memory entry to operate on - `content: optional string` Exact content match of the memory entry to operate on. Use this when you don't have the ID. - `reason: optional string` Optional reason for forgetting this memory ### Returns - `id: string` ID of the memory that was forgotten - `forgotten: boolean` Indicates the memory was successfully forgotten ### Example ```http curl https://api.supermemory.ai/v4/memories \ -X DELETE \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" ``` #### Response ```json { "id": "mem_abc123", "forgotten": true } ``` ## Update a memory (creates new version) **patch** `/v4/memories` Update a memory by creating a new version. The original memory is preserved with isLatest=false. ### Body Parameters - `containerTag: string` Container tag / space identifier. Required to scope the operation. - `newContent: string` The new content that will replace the existing memory - `id: optional string` ID of the memory entry to operate on - `content: optional string` Exact content match of the memory entry to operate on. Use this when you don't have the ID. - `forgetAfter: optional string` ISO 8601 datetime string. The memory will be auto-forgotten after this time. Pass null to clear an existing expiry. Omit to inherit from the previous version. - `forgetReason: optional string` Optional reason for the scheduled forgetting. Cleared automatically when forgetAfter is set to null. - `metadata: optional map[string or number or boolean or array of string]` Optional metadata. If not provided, inherits from the previous version. - `string` - `number` - `boolean` - `array of string` - `temporalContext: optional object { documentDate, eventDate }` Structured temporal metadata. Merged into the metadata JSON column. If omitted, existing temporalContext is preserved. - `documentDate: optional string` Date the document was authored - `eventDate: optional array of string` Dates of events referenced in the memory ### Returns - `id: string` ID of the newly created memory version - `createdAt: string` When this memory version was created - `forgetAfter: string` When this memory will be auto-forgotten, or null if no expiry - `forgetReason: string` Reason for the scheduled forgetting, or null - `memory: string` The content of the new memory version - `parentMemoryId: string` ID of the memory this version updates - `rootMemoryId: string` ID of the first memory in this version chain - `version: number` Version number of this memory entry ### Example ```http curl https://api.supermemory.ai/v4/memories \ -X PATCH \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" \ -d '{ "containerTag": "user_123", "newContent": "John now prefers light mode", "id": "mem_abc123", "content": "John prefers dark mode", "forgetAfter": "2026-06-01T00:00:00Z", "forgetReason": "temporary project deadline" }' ``` #### Response ```json { "id": "mem_xyz789", "createdAt": "createdAt", "forgetAfter": "forgetAfter", "forgetReason": "forgetReason", "memory": "John now prefers light mode", "parentMemoryId": "mem_abc123", "rootMemoryId": "mem_abc123", "version": 2 } ``` ## Domain Types ### Memory Forget Response - `MemoryForgetResponse object { id, forgotten }` Response after forgetting a memory - `id: string` ID of the memory that was forgotten - `forgotten: boolean` Indicates the memory was successfully forgotten ### Memory Update Memory Response - `MemoryUpdateMemoryResponse object { id, createdAt, forgetAfter, 5 more }` Response after updating a memory - `id: string` ID of the newly created memory version - `createdAt: string` When this memory version was created - `forgetAfter: string` When this memory will be auto-forgotten, or null if no expiry - `forgetReason: string` Reason for the scheduled forgetting, or null - `memory: string` The content of the new memory version - `parentMemoryId: string` ID of the memory this version updates - `rootMemoryId: string` ID of the first memory in this version chain - `version: number` Version number of this memory entry