> For the complete documentation index, see [llms.txt](https://docs.aios.foundation/aios-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aios.foundation/aios-docs/aios-agent-sdk/memory-api/update_memory.md).

# update\_memory

**Function**: `update_memory()`\
**Purpose**: Modify existing memory content/metadata\
**Parameters**:

* `agent_name`: Namespace identifier
* `memory_id`: Target memory ID
* `content`: New text (optional)
* `metadata`: New/updated fields (optional)

**Example**:

```python
update_memory(
    agent_name="project_bot",
    memory_id="mem_abc123",
    content="Updated timeline decision",
    metadata={"priority": "critical"}
)
```

**Response**:

```json
{
    "success": true,
    "memory_id": "mem_abc123",
    "content": null,
    "metadata": null,
    "error": null
}
```
