HeadlinesBriefing favicon HeadlinesBriefing.com

3x LLM Cost Spike: The Multi-Agent Surprise

Towards Data Science •
×

A move to a multi-agent architecture, using Lang Graph for coordination, unexpectedly tripled LLM costs despite no change in user-facing tasks. Initially, the team suspected fan-out issues, but instrumentation revealed that silent retries due to validation failures were the primary culprit. These retries, triggered by minor errors like malformed tool calls, would silently re-invoke agents, rebuilding upstream context and re-running previously successful work.

Standard retry mechanisms like capping attempts and exponential backoff offered only marginal improvement because they didn't address the core problem: paying premium prices for every retry, regardless of task complexity. A malformed tool call from a summarization step, for instance, didn't warrant the same expensive model as a complex reasoning failure.

The effective solution involved three simultaneous changes: routing agents by task complexity to use cheaper models for simpler tasks and powerful models for reasoning-intensive ones; trimming context passed between agents to prevent unnecessary data inheritance; and implementing a more granular retry strategy that didn't default to the most expensive model for every failure. This multi-pronged approach finally brought costs under control.