Time-travel debugging for LangGraph agents — record, replay, fork, and catch regressions from a single SQLite file.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langgraph_replay-0.1.1.tar.gz.
File metadata
- Download URL: langgraph_replay-0.1.1.tar.gz
- Upload date:
- Size: 177.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd964d4f0d7dc9e48847abeda3008c3873059aad449f6a3317d73c39aecdaa16
|
|
| MD5 |
7c5d24370a1e576b5ac939b64fec2f83
|
|
| BLAKE2b-256 |
6291e4a19485bfc61153ec48f9785c11f3f8f90e0e970237797fbd020ba501b8
|
Provenance
The following attestation bundles were made for langgraph_replay-0.1.1.tar.gz:
Publisher:
release.yml on Devendra116/agent-replay-engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langgraph_replay-0.1.1.tar.gz -
Subject digest:
dd964d4f0d7dc9e48847abeda3008c3873059aad449f6a3317d73c39aecdaa16 - Sigstore transparency entry: 1675844400
- Sigstore integration time:
-
Permalink:
Devendra116/agent-replay-engine@f8c4a836732c17d31f7e82e7d889343e594f1b8c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Devendra116
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f8c4a836732c17d31f7e82e7d889343e594f1b8c -
Trigger Event:
push
-
Statement type:
File details
Details for the file langgraph_replay-0.1.1-py3-none-any.whl.
File metadata
- Download URL: langgraph_replay-0.1.1-py3-none-any.whl
- Upload date:
- Size: 183.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28627c335b6deac536c5fcc3613c8315cf080aee53bfaf44e86f3610974c3bff
|
|
| MD5 |
2216fa4475cdb2579388cedaa272bbc5
|
|
| BLAKE2b-256 |
f7c58355b5e0e6eda828d8f2772a5006d1227b341b273f84fcf5538eb52f2413
|
Provenance
The following attestation bundles were made for langgraph_replay-0.1.1-py3-none-any.whl:
Publisher:
release.yml on Devendra116/agent-replay-engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langgraph_replay-0.1.1-py3-none-any.whl -
Subject digest:
28627c335b6deac536c5fcc3613c8315cf080aee53bfaf44e86f3610974c3bff - Sigstore transparency entry: 1675844408
- Sigstore integration time:
-
Permalink:
Devendra116/agent-replay-engine@f8c4a836732c17d31f7e82e7d889343e594f1b8c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Devendra116
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f8c4a836732c17d31f7e82e7d889343e594f1b8c -
Trigger Event:
push
-
Statement type: