Stop guessing.
Compare agent trajectories.
Static string assertions cannot evaluate non-deterministic agents. AgentDiff maps and compares execution traces as DAGs in CI/CD — automatically quantifying trajectory drift, redundant tool loops, and resource regressions.
Interactive trajectory blueprint
Engine specifications
Trajectory divergence
Quantifies structural execution difference using graph alignment algorithms. Detects when model upgrades lead to fully divergent tool paths.
Wasted effort index
Calculates ratios of redundant or abandoned tool execution steps, flagging prompt modifications that cause unproductive token consumption.
Loop buster analysis
Exposes cyclical tool calling patterns where an agent repeatedly queries the same endpoint with identical parameters without state progress.
CI/CD regression block
Standardized JSON export format integrates natively into GitHub Actions and GitLab pipelines. Fail builds when cost drift or loops cross limits.
Zero boilerplate DX
AgentDiff exposes a programmatic Python SDK tailored for testing frameworks like `pytest`, alongside a strict CLI runner for automated pipeline integration.
import pytest
from agentdiff import load_trace, compare
from agentdiff.testing import assert_no_regressions
def test_agent_refactor_efficiency():
# load_trace() auto-detects format: generic, deepeval, openinference, langfuse
baseline = load_trace("tests/traces/baseline.json")
candidate = load_trace("tests/traces/candidate.json")
# Run the DAG-LCS comparison engine
report = compare(baseline, candidate)
# Expressive assertions — raises AssertionError with full report on failure
assert_no_regressions(
report,
max_divergence=0.25, # TDI threshold [0.0 - 1.0]
max_cost_increase_pct=5.0, # Max LLM cost increase allowed
allow_loops=False, # Fail if tool loops detected
max_wasted_effort=0.10, # Max WEI (failed/retry steps ratio)
)