## Patch Memory `client.memories.update(stringmemoryID, MemoryUpdateParamsbody, RequestOptionsoptions?): MemoryItem` **patch** `/v1/memories/{memory_id}/` Update memory text — supersedes old + creates new. Metadata-only patches (no `text`) are rejected with 400; the row's metadata is derived from extraction and isn't editable from the API yet. ### Parameters - `memoryID: string` - `body: MemoryUpdateParams` - `metadata?: unknown` - `text?: string | null` ### Returns - `MemoryItem` One result item — used in flat search `results` and listings. - `id: string` - `memory: string` - `agent_id?: string | null` - `categories?: Array` - `conv_id?: string | null` - `created_at?: string | null` - `metadata?: unknown` - `score?: number | null` - `updated_at?: string | null` - `user_id?: string | null` ### Example ```typescript import XtraceMemoryManager from 'xtrace-memory-manager'; const client = new XtraceMemoryManager({ apiKey: process.env['XTRACE_MEMORY_MANAGER_API_KEY'], // This is the default and can be omitted orgID: process.env['XTRACE_MEMORY_MANAGER_ORG_ID'], // This is the default and can be omitted }); const memoryItem = await client.memories.update('memory_id'); console.log(memoryItem.id); ``` #### Response ```json { "id": "id", "memory": "memory", "agent_id": "agent_id", "categories": [ "string" ], "conv_id": "conv_id", "created_at": "created_at", "metadata": {}, "score": 0, "updated_at": "updated_at", "user_id": "user_id" } ```