An agent that can retry forever is not resilient. It is a potentially unbounded bill and an unpredictable user experience.
Evidence check: 25 October 2026. Product details reflect the referenced documentation observed at this cutoff; exact plans, prices, regional eligibility and unverified release dates are not claimed. This is an editorial guide, not a hands-on test.
Count the complete path
The cost of an agent request is more than the final text response. It can include model input and output, tool calls, retrieval storage, hosted runtimes, database queries, browser sessions, tracing, human review and retries. In a multistep plan, each model turn may include an expanding history and previous tool results. Rather than inventing a universal “cost per task,” measure the actual sequence for representative task classes.
A simple capacity model
Define attempt_cost = sum(model_usage + tool_usage + runtime_usage) and completed_task_cost = sum(all attempts for the same task) / confirmed completed tasks. Track failures as part of cost, not as free discarded runs. For capacity planning, set a maximum number of model turns, tool calls, browser actions and retries per task. Alert if the budget is exhausted, and provide a safe partial result instead of pursuing the goal indefinitely.
Reduce waste at the architecture level
Run cheap validation and deterministic filters before asking a model. Avoid agent planning when the next step is obvious. Retrieve fewer, more relevant documents but check whether answer quality suffers. Cache immutable public reference material with version and expiry rules; do not cache private account state across users. Route only truly ambiguous cases to expensive open-ended reasoning.
Latency design
Streaming an answer can make a user feel informed but does not shorten a pending external operation. Identify the critical path: document conversion, sequential model turns, search wait, approval wait and tool execution. Parallelize independent read-only requests where safe; serialize conflicting writes. Store task state so long jobs can become asynchronous from the user’s perspective without losing traceability.
What to report
Show median and tail latency, cost per confirmed completion, escalation rate and failed-attempt spend. Break out provider and model versions and disclose the observation window. A supposedly lower-cost model may cause more recovery work; compare full workflow outcomes, not only price per token.
Choosing an engine
Haystack advises fixed pipelines when order and calls are predictable. Adopt dynamic agent routing when the incremental flexibility improves a measured task outcome enough to justify complexity and risk.
Budget a complete workflow
A task may require one planner call, several retrieval calls, tool waiting time, a verifier pass and a human review. Estimate worst-case runtime with a critical-path diagram; parallelizing independent reads may shorten elapsed time but increase concurrency and rate-limit pressure. Allocate a maximum number of model turns, tool calls, wall-clock minutes, retrieved-document bytes and cumulative spend per run. A budget exhaustion outcome should preserve a resumable draft and explain which evidence was not checked.
Watch the tail, not just averages
Operators should distinguish typical latency from p95 and p99 delay, especially when an external API slows down. Track abandonment and approval wait separately from model inference. For pricing, avoid hardcoded currency assumptions: tokens, cached content, retrieval storage, function calls and browser runtime may use different billing units and effective dates. Link cost records to the AI10 dated pricing ledger. Compare cost per accepted outcome, not merely per generated answer.
Sources and Further Reading
- deepset — Haystack: Choosing between pipelines and agents (accessed 2026-10-25)
- OpenAI — OpenAI Agents SDK: Tracing (accessed 2026-10-25)
- Cloudflare — Long-running agents (accessed 2026-10-25)