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

AI Agent

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

> **[last\_run\_pointer\_path()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/last_run_pointer_path.md)**
>
> Absolute path to the last-run pointer file.

> **[record\_completed\_run()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/record_completed_run.md)**
>
> Persist a pointer to the trace file of the just-completed run.

> **[load\_last\_run\_pointer()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/load_last_run_pointer.md)**
>
> Load the last-run pointer, or `None` if none has been recorded.

### Constants

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


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