agent-tracing

Installation
SKILL.md

Agent Tracing CLI Guide

@lobechat/agent-tracing is a zero-config local dev tool that records agent execution snapshots to disk and provides a CLI to inspect them.

How It Works

In NODE_ENV=development, AgentRuntimeService.executeStep() automatically records each step to .agent-tracing/ as partial snapshots. When the operation completes, the partial is finalized into a complete ExecutionSnapshot JSON file.

Data flow: executeStep loop -> build StepPresentationData -> write partial snapshot to disk -> on completion, finalize to .agent-tracing/{timestamp}_{traceId}.json

Context engine capture: In RuntimeExecutors.ts, the call_llm executor emits a context_engine_result event after serverMessagesEngine() processes messages. This event carries the full contextEngineInput (DB messages, systemRole, model, knowledge, tools, userMemory, etc.) and the processed output messages (the final LLM payload).

Package Location

packages/agent-tracing/
  src/
    types.ts          # ExecutionSnapshot, StepSnapshot, SnapshotSummary
    store/
Related skills

More from lobehub/lobe-chat

Installs
1
GitHub Stars
77.0K
First Seen
Apr 8, 2026