Skip to content

Inspector

A standalone web dashboard for debugging agent sessions. Every action the model takes — every tool call, every iteration, every token spent — is captured automatically and presented in a single UI. Run your agent, then open the inspector to see exactly what happened and why.

bash
ra --inspector                          # launch on default port 3002
ra --inspector --inspector-port 8080    # custom port

The inspector is a standalone interface — it reads saved session data from disk. Run your agent normally (CLI, REPL, HTTP, etc.), then launch the inspector separately to review sessions.

Open http://localhost:3002 in your browser.

Overview dashboard

Inspector Overview

The Overview tab gives you the full picture of any session at a glance. At the top, a session header shows the provider, model, interface, and timestamp. Below that, stats cards surface the key numbers:

  • Duration — total wall-clock time for the session
  • Iterations — how many loop iterations the agent completed
  • Total tokens — cumulative input + output across all model calls
  • Input / Output tokens — broken out separately so you can see the ratio
  • Cache hit % — what fraction of input tokens came from the prompt cache (higher = cheaper)
  • Tool calls / Tool errors — how many tools were invoked and how many failed
  • Messages — total message count in the conversation
  • Status — final loop status (OK or error)

The Tokens per Iteration chart is a horizontal bar for every iteration, showing input (blue), output (green), and thinking (purple) tokens. Each bar is annotated with duration, total tokens, and tool count. You can see exactly where the model was thinking hardest, where cache hits kicked in (bars shrink as prefix caching warms up), and which iterations triggered tool calls.

The Tool Usage table lists every tool used in the session, sorted by call count, with columns for errors, total execution time, and average execution time. Spot slow tools, frequent failures, or unexpected usage patterns at a glance.

Session views

Select a session from the sidebar to see its data across five tabs:

TabWhat it shows
OverviewStats dashboard — duration, iterations, token totals, cache hit %, tool call/error counts, per-iteration token chart, tool usage table
TimelineChronological event stream — every model call (with token delta and cache %), every tool execution (with inputs/outputs), warnings and errors
MessagesFull message history — user, assistant, system, and tool messages with collapsible thinking blocks. See exactly what the model saw and said at each turn
LogsStructured log entries — timestamp, level, message, and metadata fields from every subsystem
TracesHierarchical span tree — agent.loopagent.iterationagent.model_call / agent.tool_execution with duration, status, and attributes

Global views

TabWhat it shows
ConfigResolved configuration (API keys redacted) — see exactly what settings the agent ran with
ContextDiscovered context files and glob patterns — verify what the model was given as context
MiddlewareActive middleware hooks and registered functions
MemoryBrowse, search, add, and delete persistent memories

Timeline

Timeline view

The Timeline tab merges two data sources into one chronological view:

  1. Trace spansagent.loop, agent.iteration, agent.model_call, agent.tool_execution
  2. Log entries — only warn and error level entries (to keep the timeline focused)

Each event shows its timestamp, duration, and type. Events are color-coded:

  • Blue — model calls
  • Orange — tool executions
  • Green — iterations
  • Purple — loop start/end
  • Red — errors

Configuration

yaml
app:
  inspector:
    port: 3002
FieldEnv varCLI flagDefaultDescription
inspector.portRA_INSPECTOR_PORT--inspector-port3002Port for the inspector server

The inspector is enabled with the --inspector flag. It launches as its own interface — it cannot run as a sidecar alongside another interface (CLI, REPL, HTTP, MCP). Instead, run your agent sessions first, then launch the inspector separately to review them.

API endpoints

The inspector serves a JSON API that the dashboard consumes. You can also query it directly:

EndpointDescription
GET /api/sessionsList all sessions (sorted newest first)
GET /api/sessions/:id/statsAggregated stats from traces
GET /api/sessions/:id/timelineChronological event stream
GET /api/sessions/:id/messagesRaw message history
GET /api/sessions/:id/logsStructured log entries
GET /api/sessions/:id/tracesRaw trace spans
GET /api/configResolved config (keys redacted)
GET /api/contextDiscovered context files
GET /api/middlewareActive middleware hooks
GET /api/memoryList or search memories
POST /api/memoryCreate a memory
DELETE /api/memory/:idDelete a memory

Example

bash
# Run an agent session first
ra "Explain the architecture of this project"

# Then launch the inspector to review it
ra --inspector

# In another terminal, query the API directly
curl http://localhost:3002/api/sessions | jq '.[0].id'
curl http://localhost:3002/api/sessions/SESSION_ID/stats | jq '.totalTokens'

See also

Released under the MIT License.