Time-Travel Debugging

Replay any agent state at any point in time. Step forward and backward through execution history.

Why Time-Travel?

Unlike traditional logs, time-travel debugging lets you see exactly what your agent was "thinking" at any moment. Replay decisions, compare alternative paths, and understand why your agent made specific choices.

How It Works

Every event in your agent's execution is captured with full context. This creates a complete timeline that you can navigate like a video player.

Step Through Execution

Step 12 of 45

Navigate through your agent's execution one step at a time, just like a debugger.

Inspect State at Any Point

// State at step 12
{
  "current_tool": "search_knowledge_base",
  "query": "password reset",
  "results_found": 3,
  "user_context": {
    "frustrated": true,
    "previous_attempts": 2
  },
  "next_action": "evaluate_results"
}

See exactly what data your agent had access to at each step.

Using Time-Travel in the Dashboard

1. Open a Session

Navigate to your dashboard and select any completed session to view its timeline.

2. Navigate the Timeline

Use the timeline controls to move through execution:

  • Arrow keys - Step forward/backward
  • Click events - Jump to specific moments
  • Slider - Scrub through quickly
  • Play button - Auto-play execution

3. Inspect Events

Click any event to see full details:

Event Type:tool_call
Tool Name:search_kb
Duration:265ms
Status:success

Common Use Cases

🐛 Debug Failures

When an agent fails, rewind to see exactly where things went wrong.

Example: Agent crashes at step 23. Rewind to step 20 to see what data caused the error.

🎯 Optimize Performance

Identify slow steps and unnecessary operations.

Example: Notice that tool X takes 5 seconds every time. Optimize or replace it.

💡 Understand Decisions

See why your agent made specific choices.

Example: Agent chose option A over B. View the reasoning and confidence scores that led to that decision.

🔄 Compare Runs

Open multiple sessions side-by-side to compare behavior.

Example: Compare v1.0 vs v1.1 of your agent to see how prompt changes affected decisions.

Advanced: Programmatic Access

Access session history programmatically for analysis and testing:

from sentrial import SentrialClient

client = SentrialClient(api_key="...", project_id="...")

# Get full session history
events = client.get_session_events(session_id)

# Get state at specific point in time
state_at_step_12 = client.get_state_at_event(
    session_id=session_id,
    event_index=12
)

# Analyze decision patterns
for event in events:
    if event["type"] == "decision":
        print(f"Confidence: {event['confidence']}")
        print(f"Chosen: {event['chosen']}")
        print(f"Reasoning: {event['reasoning']}")
        print("---")

Performance Note

Time-travel works best for sessions with <1000 events. For longer sessions, use filtering or focus on specific time ranges.