A 3-step agent cost me $4.20. agenttrace showed me the O(n ) tool call hiding in plain sight.
A developer discovered a significant cost overrun in an AI agent, escalating from an estimated $0.12 to $4.20 for a three-step process. The issue stemmed from an unbounded loop in the agent's cite-check step, causing input tokens to grow quadratically with each iteration due to re-attaching the full prior history. The developer implemented a fix using a sliding window approach, reducing the cost to $0.14 and highlighting the utility of the agenttrace-rs crate for diagnosing such performance and cost issues by providing detailed breakdowns of LLM calls. AI
IMPACT Provides developers with a tool to diagnose and fix costly LLM agent behavior, potentially reducing operational expenses.