# Memories ## Forget a memory `client.memories.forget(MemoryForgetParamsbody, RequestOptionsoptions?): MemoryForgetResponse` **delete** `/v4/memories` Forget (soft delete) a memory entry. The memory is marked as forgotten but not permanently deleted. ### Parameters - `body: MemoryForgetParams` - `containerTag: string` Container tag / space identifier. Required to scope the operation. - `id?: string` ID of the memory entry to operate on - `content?: string` Exact content match of the memory entry to operate on. Use this when you don't have the ID. - `reason?: string` Optional reason for forgetting this memory ### Returns - `MemoryForgetResponse` Response after forgetting a memory - `id: string` ID of the memory that was forgotten - `forgotten: boolean` Indicates the memory was successfully forgotten ### Example ```typescript import Supermemory from 'supermemory'; const client = new Supermemory({ apiKey: process.env['SUPERMEMORY_API_KEY'], // This is the default and can be omitted }); const response = await client.memories.forget({ containerTag: 'user_123' }); console.log(response.id); ``` #### Response ```json { "id": "mem_abc123", "forgotten": true } ``` ## Update a memory (creates new version) `client.memories.updateMemory(MemoryUpdateMemoryParamsbody, RequestOptionsoptions?): MemoryUpdateMemoryResponse` **patch** `/v4/memories` Update a memory by creating a new version. The original memory is preserved with isLatest=false. ### Parameters - `body: MemoryUpdateMemoryParams` - `containerTag: string` Container tag / space identifier. Required to scope the operation. - `newContent: string` The new content that will replace the existing memory - `id?: string` ID of the memory entry to operate on - `content?: string` Exact content match of the memory entry to operate on. Use this when you don't have the ID. - `forgetAfter?: string | null` 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?: string | null` Optional reason for the scheduled forgetting. Cleared automatically when forgetAfter is set to null. - `metadata?: Record>` Optional metadata. If not provided, inherits from the previous version. - `string` - `number` - `boolean` - `Array` - `temporalContext?: TemporalContext` Structured temporal metadata. Merged into the metadata JSON column. If omitted, existing temporalContext is preserved. - `documentDate?: string | null` Date the document was authored - `eventDate?: Array | null` Dates of events referenced in the memory ### Returns - `MemoryUpdateMemoryResponse` Response after updating a memory - `id: string` ID of the newly created memory version - `createdAt: string` When this memory version was created - `forgetAfter: string | null` When this memory will be auto-forgotten, or null if no expiry - `forgetReason: string | null` Reason for the scheduled forgetting, or null - `memory: string` The content of the new memory version - `parentMemoryId: string | null` ID of the memory this version updates - `rootMemoryId: string | null` ID of the first memory in this version chain - `version: number` Version number of this memory entry ### Example ```typescript import Supermemory from 'supermemory'; const client = new Supermemory({ apiKey: process.env['SUPERMEMORY_API_KEY'], // This is the default and can be omitted }); const response = await client.memories.updateMemory({ containerTag: 'user_123', newContent: 'John now prefers light mode', }); console.log(response.id); ``` #### 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` 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` Response after updating a memory - `id: string` ID of the newly created memory version - `createdAt: string` When this memory version was created - `forgetAfter: string | null` When this memory will be auto-forgotten, or null if no expiry - `forgetReason: string | null` Reason for the scheduled forgetting, or null - `memory: string` The content of the new memory version - `parentMemoryId: string | null` ID of the memory this version updates - `rootMemoryId: string | null` ID of the first memory in this version chain - `version: number` Version number of this memory entry