LLM-powered map/reduce for agent traces

Squeeze all the juice from your traces

Ask questions of hundreds of agent runs in a few lines of Python, on a finished batch or a live stream.

uv add tracepress

Why did these runs fail?

Summarize every step, roll the summaries up per trial, then compare the runs that passed with the ones that didn't. Every row keeps its key, so you can drill from any summary back to the steps behind it.

failure_modes.py
src = tp.read.harbor("jobs/my-job")

notes = src.steps.lm_map(
    "step -> what_happened, is_mistake: bool",
    instructions="Summarize this step ...",
)

per_trial = (
    notes.join(src.trials, on="trial")
    .join(failed_tests, on="trial")
    .group_by("trial")
    .lm_reduce(
        "instruction, reward, failed_tests, what_happened, is_mistake -> summary, failure_mode",
        instructions="Explain the failure using the failed tests ...",
    )
)

per_task = (
    per_trial.join(failed_runs, on="task")
    .group_by("task")
    .lm_reduce(
        "task, failed_runs, summary, failure_mode, reward -> common_failures: list[str], what_passing_runs_did_differently",
        instructions="Say what the agent was supposed to do and what it did ...",
        module=dspy.ChainOfThought,
    )
)
output

embedding-drift-monitor 4 of 5 runs passed

  • ✗The agent was supposed to make pairwise cosine calculations match the reference values, but the implementation returned mismatched values and failed the corresponding test. (1 of 1 failed runs)
  • ✓Passing runs tested behavior across stable, drifting, and zero-containing data … and verified that stable data avoided false alerts while clear drift was detected.

Excerpt from examples/failure_modes.py on two tasks from the sample job: 10 trials, 173 LM calls, $0.03.

One pipeline, many questions

The same operators work on finished batches and live streams, from benchmark harnesses, coding agents or anything that speaks OpenTelemetry.

Built-in failure taxonomies

For Harbor jobs, the failure taxonomies from the Terminal-Bench 2.0 paper are built in. One labels each failed run against 9 failure modes; the other classifies every failed command. Each label comes with the judge's rationale, citing step numbers.

Built-in pipelines →
from tracepress.pipelines import harbor

src = tp.read.harbor("jobs/my-job")
modes, commands = tp.collect(
    harbor.trajectory_taxonomy(src),
    harbor.step_taxonomy(src, failed_only=True),
)
On 9 failed trials from the sample job
Failure classShare of failed trials
Execution44%
Verification44%
Coherence22%

Measured, not promised

Our own measurements, each with a link to how we got it.

Jev on Who&When Pro · our measurement

⅓ the cost

One Jev call per trace matched a GPT-6-luna judge's failure-attribution accuracy for $0.34 instead of $1.06 per 1,000 traces, in about 7 seconds instead of 3.5 minutes.

How we measured →

GEPA prompt tuning · our measurement

0.62 → 0.69

Tuning a step classifier against labels raised held-out accuracy on the sample job's two tasks (160 steps) for about 2 cents. Only the tuned step reruns for each candidate prompt.

How we measured →

Works with

  • Harbor
  • Claude Code
  • Codex
  • OpenTelemetry
  • DSPy
  • OpenRouter
  • Portkey
  • Jev

Questions

Which traces are supported?

Harbor jobs, ATIF trajectory files, Claude Code and Codex sessions, and OpenTelemetry, from files or live. OTel spans that follow the GenAI conventions, OpenInference or OpenLLMetry become agent steps. DSPy traces are planned, and the tracepress-add-adapter skill helps you add a new format.

Which model should I use?

GPT-6-luna through OpenRouter is a good balance between cost, performance and speed. For stages whose answer is a yes/no, a pick from fixed options or a score, use TypeSafe's Jev: it's far cheaper and faster. You can also use Portkey, any model DSPy supports, or a model you host locally (Ollama, vLLM or any OpenAI-compatible server). Models →

What does a run cost?

It depends on the model and how much trace you feed it. The failure-modes pipeline above made 173 LM calls over 10 trials for $0.03. tp.last_run() shows calls, tokens and estimated cost after every run, and every call goes through DSPy's disk cache, so reruns only pay for prompts that changed. Local models cost nothing per call.

Does it collect telemetry? How do I turn it off?

TracePress sends anonymous usage events (versions, run counts, LM call and cost totals, which operators ran) to PostHog, and prints a one-time notice the first time it does. It never sends your data, prompts, signatures, column or task names, file paths, hostnames, API keys or error messages. Any one of TRACEPRESS_TELEMETRY=0, DO_NOT_TRACK=1 or tp.configure(telemetry=False) turns it off, and it's off in CI and under pytest. Set TRACEPRESS_TELEMETRY=debug to see exactly what would be sent. Telemetry →

Does it work on live agents?

Yes. The same pipeline runs on a finished batch or a live stream. lm_fold keeps a running note per trial as steps arrive, tp.watch.otlp() takes traces from any OTLP exporter, and tracepress serve keeps registered pipelines running on a server that any client can stream into or listen to. Live pipelines →

Start pressing your traces

Install it, point it at a job, ask a question.