The Real Fullstack

The Expensive Agent Loop

The task was “find invoice 4411 and email a summary”. Why did one run cost more than a month of the old script?

高级工程师9 分钟时间线模拟器性能实验室
ai-agentsllmpythonobservability

此挑战尚未翻译为简体中文,你正在阅读英文版本。

任务:Keep a run under $0.10 and make it end usefully — with an answer or an explicit hand-over — instead of looping.背景 · 学习目标 ▾

Larkspur's back-office agent can search documents, read files and send emails. A user typed “invoce 4411”. The search tool returned nothing, and the agent kept retrying the same query until it hit the 40-step limit, resending the growing conversation each time.

任务: Keep a run under $0.10 and make it end usefully — with an answer or an explicit hand-over — instead of looping.

学习目标

  • Explain why agent costs grow quadratically with steps.
  • Detect repeated tool calls and force a change of strategy.
  • Use budgets and graceful escalation, not just step caps.
模拟模拟数据

运行模拟以查看输出。

运行模拟

运行模拟以查看输出。

简化说明

Deterministic agent script; each step costs a base amount plus the accumulated history. 教学模型——数字用于说明行为,并非基准测试。

概念

相关挑战

参考资料