> ## 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.

# forget • AI Agent SDK

> forget: Delete memories by id or matching query; returns count deleted.

# forget

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

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

Delete memories by id or matching query; returns count deleted.

Convenience wrapper over :meth:`delete_memory` /
:meth:`delete_memories_matching`. Provide exactly one of
`memory_id` or `query`.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def forget() -> int
```

### Returns

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

## Uses

* `ValueError`
* `delete_memory`
* `kwargs.setdefault`
* `delete_memories_matching`

## Used By

* [`DakeraMemoryAdapter.delete_memory`](../functions/DakeraMemoryAdapter-delete_memory)

## Source

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