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

# update • AI Agent SDK

> update: Update a memory.

# update

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**MongoDBMemory**](../classes/MongoDBMemory) class in the [**knowledge**](../modules/knowledge) module.

Update a memory.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def update(memory_id: Any, data: Any) -> Any
```

## Parameters

<ParamField query="memory_id" type="Any" required={true}>
  No description available.
</ParamField>

<ParamField query="data" type="Any" required={true}>
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="Any">
  The result of the operation.
</ResponseField>

## Uses

* `update_one`
* `ObjectId`
* `datetime.utcnow`
* `logging.error`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/knowledge/knowledge.py#L326">
  `praisonaiagents/knowledge/knowledge.py` at line 326
</Card>
