Example teardown (illustrative numbers). This is a worked example of our method on a typical pipeline. It is not a client result. We will replace it with real, approved client numbers after our first audit.
How a $6,800/mo agent pipeline gets to $2,150/mo in 5 days
An illustrative teardown of a multi-agent pipeline for a 50-person engineering team. Same method we use in the 5-Day Sprint.
The setup (illustrative)
A 50-person engineering team runs a multi-agent pipeline:
- A planner agent on a large model breaks down tickets and coordinates the others.
- A retrieval and summarizer agent pulls docs and code context.
- A code review agent reviews every pull request.
- A test and eval runner checks agent output on each change.
- Retries are handled by a wrapper with no cap. No per-run token budget. No alerting.
Monthly spend: $6,800, up month over month. Nobody owns the number.
What the teardown found
1. Loop detection
The planner sometimes rejects a tool result and calls the same tool with near-identical input. With no step limit, some runs go 30+ steps before timing out. Overnight batch jobs make it worse because no one is watching.
Fix: step limits per run, a loop detector that stops a run when the same tool is called with near-identical input 3 times, and an alert to a human.
2. Redundant uncached calls
The retrieval agent fetches and summarizes the same docs for every ticket. The same summaries are generated many times a day.
Fix: a response cache keyed on document version, so a doc is summarized once until it changes.
3. Prompt caching
Every planner call resends a long system prompt, full tool schemas and a style guide. That prefix is identical across calls and paid at full input price each time.
Fix: restructure prompts so the stable prefix comes first and turn on provider prompt caching. Cached input is billed at a fraction of normal input price.
4. Model routing and downgrade
The large model handles every step, including classifying tickets, formatting output and summarizing docs.
Fix: route simple steps to a small model. Keep the large model for planning and hard reviews. Code review starts on a mid-size model and escalates only on large or risky diffs.
5. Context trimming
Agents pass full conversation history and whole files to each other.
Fix: pass summaries and diffs, cap history length, and drop tool output the next step does not need.
6. Retry caps and guardrails
Failed calls retry without limit and without backoff.
Fix: max 2 retries with backoff, per-run and per-day token budgets, spend alerts per agent, and a hard stop that pages a human instead of spending.
Before / after by workload (illustrative)
Example teardown (illustrative numbers)
| Workload |
Before (/mo) |
After (/mo) |
Main fixes |
| Planner agent |
$2,400 |
$900 |
Prompt caching, context trimming |
| Code review agent |
$1,500 |
$600 |
Model routing with escalation, caching |
| Retrieval and summarizer |
$1,300 |
$350 |
Response cache, small model |
| Loops and uncapped retries |
$1,100 |
$50 |
Loop detection, retry caps, budgets |
| Test and eval runner |
$500 |
$250 |
Run on changed paths only, small model |
| Total |
$6,800 |
$2,150 |
$4,650/mo saved (about 68%) |
Savings by lever (illustrative)
Example teardown (illustrative numbers)
| Lever |
Monthly savings |
| Prompt caching |
$1,200 |
| Model routing and downgrade |
$1,150 |
| Loop detection and retry caps |
$1,050 |
| Removing redundant uncached calls |
$700 |
| Context trimming |
$550 |
| Total |
$4,650 |
The 5 days (illustrative)
- Day 1: Pull billing exports and traces. Map every agent to its model, volume and cost.
- Day 2: Trace loops and repeat calls. Size each one in dollars.
- Day 3: Ship prompt caching, the response cache and context trimming.
- Day 4: Ship model routing, retry caps, budgets, loop detection and alerts.
- Day 5: Measure against the baseline, confirm output quality on real tasks, hand off the runbook.
What this means for you
Your numbers will be different. Some stacks have more waste, some less. The method is the same, and the teardown shows your number before you pay anything.
Illustrative numbers for a typical pipeline, not a client result. Real client numbers will replace this example after our first audit, with the client's permission.
Send Your AI Bill Book a Free Triage