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

# Get Recovery Action • AI Agent SDK

> get_recovery_action: Get recommended recovery action when doom loop detected.

# get\_recovery\_action

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

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

Get recommended recovery action when doom loop detected.

Returns graduated recovery actions:

* "retry\_different": Try a different approach (1st detection)
* "escalate\_model": Escalate to stronger model (2nd detection)
* "request\_help": Request human intervention (3rd detection)
* "abort": Stop execution (4th+ detection)
* "continue": No doom loop, continue normally

## Signature

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

### Returns

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

## Uses

* `is_doom_loop`

## Used By

* [`EscalationPipeline.execute_at_stage`](../functions/EscalationPipeline-execute_at_stage)

## Source

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