All Questions
Agents And Tool Use hard

A research agent averages 40 steps per task, and each step appends roughly 3,000 tokens of tool output. Finance estimated cost as 40 times the cost of one call with the initial prompt. Actual spend is more than an order of magnitude higher. What explains the gap, and what is the fix?

  1. A Output tokens dominate because the model's reasoning lengthens every step; capping max output tokens per step restores the original estimate.
  2. B Every step resends the growing transcript, so input tokens grow roughly quadratically with steps; clear or compact tool results once used.
  3. C Per-step cost should be constant, so the overrun points to hidden duplicate retries; adding idempotency keys to tools will close the gap.
  4. D Prefix caching makes the repeated transcript nearly free, so the gap must come from tool execution; move tools to cheaper compute.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions