Give your agents an undo button
When an agent goes off the rails, Rewind snaps it back. Checkpoint the filesystem and message history together, let agents take risky shots, and instantly rewind to a clean state — with no memory of the failure.
from rewind_sdk import session
with session("agent", workspace="./src", auto_commit=True) as sess:
# Snapshot filesystem + memory before risky work
sess.checkpoint("stable")
# Agent attempts a risky refactor
sess.write_file("auth.py", new_implementation)
try:
sess.run_tests("pytest") # raises RuntimeError on failure
except RuntimeError:
# Roll back files + message history together
sess.rollback("stable")Transactions for agent execution
Everything you need to build agents that try risky things, fail safely, and resume from a clean state.
Atomic Checkpoints
Save filesystem and message state together as a single, consistent snapshot.
Instant Rollback
Restore to any checkpoint with one call. No cleanup, no state reconciliation.
Auto-Checkpoints
Automatically snapshot before every tool call, write, or command.
Auto-Rollback
Recover from exceptions and test failures without explicit error handling.
Persistent Memory
Full conversation history preserved and restored alongside disk state.
Docker Sandbox
Isolated execution environment backed by OverlayFS for true safety.
Three layers, unified
Rewind stitches together filesystem, framework, and memory into a single transactional execution boundary.
Filesystem Snapshots
Atomic disk isolation
Every write is captured against an immutable baseline. Rolling back discards changes instantly, restoring disk state to any checkpoint atomically.
- Instant snapshots
- Sub-100ms restores
- Zero residual state
Framework Adapter
Native execution hooks
wrap_langgraph() drops into your compiled graph to keep memory synced and auto-rollback on unhandled exceptions. A CLI and MCP server expose the same session operations.
- LangGraph adapter
- MCP server & CLI
- Framework-agnostic core
Memory Truncation
Context window protection
Message history is versioned alongside the filesystem. On rollback, the agent's memory truncates to the checkpoint — eliminating poisoned context from failed attempts.
- Versioned message log
- dict / LangChain / LangGraph
- Poison-free recovery
Drops into your stack
A context manager you already know. Wrap your agent loop and get transactional execution for free.
import threading
from rewind_sdk import session, wrap_langgraph
tool_lock = threading.Lock()
sandbox = session("agent_sandbox", workspace="./my_codebase", auto_commit=True)
@tool
def write_file(path: str, content: str) -> str:
with tool_lock:
sandbox.on_tool_call(tool_name="write_file") # explicit checkpoint trigger
sandbox.write_file(path, content)
return f"Wrote to {path}"
with sandbox:
sandbox.auto_checkpoint(trigger="before_tool_call")
sandbox.checkpoint("known_good")
sandbox.auto_rollback("exception", to="known_good")
# Wrap a compiled graph: memory stays synced, rollback on exceptions
safe_agent = wrap_langgraph(base_agent, session=sandbox)
for event in safe_agent.stream({"messages": messages}):
passGive your agents a safety net
Install the SDK, wrap your agent loop, and ship autonomous systems that recover from failure instead of breaking on it.