Urgent.News

What's breaking now, across thousands of outlets.

AI

A 5-column CSV that stops your AI agents from silently burning money

Most agent cost problems are not model-pricing problems. They are untracked-run problems: nobody can say which run spent what, for which task, and whether the output was used. Here is the minimal tracking schema I use for every autonomous agent run. You can start with just a CSV. The 5 columns column why it matters run_id lets you join logs, costs and outcomes agent_role which agent spent the…

Many AI agents consume resources without clear cost tracking, leading to runaway expenses. The author describes a simple solution: a CSV log that captures key data points for each autonomous agent run. The 5 columns contain:

- run_id: to link logs, costs and outcomes

- agent_role: the agent that incurred the spend

- tokens_in / tokens_out: raw input and output data sizes

- cost_usd: cost tracked at write time

- outcome: result (shipped, no_action, failed, retried)

The author highlights three key metrics derived from this data:

1. Cost per shipped outcome: total spend divided by outcomes marked as shipped. Rising costs indicate inefficiencies.

2. No-action burn: total cost for runs with outcome "no_action". This wasteful spend often accounts for 20-40% of resources in loops that read state without acting.

3. Retry multiplier: number of runs per task. More than 2 suggests a prompt or tool issue rather than a budget problem.

The author provides a minimal Python logger to write these fields to a CSV file. The CSV should be opened in append mode, with a header row and a new data row for each run. The logger should be called in a finally block so failed runs are still recorded. Measuring cost per useful outcome rather than cost per call is also recommended, as the habit matters more than the tool. The author has packaged this schema as a Notion database template with CSV starter and views, available for a minimal fee.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

AI seen as key for developing nations

Artificial intelligence (AI) can help emerging markets enhance productivity, bridge skill gaps and reduce costs through localisation, according to AI venture capitalists and startups at the IMF-World…

AI seen as key for developing nations

Artificial intelligence (AI) can help emerging markets enhance productivity, bridge skill gaps and reduce costs through localisation, according to AI venture capitalists and startups at the IMF-World…

More from Thursday 15 October →