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

# Stage Context • AI Agent SDK

> StageContext: Context passed between escalation stages.

# StageContext

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

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

Context passed between escalation stages.

Maintains state across stage transitions.

## Properties

<ResponseField name="stage" type="EscalationStage">
  No description available.
</ResponseField>

<ResponseField name="prompt" type="str">
  No description available.
</ResponseField>

<ResponseField name="signals" type="Set[EscalationSignal]">
  No description available.
</ResponseField>

<ResponseField name="steps" type="List">
  No description available.
</ResponseField>

<ResponseField name="tool_results" type="List">
  No description available.
</ResponseField>

<ResponseField name="context_summary" type="str">
  No description available.
</ResponseField>

<ResponseField name="files_read" type="Set[str]">
  No description available.
</ResponseField>

<ResponseField name="files_modified" type="Set[str]">
  No description available.
</ResponseField>

<ResponseField name="tokens_used" type="int">
  No description available.
</ResponseField>

<ResponseField name="tool_calls" type="int">
  No description available.
</ResponseField>

<ResponseField name="time_elapsed" type="float">
  No description available.
</ResponseField>

<ResponseField name="checkpoint_ids" type="List[str]">
  No description available.
</ResponseField>

<ResponseField name="session_id" type="Optional[str]">
  No description available.
</ResponseField>

## Methods

<CardGroup cols={2}>
  <Card title="add_step()" icon="function" href="../functions/StageContext-add_step">
    Add a step to history.
  </Card>

  <Card title="add_tool_result()" icon="function" href="../functions/StageContext-add_tool_result">
    Add a tool result.
  </Card>

  <Card title="should_escalate()" icon="function" href="../functions/StageContext-should_escalate">
    Check if escalation is needed based on current state.
  </Card>

  <Card title="should_deescalate()" icon="function" href="../functions/StageContext-should_deescalate">
    Check if de-escalation is appropriate.
  </Card>
</CardGroup>

## Source

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

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Context Concept" icon="layer-group" href="/docs/docs/concepts/context" />

  <Card title="Context Management" icon="sliders" href="/docs/docs/features/context-management" />

  <Card title="Context Strategies" icon="diagram-project" href="/docs/docs/features/context-strategies" />
</CardGroup>
