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

# Last Run • AI Agent SDK

> Last-run trace pointer for PraisonAI Agents.

# last\_run

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

Last-run trace pointer for PraisonAI Agents.

Persists a tiny pointer to the most recently completed traced run so tools
(e.g. `praisonai eval last-trace`) can grade the last run without a manual
JSON export. Uses only stdlib for zero dependencies and writes atomically.

Usage:

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents.trace.last_run import record_completed_run, load_last_run_pointer

record_completed_run("trace.jsonl", meta={"agent": "researcher"})
pointer = load_last_run_pointer()  # -> {"path": "...", "meta": {...}} or None
```

## Import

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents.trace import last_run
```

## Functions

<CardGroup cols={2}>
  <Card title="last_run_pointer_path()" icon="function" href="../functions/last_run_pointer_path">
    Absolute path to the last-run pointer file.
  </Card>

  <Card title="record_completed_run()" icon="function" href="../functions/record_completed_run">
    Persist a pointer to the trace file of the just-completed run.
  </Card>

  <Card title="load_last_run_pointer()" icon="function" href="../functions/load_last_run_pointer">
    Load the last-run pointer, or `None` if none has been recorded.
  </Card>
</CardGroup>

### Constants

| Name | Value |
| - | - |
| `POINTER_SCHEMA_VERSION` | `'1.0'` |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.