langgraph-replay
Time-travel debugging for LangGraph agents.
Record every step. Replay without API calls. Fork from any checkpoint. Catch regressions before they ship.
Install
pip install langgraph-replay
Requires Python 3.10+ and a LangGraph agent.
Why langgraph-replay?
LLM agents are non-deterministic. A prompt tweak or model upgrade can silently break routing, and you only discover it in production. langgraph-replay gives you:
- Full execution history in a single SQLite file — no external services.
- Deterministic replay — substitute recorded LLM + tool responses. Zero API calls, instant re-execution.
- Regression detection — real LLM + recorded tools. If the agent routes differently after a code change, you see exactly where it diverged.
- Fork from any step — branch, modify inputs, and re-run downstream logic.
- Built-in dashboard — timeline, state diffs, and one-click replay/fork in your browser.
Quick start
from langgraph_replay import ReplayCheckpointer, ReplayCallbackHandler
checkpointer = ReplayCheckpointer(db_path="replay.db")
handler = ReplayCallbackHandler("replay.db")
graph = workflow.compile(checkpointer=checkpointer)
graph.invoke(
{"messages": [("user", "What's the weather in Tokyo?")]},
{"configurable": {"thread_id": "run-1"}, "callbacks": [handler]},
)
Launch the dashboard:
langgraph-replay dev --db replay.db
langgraph-replay dev --db replay.db --graph my_agent:build_graph # enables Re-run and Fork
Features
| Feature | Description |
|---|---|
| Checkpoint timeline | Every LangGraph step persisted to SQLite with full state |
| State diffs | Message-level and tool-call diffs between any two steps |
| Fork | Branch from any checkpoint and re-execute downstream |
| Re-run / Restart | Re-execute from step 0 or any mid-run checkpoint |
| Deterministic replay | Recorded LLM + tools — no API calls, instant verification |
| Regression replay | Live LLM + recorded tools — detect routing drift |
Dashboard
| Action | What it does |
|---|---|
| Re-run | Restart the workflow from step 0 with current code |
| Fork | Branch from the selected step with modified inputs |
| Deterministic | Replay with fake LLM + tools — verify routing logic |
| Regression | Replay with real LLM + fake tools — detect divergence |
CLI
# Launch dashboard
langgraph-replay dev --db replay.db --graph my_agent:build_graph
# Restart from a specific step
langgraph-replay replay --db replay.db --graph my_agent:build_graph --thread run-1 --from-step 3
# Deterministic replay (no API calls)
langgraph-replay replay --db replay.db --graph my_agent:build_graph --thread run-1 --mode deterministic
# Regression replay (real LLM, recorded tools)
langgraph-replay replay --db replay.db --graph my_agent:build_graph --thread run-1 --mode regression
Python API
from langgraph_replay import (
ReplayCheckpointer,
ReplayCallbackHandler,
StateDiffEngine,
ForkManager,
RestartEngine,
ReplayRunner,
DivergenceReport,
serve,
)
# Restart from a checkpoint
RestartEngine("replay.db", graph).restart("run-1", from_step=3)
# Deterministic replay
ReplayRunner("replay.db", graph).replay("run-1", mode="deterministic")
# Regression replay with divergence report
report = ReplayRunner("replay.db", graph).replay("run-1", mode="regression")
Examples
See the examples directory for a runnable chat agent with tools (chat_agent.py).
Links
- Repository: https://github.com/devendra116/agent-replay-engine
- Issues: https://github.com/devendra116/agent-replay-engine/issues
- License: MIT
Release files for langgraph-replay 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langgraph_replay-0.1.1.tar.gz | 177.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langgraph_replay-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 360.9 kB
Release files / langgraph_replay-0.1.1.tar.gz
| Download URL | langgraph_replay-0.1.1.tar.gz |
|---|---|
| Size | 177.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dd964d4f0d7dc9e48847abeda3008c3873059aad449f6a3317d73c39aecdaa16
|
|
BLAKE2b-256 checksum How to use checksums |
6291e4a19485bfc61153ec48f9785c11f3f8f90e0e970237797fbd020ba501b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 30, 2026.
Transparency logRelease files / langgraph_replay-0.1.1-py3-none-any.whl
| Download URL | langgraph_replay-0.1.1-py3-none-any.whl |
|---|---|
| Size | 183.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
28627c335b6deac536c5fcc3613c8315cf080aee53bfaf44e86f3610974c3bff
|
|
BLAKE2b-256 checksum How to use checksums |
f7c58355b5e0e6eda828d8f2772a5006d1227b341b273f84fcf5538eb52f2413
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 30, 2026.
Transparency log