Skip to content

analyzer

diapason.traces.analyzer

TraceAnalyzer — read-only query layer over stored traces.

Provides aggregated statistics that the learning system uses to update routing policies, tool selection strategies, and memory configuration.

RouteStats dataclass

Aggregated statistics for a specific routing decision (model+agent).

StepTypeStats dataclass

Aggregated statistics for a specific step type across traces.

ToolStats dataclass

Aggregated statistics for a specific tool.

TraceAnalyzer

Read-only query layer over a :class:TraceStore.

Computes aggregated statistics from stored traces, providing the inputs that the learning system needs to update routing policies.

export_traces(*, since=None, until=None, limit=1000)

Export traces as plain dicts (for JSON serialization).

per_route_stats(*, since=None, until=None)

Compute stats grouped by (model, agent) routing decisions.

per_tool_stats(*, since=None, until=None)

Compute stats grouped by tool name.

summary(*, since=None, until=None)

Compute an overall summary of all traces in the time range.

traces_for_query_type(*, has_code=False, min_length=None, max_length=None, since=None, until=None)

Retrieve traces matching query characteristics.

Useful for the learning system to find traces similar to a new query and learn which routing decisions worked best.

TraceSummary dataclass

Overall summary statistics across all traces.