Skip to main content
Replay draws a run as it happens. In a team or flow, each step and agent on the map turns from not reached to running to done; a single agent appears when it starts and turns done when it answers. You can open it on its own page, put it in your app, or put it in any website with one <iframe>.
Install the UI extra: pip install -U "praisonai[ui]". The app examples below also need FastAPI: pip install fastapi. You need PraisonAI 4.7.19 or later, which brings PraisonAI UI (aiui) 0.3.148 or later. With an older aiui, watch() and replay_app() stop with an upgrade message.

Quick Start

1

Watch a run with a Run button

Press ▶ Run. The map shows who is working right now. When the run ends, ▶ Play goes through it again one step at a time.
2

Show progress inside your own app

Async targets share PraisonAI’s event loop (PR #6137)When replay_app() runs an agent target that returns a coroutine, it now drives it through PraisonAI’s shared AsyncBridge (run_cli_coro) instead of a fresh asyncio.run(...) per click. This means:
  • Per-loop connection pools (e.g. httpx.AsyncClient pools cached in praisonai.capabilities.passthrough) survive across Replay runs instead of being orphaned.
  • Any scoped_bridge() you installed is honoured.
  • A fresh event loop is no longer created and torn down on every click.
No public API change — any replay_app(target=...) whose target returns a coroutine benefits automatically.
Then show that run on any page:

How It Works

What the map shows:

Three Ways to Run It


Embed on Any Website

The view is a normal web page, so any site can show it in an <iframe>, even when it is not built with Python.
On a different domain, the fetch to /generate is cross-origin, so allow your site in your app’s CORS settings (for FastAPI, CORSMiddleware with allow_origins=["https://your-site.example"]). The iframe itself needs no CORS.

Common Patterns

Put the Run button in your app

Pass your agent, team or flow to replay_app() and the mounted page gets an input box and a Run button:
One run goes at a time. A team’s tasks start afresh on each run; an Agent keeps its chat history between runs.
An agent without a name= (Agent(instructions=...)) appears on the map as Agent. Give agents names when a lesson runs more than one, so each gets its own box.

Draw the view inside your own page

On a page served by the same app, load the view into any element instead of an iframe:
For a site on a different domain, use the <iframe>. The render() call reads data from the same origin as the page.

Teach how agents work together

watch() is a quick way to show a class or a team how a multi-agent run flows. Press Run, then ▶ Play to go through it again. Use ← → to step, Timeline to see who worked when, and Why to see what each agent was given.

Best Practices

Anyone who can open the page can read the runs (prompts and outputs). With a Run button, they can also start new runs. watch() listens on 127.0.0.1 by default (it warns if you pass another host=). In your app, mount replay_app() behind your own login. Protect /generate the same way, with login and a rate limit: anyone who can call it can start agent runs over and over.
Create the run_id yourself, pass it to record(), and return it to the page. The iframe can open /replay/?run=<id> straight away: it waits until the run starts.
record(run_id, live=True) writes each step as soon as it happens. Without it, the view only fills in at the end of the run.
The iframe works from any framework or domain. Use render() only on pages served by the same app.

Replay

Record runs and step through them from the CLI

Integrating PraisonAI UI

Use PraisonAI UI as a full dashboard for your agents