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

# Purge Old • AI Agent SDK

> purge_old: Remove old sent messages.

# purge\_old

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

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

Remove old sent messages.

## Signature

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

## Parameters

<ParamField query="max_age_seconds" type="int" required={false} default="86400 * 7">
  Age threshold for removal
</ParamField>

### Returns

<ResponseField name="Returns" type="int">
  Number of messages purged
</ResponseField>

## Source

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