Skip to content

Latest commit

 

History

History
119 lines (79 loc) · 3.27 KB

getting-started.md

File metadata and controls

119 lines (79 loc) · 3.27 KB

Getting Started

Rewind is a time-travel debugger for AI agents. It records every LLM call your agent makes, then lets you inspect, fork, replay from failure, and diff timelines — without re-running (or paying for) the steps that already succeeded.


Install

pip (recommended)

pip install rewind-agent

This installs both the Python SDK and the rewind CLI. The native binary is auto-downloaded on first use — no Rust toolchain required.

Quick install (binary only, macOS / Linux)

curl -fsSL https://raw.githubusercontent.com/agentoptics/rewind/master/install.sh | sh

From source (requires Rust)

cargo install --git https://github.com/agentoptics/rewind rewind-cli

Build locally

git clone https://github.com/agentoptics/rewind.git
cd rewind
cargo build --release
# Binary at ./target/release/rewind (no dependencies)

Quickstart

30 seconds to your first recording:

# 1. Start the recording proxy (forwards to OpenAI)
#    Add --replay to enable instant replay caching
rewind record --name "my-agent" --upstream https://api.openai.com --replay

# 2. In another terminal — point your agent at the proxy
export OPENAI_BASE_URL=http://127.0.0.1:8443/v1

# 3. Snapshot your workspace before the agent runs
rewind snapshot . --label "before-agent"

# 4. Run your agent as usual
python3 my_agent.py

# 5. See what happened (trace view, interactive TUI, cache stats)
rewind show latest
rewind inspect latest
rewind cache

# 6. Something broke? Roll back
rewind restore before-agent

Try without API keys

The rewind demo command seeds sample data so you can explore the TUI, web dashboard, and CLI without needing any API keys:

rewind demo && rewind inspect latest

Already-Python alternative — no proxy

If your agent is Python, you can skip the proxy entirely:

from rewind_agent import intercept
intercept.install()  # patches httpx / requests / aiohttp; recording starts

# … your existing code unchanged …

This is the HTTP intercept path — works with any HTTP-based LLM client (OpenAI SDK, Anthropic SDK, LangChain, custom gateways via custom predicates, etc.). See the HTTP Intercept Quickstart.


Works with any LLM provider

Rewind sits between your agent and the LLM API. Point it at any provider:

# OpenAI
rewind record --upstream https://api.openai.com

# Anthropic
rewind record --upstream https://api.anthropic.com

# AWS Bedrock (via gateway)
rewind record --upstream https://your-bedrock-gateway.com

# Any OpenAI-compatible API (Ollama, vLLM, etc.)
rewind record --upstream http://localhost:11434
Provider Non-streaming Streaming (SSE)
OpenAI (GPT-4o, o1, etc.) Yes Yes
Anthropic (Claude) Yes Yes
AWS Bedrock Yes --
Any OpenAI-compatible (Ollama, vLLM, LiteLLM) Yes Yes

Next steps

For a deeper look at how recording works — the five ways to record + replay (direct mode, HTTP intercept, cached_llm_call, proxy mode, and dashboard runners), agent hooks, and streaming — see recording.md. Operator-driven replays from the dashboard ("Run replay" button against a registered runner) are documented in runners.md.