Skip to main content

Local-first, framework-agnostic debugger for LLM agents — see, replay, and diff what your agent did.

Project description

replai

A local-first debugger for LLM agents. See exactly what your agent did — every model call, tool call, and decision — step by step. No account, no cloud, no Docker. Just pip install and look.

⚠️ Early alpha (v0.1). The capture engine and local viewer work today. Replay and run-diffing are next on the roadmap.

Why

When an AI agent does the wrong thing, you're usually staring at a wall of logs trying to reconstruct what happened. Production observability platforms exist, but they're heavy — dashboards, servers, accounts — built for monitoring at scale, not for the moment you're on your laptop going "wait, why did it call that tool?"

replai is the other thing: a debugger for the dev inner loop. Drop it in, run your agent, and get a clickable, step-by-step timeline of everything it did — locally.

Install

pip install "replai[viewer]"

Quickstart

import replai
replai.init()          # auto-captures Anthropic & OpenAI calls

# ... run your agent exactly as you normally would ...

Then open the viewer:

replai ui

Want to annotate your own steps?

with replai.run("my-agent"):
    with replai.span("retrieve", type="tool_call") as s:
        s.output = my_retriever(query)

Or decorate functions and tools:

@replai.tool
def web_search(query): ...

@replai.trace
def plan(goal): ...

Try it with no API keys

python example.py
replai ui

How it works

  • Auto-instrumentation wraps the Anthropic / OpenAI clients, so calls are captured with zero code changes.
  • @replai.trace / @replai.tool / replai.span() annotate your own functions and tool calls. Spans nest automatically.
  • Everything is stored in a local SQLite file (~/.replai/replai.db). Nothing leaves your machine.
  • A small FastAPI viewer renders each run as a step-by-step timeline.

Roadmap

  • Capture engine (LLM + tool + function spans, sync & async)
  • Local timeline viewer
  • Replay — step through a run; re-run from any step
  • Diff — compare two runs, highlight where they diverged
  • Framework adapters (LangChain, LlamaIndex, …)
  • MCP tool-call capture
  • OpenTelemetry GenAI export

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

replai-0.1.0.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

replai-0.1.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file replai-0.1.0.tar.gz.

File metadata

  • Download URL: replai-0.1.0.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for replai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 139cd97ce880a5c8ec2904fcb6d644c76c9dfde1d9f33f9ffb8281fd2c51c694
MD5 511abaaa74a726032769266f64c0d816
BLAKE2b-256 c1a743a5859ae87a067438b3a9fa2236152f7019102b83b0bcf8a27e902f399f

See more details on using hashes here.

File details

Details for the file replai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: replai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for replai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41e4c8d2bc96319b450713d90f11eb452c8702c0e26f4c4d89c09a0dd96deb67
MD5 24319e6f22541736edeb6b3d1ec5d9fe
BLAKE2b-256 a87ec0c1e04409f1d5fc21f259bd004621b62d73f5d4b04f40e410b94d20f1be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page