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

# Delete History • AI Agent SDK

> delete_history: Delete a specific message from chat history by index.

# delete\_history

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

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

Delete a specific message from chat history by index.

Supports negative indexing (-1 for last message, etc.).

## Signature

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

## Parameters

<ParamField query="index" type="int" required={true}>
  Message index (0-based, supports negative indexing)
</ParamField>

### Returns

<ResponseField name="Returns" type="bool">
  True if deleted, False if index out of range
</ResponseField>

## Source

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