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

# Escalation Pipeline • AI Agent SDK

> EscalationPipeline: Progressive escalation pipeline for agent execution.

# EscalationPipeline

> Defined in the [**pipeline**](../modules/pipeline) module.

<Badge color="blue">AI Agent</Badge>

Progressive escalation pipeline for agent execution.

Implements a staged approach to task execution:

* Stage 0 (DIRECT): Immediate response without tools
* Stage 1 (HEURISTIC): Tool selection based on local signals
* Stage 2 (PLANNED): Lightweight planning with single LLM call
* Stage 3 (AUTONOMOUS): Full autonomous loop with verification

## Constructor

<ParamField query="config" type="Optional[EscalationConfig]" required={false}>
  No description available.
</ParamField>

<ParamField query="agent" type="Optional" required={false}>
  No description available.
</ParamField>

<ParamField query="tools" type="Optional" required={false}>
  No description available.
</ParamField>

<ParamField query="checkpoint_service" type="Optional" required={false}>
  No description available.
</ParamField>

<ParamField query="on_stage_change" type="Optional" required={false}>
  No description available.
</ParamField>

## Methods

<CardGroup cols={2}>
  <Card title="analyze()" icon="function" href="../functions/EscalationPipeline-analyze">
    Analyze prompt and recommend initial stage.
  </Card>

  <Card title="execute()" icon="function" href="../functions/EscalationPipeline-execute">
    Execute prompt with automatic escalation.
  </Card>

  <Card title="execute_at_stage()" icon="function" href="../functions/EscalationPipeline-execute_at_stage">
    Execute prompt at specific stage.
  </Card>

  <Card title="get_current_stage()" icon="function" href="../functions/EscalationPipeline-get_current_stage">
    Get current execution stage.
  </Card>

  <Card title="get_context()" icon="function" href="../functions/EscalationPipeline-get_context">
    Get current execution context.
  </Card>
</CardGroup>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pipeline = EscalationPipeline()
    
    # Analyze and execute
    result = await pipeline.execute("Refactor the auth module")
    
    # Or analyze first, then execute
    stage = pipeline.analyze("Simple question")
    result = await pipeline.execute_at_stage("Simple question", stage)
```

## Source

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