agentron
v0.1.0
Published
Agentron (Ag): a unit of agentic work volume — Ag = hours × Mtokens.
Maintainers
Readme
agentron
Agentron (Ag) — a unit of agentic work volume:
Ag = hours × Mtokens // Mtokens = tokens / 1_000_000It 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
npm install agentronUse
import { agentron, agentronTotal, formatAg } from "agentron";
agentron(1_500_000, { hours: 2 }); // 3 — a 2 h run over 1.5M tokens
agentron(316_887, { seconds: 960 }); // 0.0845
agentron(1_000_000, { ms: 3_600_000 }); // 1
formatAg(0.0845); // "0.08 Ag"
// several agents at once: sum the inputs, THEN multiply
agentronTotal([{ tokens: 1_000_000, hours: 1 },
{ tokens: 1_000_000, hours: 1 }]); // 4, not 2computeAgentron(durationMs, tokens) mirrors the reference 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.
