Back to projects

Case study / 05

Agent Runtime

Debug the decisions, not just the code.

Agent Runtime is a framework-agnostic debugging and control plane for long-running AI agents. It reconstructs logical runs from OpenTelemetry, surfaces evidence-backed failure patterns, and supports policies, replay planning, and run comparison without replacing the underlying orchestration framework. Where isolated logs stop at individual requests, Agent Runtime connects the behavioral path across agents, tools, retries, approvals, and side effects.

  • OpenTelemetry
  • FastAPI
  • PostgreSQL
  • Next.js
  • Databricks
  • Docker
Semantic execution graphsEvidence-first diagnosisPolicies · Replay · Runtime Diff

Observe

Reconstruct agent and tool execution from distributed OpenTelemetry.

Diagnose

Identify bottlenecks, repeated transitions, and evidence-backed failure points.

Control

Apply optional policies and human approval at guarded execution boundaries.

Compare

Compare completed runs and plan adapter-aware debugging replay.

System architecture

Agent Runtime system architecture from agent applications and OpenTelemetry collection through normalization, PostgreSQL and Databricks storage, execution graph diagnosis, policies, approvals, replay, Runtime Diff, and developer UI.

System architecture

View full diagram

Applications keep orchestration ownership while Agent Runtime adds a framework-independent telemetry, diagnosis, and optional control plane.

Current boundary. OTLP ingestion, normalized local telemetry storage, graphs, diagnosis, policies, approvals, replay planning, and comparison are implemented. Databricks is the production analytics boundary; local development uses JSONL. Inline policy evaluation remains separate from asynchronous telemetry.

Engineering decisions

DecisionWhyTradeoff
OpenTelemetry-first instrumentationFramework-independent visibility across Temporal, LangGraph, and custom workers.Requires consistent span conventions and instrumentation quality.
Hybrid operational and analytical storagePostgreSQL supports transactional state while Databricks supports telemetry analysis.Introduces synchronization, ingestion, and data-lifecycle complexity.
Evidence-first diagnosis and controlled executionRules and baselines provide explainable signals; policies protect guarded actions.Baselines need history, policies need worker integration, and telemetry needs redaction and retention controls.

Under the hood

Telemetry / Graph Reconstruction

  • OTLP/HTTP ingestion with redaction before storage
  • Bronze/Silver normalization and stable trace-span deduplication
  • Directed graphs preserve real parent-child relationships
  • Logical runs group multiple traces without inventing causality

Diagnosis / Analytics

  • Gold projections retain declared latency, retry, tool, error, and path metrics
  • Deterministic rules work at cold start
  • Scoped statistical baselines expose coverage and confidence
  • Observed evidence stays separate from labeled inference

Policies / Replay / Comparison

  • Deterministic policy checks and immutable approval context
  • Semantic checkpoints and explicit tool-safety decisions
  • Runtime Diff compares configuration, structure, and outcomes
  • Replay execution remains dependent on runtime-adapter capability

Technical deep dives

Illustrative Agent Runtime execution graph for a failed Project Meeting run, with parallel tools, repeated validation, runtime metrics, diagnosis signals, evidence-first analysis, and a likely failure story.

Execution Graph & Diagnosis

View full diagram

Telemetry becomes a directed behavioral view that exposes fan-out, retries, repeated transitions, and the evidence surrounding a failure.

Illustrative scenario. The product uses emitted spans and real run evidence; explanations keep observed facts separate from labeled inference. Numeric values in this visual illustrate the Project Meeting story rather than a production benchmark.
Agent Runtime policy evaluation with allow, block, pause, and require approval outcomes beside semantic checkpoints, replay safety modes, and a failed-versus-improved Runtime Diff.

Policies, Replay & Runtime Diff

View full diagram

Guarded actions use explicit policy outcomes; replay planning and comparison make side-effect safety and execution changes visible.

Safety boundary. Approvals record authorization but do not resume a workflow automatically. Replay cannot guarantee identical external data, model output, or side effects; actual execution depends on adapter capability.

Runtime Diff demo story

Before · Failed execution

Repeated validation obscures the failure path.

  • Longer execution path
  • Repeated retrieval and validation
  • Incomplete outcome

After · Improved execution

The corrected path removes redundant work.

  • Updated workflow or prompt configuration
  • Fewer repeated transitions
  • Successful recorded outcome

What Runtime Diff explains

Configuration
Workflow, prompt, model, commit, and tool versions when emitted
Execution path
Added, removed, and repeated semantic steps
Tool behavior
Calls, retries, handoffs, and recorded side-effect metadata
Outcome
Status and honest metric deltas, with absent values left unknown