> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maximem.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# memories.update

> Update the content of an existing memory using a merge strategy.

```python theme={null}
await sdk.memories.update(memory_id, document, ...)
```

Update an existing memory. The update behavior depends on the merge strategy: you can fully replace, append to, or smart-merge the existing content.

### Parameters

<ParamField path="memory_id" type="UUID" required>
  The memory ID to update.
</ParamField>

<ParamField path="document" type="string" required>
  Updated memory content. Behavior depends on `merge_strategy`.
</ParamField>

<ParamField path="merge_strategy" type="string">
  How the update should be applied. Defaults to `smart-merge`.

  | Value         | Description                                                                                                                       |
  | ------------- | --------------------------------------------------------------------------------------------------------------------------------- |
  | `replace`     | Fully replace the existing memory content with the new content.                                                                   |
  | `append`      | Append the new content to the existing memory, preserving the original.                                                           |
  | `smart-merge` | Intelligently merge new information with existing content, deduplicating and resolving conflicts by preferring the newer version. |
</ParamField>

<ParamField path="document_type" type="string">
  Optional new document type to associate with the memory.
</ParamField>

<ParamField path="metadata" type="object">
  Optional updated metadata. Merged with existing metadata.
</ParamField>

### Returns

The updated `Memory` object, same shape as the response from [`memories.get`](/sdk-reference/memories/get).

### Example

```python theme={null}
from maximem_synap import MaximemSynapSDK
from uuid import UUID

sdk = MaximemSynapSDK(api_key="synap_your_key_here")
await sdk.initialize()

updated = await sdk.memories.update(
    memory_id=UUID("a1b2c3d4-e5f6-7890-abcd-ef0123456789"),
    document="Prefers light roast coffee, especially pour-over. Also enjoys cold brew in summer.",
    merge_strategy="smart-merge",
    metadata={"source": "web-chat"},
)
print(updated.content)
print(updated.updated_at)
```

### Raises

* `SynapAuthError`: when the API key is missing or invalid.
* `SynapNotFoundError`: when the `memory_id` does not exist or is outside the caller's scope.
* `SynapValidationError`: when `merge_strategy` or `document_type` is not a recognized value.

### See also

* [memories.get](/sdk-reference/memories/get)
* [memories.delete](/sdk-reference/memories/delete)
* [memories.create](/sdk-reference/memories/create)
