Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ The action-authorization rule is the senior signal: a prompt-level guardrail is

### 4 · Cost — per incident, with a runaway breaker

One incident fans out across four LLM calls plus a Tavily search, so the cost unit is the **whole incident**, not a single call. Per-node token cost and Tavily call cost are summed, logged to the Langfuse trace as `total_cost_usd`, and returned in the API response. Two controls sit on top: the per-account run limit (5) bounds each account's lifetime spend, and a **circuit breaker** aborts any single incident that exceeds `MAX_INCIDENT_USD` before the next LLM call — so a reject→loop-back cycle can't quietly burn money. Average cost per incident is **~$0.02**; the Langfuse cost view is screenshotted in [`docs/cost-per-incident.png`](docs/).
One incident fans out across four LLM calls plus a Tavily search, so the cost unit is the **whole incident**, not a single call. Per-node token cost and Tavily call cost are summed, logged to the Langfuse trace as `total_cost_usd`, and returned in the API response. Two controls sit on top: the per-account run limit (5) bounds each account's lifetime spend, and a **circuit breaker** aborts any single incident that exceeds `MAX_INCIDENT_USD` before the next LLM call — so a reject→loop-back cycle can't quietly burn money. Average cost per incident is **~$0.02**; the Langfuse cost view:

<p align="center">
<img src="docs/cost-per-incident.png" alt="Langfuse trace showing per-node cost breakdown and total_cost_usd for one incident" width="720"/>
</p>
<p align="center"><sub>Langfuse — <code>total_cost_usd</code> and per-node LLM/tool breakdown for one incident run</sub></p>

### 5 · Durability — survive the human pause and the cold start

Expand Down Expand Up @@ -433,7 +438,7 @@ make verify # confirm all imports resolve
| Slack webhooks | $0 |
| **Total infrastructure** | **$0/month** |

Anthropic API cost per incident run: **~$0.02** (4 agents × ~500 tokens each at Claude Sonnet pricing), tracked per incident in Langfuse and capped per run by the cost circuit breaker (`MAX_INCIDENT_USD`). See [`docs/cost-per-incident.png`](docs/) for the Langfuse cost view.
Anthropic API cost per incident run: **~$0.02** (4 agents × ~500 tokens each at Claude Sonnet pricing), tracked per incident in Langfuse and capped per run by the cost circuit breaker (`MAX_INCIDENT_USD`). See [Layer 4 · Cost](#4--cost--per-incident-with-a-runaway-breaker) for the Langfuse trace screenshot.

---

Expand Down
Binary file added docs/cost-per-incident.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading