"front"	"back"	"tags"
"How much more do agentic tasks cost compared to equivalent chat tasks?"	"Up to 1,000x more tokens (Stanford-MIT, arXiv 2604.22750). Chat is one request/response (~500 tokens). Agents are loops that re-send full context every turn, compounding via five mechanisms."	"c1::dd24::recall"
"What percentage of total agent inference bills is re-sent context?"	"62% (Stanford Digital Economy Lab). Every provider call re-sends the system prompt, conversation history, and tool definitions. The same tokens billed again and again — the largest single cost and the most invisible."	"c1::dd24::recall"
"What are the five mechanisms in the multiplier stack that compound to 1,000x?"	"1. Re-sent context (62% of bills), 2. Tool-call fan-out (multiplicative sub-agent trees), 3. Retry loops (3 retries triple cost; unbounded = unbounded cost), 4. Quadratic attention (O(n²) in sequence length), 5. Context rot (30%+ degradation at mid-window → more retries → more cost)."	"c1::dd24::recall"
"What is the @token_meter interceptor pattern and what are its three enforcement actions?"	"An interceptor that wraps every provider call, tracks cumulative token usage against a per-task budget, and enforces: throttle at 80% (switch to cheaper model, reduce context), rollback at 100% (abort + restore prior state), circuit-break on retry storms (stop the loop immediately)."	"c1::dd24::recall"
"What is LLM inference as a percentage of total cost of ownership for an agent?"	"~20% TCO. The majority lives in context management (the 62% re-sent-context problem), retrieval/RAG, and orchestration/eval/governance (the hidden 80% that teams don't budget for)."	"c1::dd24::recall"
"What discount does prompt caching provide, and what kills it?"	"Up to 90% reduction on cached tokens (Anthropic). It is prefix-based — the cache hits only if the beginning of the prompt is identical across calls. Dynamic content in the prefix (timestamps, session IDs, per-request UUIDs, or framework-injected dynamic IDs) invalidates the cache."	"c1::dd24::recall"
"What is the prime directive of cost optimization?"	"Cutting cost 80% while dropping success rate 50% produces a broken-cheaper agent, not an optimized one. Cost optimization must hold success rate constant (or improve it) while reducing cost. RouteLLM (85% cut at 95% quality) and prompt caching (90% cut at 100% quality) do this correctly."	"c1::dd24::recall"
"Why does a 100K-token context cost MORE than 10x a 10K-token context?"	"Transformer attention is O(n²) in sequence length. Doubling context more than doubles the compute cost per token. Longer contexts are superlinearly more expensive, not linearly."	"c1::dd24::analysis"
"Why is context rot a cost amplifier, not just a quality problem?"	"As context fills, accuracy degrades 30%+ at mid-window (Stanford). Worse results trigger more retries, each retry re-sends the full context, each retry costs more. Context rot drives retries, retries drive cost. It is a cost amplifier disguised as a quality issue."	"c1::dd24::analysis"
"Why must budget be checked BEFORE the provider call, not after?"	"By the time you've paid for the call, it's too late to prevent the spend. The @token_meter checks projected usage against budget BEFORE the call. If projected > 100%, rollback before the call happens. If > 80%, throttle before paying full price."	"c1::dd24::analysis"
"What are the four trip conditions for the circuit breaker?"	"1. Consecutive retries >= threshold (e.g., 5 — same tool failing 5x is a storm). 2. Total session retries >= threshold (e.g., 20). 3. Fan-out depth >= threshold (e.g., 3 levels of sub-agents — 3^5=243 calls). 4. Tokens-per-minute exceeds threshold (50K/min = tight loop; healthy sessions are bursty)."	"c1::dd24::application"
"Why must the circuit breaker be reset manually, not automatically?"	"Automatic reset produces a flapping breaker — it trips, auto-resets, the storm resumes, it trips again, forever. Manual reset forces an operator to investigate the cause before resuming. The storm is a symptom; the breaker ensures someone looks at the disease."	"c1::dd24::analysis"
"What are the three HITL cost thresholds and what happens at each?"	"50%: log to operator dashboard, no interruption. 80%: warn + offer choice (continue? cheaper model? abort?) — human decides. 100%: hard stop, no more spending without explicit override (task paused, not killed)."	"c1::dd24::application"
"Why does HITL at every turn (or every 10% of budget) fail?"	"Alert fatigue. If the human is interrupted constantly, they stop reading the alerts and rubber-stamp everything. HITL must be at meaningful decision points — typically one or two per session — not at frequent intervals."	"c1::dd24::analysis"
"What is the 27x price spread and how does cost-aware routing exploit it?"	"GPT-4o costs ~27x more than GPT-4o-mini. RouteLLM (UC Berkeley, ICLR 2025) routes cheap queries to cheap models, cutting cost 85% at 95% quality. In agents: early turns (planning, decomposition) use the strong model; execution turns (tool calls, simple reasoning) use the cheap model. Switch mid-session based on phase."	"c1::dd24::application"
"How does cost-aware tool selection work?"	"Annotate each tool with a cost estimate (free for local tools, per-query for search, per-call for paid APIs). At planning, route to cheaper paths when multiple tools could accomplish the same goal. At throttle threshold, skip expensive tools and fall back to cheaper alternatives."	"c1::dd24::application"
"Why is switching to a cheaper model (Layer 1 optimization) insufficient for cost reduction?"	"It addresses only ~20% of TCO. The majority of cost lives in context management (62% of inference bills), retrieval/RAG, and orchestration/eval/governance (the hidden 80%). A cost-optimization effort focused only on model choice ignores 80% of the spend."	"c1::dd24::analysis"
"What is the 'hidden 80%' in agent cost?"	"The orchestration, eval, and governance infrastructure — the layer that drives the loop, checks outputs, logs, and audits. Teams budget for Layer 1 (inference) and are surprised by this operational overhead. It's called the hidden 80% because it's the cost of making an agent production-ready, not just functional."	"c1::dd24::analysis"
"How does blind throttling violate the prime directive?"	"Throttle switches to a cheaper model. The cheaper model may fail at tasks the strong model handled. Without quality monitoring, you won't know you're producing worse outputs — you'll just see lower costs. Cheaper-and-broken is not optimized. Throttle must be paired with a quality check: if cheap-model output confidence is low, fall back to the strong model for that turn."	"c1::dd24::analysis"
"How does the cost-aware loop relate to Pi's loop architecturally?"	"The cost-aware loop is a WRAPPER, not a rewrite. You add the @token_meter interceptor at the provider-call boundary. The loop structure stays the same (call model → tools → repeat). Pi's loop + meter.check + meter.record = cost-aware loop. This is how you turn a personal harness into an enterprise harness without redesigning the loop."	"c1::dd24::application"
"What is the single highest-ROI cost optimization for agents that most teams miss?"	"Prompt caching. Up to 90% reduction on cached tokens, zero quality loss. The barrier is prefix stability — any dynamic content (timestamps, IDs) in the first tokens invalidates the cache. Audit the prefix, move dynamic content after the stable portion. One change, 90% savings."	"c1::dd24::application"
"Why should cost be reported in dollars, not just token counts?"	"Token counts are abstract. '500K tokens' doesn't feel expensive until you convert: at $5/M input, that's $2.50/session. For 10K sessions/day, that's $25K/day. The business understands dollars. Always convert for reporting — it's the number that drives decisions about whether the agent is sustainable."	"c1::dd24::application"
