agentron
Agentron (Ag) — a unit of agentic work volume:
Ag = hours × Mtokens // Mtokens = tokens / 1_000_000
It fuses the two things that actually cost during an agent run — wall-clock time and tokens — into one comparable number (think kWh, not km/h).
Install
[]
= "0.1"
Use
use ;
agentron; // 3.0 — a 2 h run over 1.5M tokens
agentron; // 0.0845
compute_agentron; // 1.0 (durationMs, tokens)
format_ag; // "0.08 Ag"
// several agents at once: sum the inputs, THEN multiply
agentron_total; // 4.0, not 2.0
compute_agentron(duration_ms, tokens) mirrors the reference JS implementation
in gravitymir/agent_web.
Why multiply for multi-agent?
Parallel agents share the same real-time window, so their combined volume
multiplies rather than adds: two agents, each 1 h over 1M tokens, give
(1+1) × (1+1) = 4 Ag, not 2 Ag.
License
MIT. Part of https://github.com/gravitymir/agentron.