Core Concepts

EntroPy treats agent behavior as a distribution, not a single output. The central idea: run an agent many times, record what happened each time, then summarize the distribution with entropy-based metrics.

AgentRun

One execution of an agent on a single input. An agent may return an AgentRun directly, or EntroPy wraps a plain return value into one.

FieldTypeMeaning
run_idstrUnique id for the run
inputAnyThe input the agent received
outputAnyThe agent's output
eventslist[Event]Recorded behavior (actions, tools, reasoning…)
costfloatCost of the run (optional)
metadatadictLatency, errors, custom data

Events

Behavior is captured as a sequence of typed Events. The built-in event types carry semantic meaning for metrics:

EventtypeUsed by
ActionEventactionPrimary action label, entropy, drift
ReasoningEventreasoningPlan quality, consistency
ToolCallEventtoolTool reliability, selection, thrashing
ObservationEventobservationBehavior trajectories
MemoryReadEvent / MemoryWriteEventmemory_read / memory_writeMemory metrics
ErrorEventerrorFailure / recovery / robustness
StateTransitionEventstateTrajectory graph

Trace & Graph

A Trace collects runs plus an optional behavior graph (Node / Edge). It exposes exporters: json(), df(), graph(), otel(), and zip(path).

Suite & Batch

The Suite runs an agent trials times per case and produces a Batch per input. Each Batch summarizes one input's trials: outputs, behaviors (trajectory signatures), actions, tool_calls, successes, costs, errored, recovered. Metrics consume batches; the suite averages each metric across inputs to produce the final result dictionary.

Results dictionary

Suite.run() returns a flat dict of metric name → value (or list for confidence_interval and the emergent_behavior / behavior_fingerprint signatures). Numeric values are in [0, 1] where a bound applies.

Evaluation layers

Metrics are organized into six evaluation layers (see Metrics Catalog):

  1. Reasoning — plan quality, adherence, consistency
  2. Tool — correctness, reliability, selection
  3. Execution — completion, latency, cost, recovery
  4. Behavioral — entropy, variance, drift, loops
  5. Robustness — resilience to failure
  6. Drift — long-term behavior change