Skip to main content
Different feature from the Run-State Journal. This page is about context replay — recording a run’s trace and stepping through it in a debugger. The run-state journal is about resumable execution — persisting the per-event cursor so a crashed run continues without re-executing tools. Pick the run-state journal for crash-safe production runs; pick context replay to inspect a completed run for debugging.
The user saves a trace during a run, then steps through recorded context events to debug handoffs and tools.
To watch a run live in the browser, or show its progress inside your own website, see Embed Replay.
Record agent context events during a run, then step through them interactively to debug handoffs, tool calls, and token growth.

Quick Start

1

Simple Usage

Save a trace during a recipe or workflow run:
2

With Configuration

Emit traces from Python and persist to disk:

How It Works

AGENT_END carries data["status"]: "completed", "failed" (the agent raised), or "cancelled". An unnamed agent (Agent(instructions=...)) uses node_id="agent:Agent", matching its id in to_graph(agent). Both sync (start/chat) and async (astart/achat) runs record LLM_REQUEST / LLM_RESPONSE. Traces are stored as JSONL in ~/.praisonai/traces/.

Node IDs & Reused Steps

Every step gets a stable node_id built from its name and position, so one handler reused at two positions shows up as two separate nodes.
node_id values never contain a UUID — they are identical across processes and runs, so they are safe to use as external identifiers in dashboards, alerts, or rerun targets.
Look up a position’s node_id without running the flow:

CLI Commands

Interactive navigation

In replay context: Enter/n next, p previous, g <N> go to event, q quit.

Filters


Common Patterns

In-memory trace during tests

Read traces programmatically

Cleanup old traces


Best Practices

Include a timestamp or task identifier so traces are easy to find in replay list.
redact=True (default) strips sensitive data from persisted traces.
Full CONTEXT_SNAPSHOT events can be large — prefer message and tool events for routine debugging.
Use replay cleanup --max-age 7 so trace storage does not grow unbounded on developer machines.

Run History

Inspect past agent runs and session metadata

Observability Hooks

Emit structured events for external observability tools