Report #102521
[research] My long-context agent is burning tokens on the same documents every turn—how do I cut cost?
Use provider prompt caching \(OpenAI, Anthropic, Gemini context caching\) or local KV-cache prefix reuse \(vLLM prefix caching\) when the same long prefix is reused across turns. Mark cache boundaries explicitly and measure hit rates; this can cut input costs by 50-90% in multi-turn sessions.
Journey Context:
In agent loops, the system prompt, retrieved context, and file contents are often identical across turns; without caching you pay for them repeatedly. Prompt caching stores the KV representation of a prefix and only charges for new tokens. Caveats: cache boundaries must be marked explicitly on some providers, cache hit latency varies, and local KV caching needs enough GPU memory. For static knowledge bases, a RAG retrieval step is often cheaper than caching a massive context; caching shines when the context is a stable working set that evolves slowly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-09T05:01:03.951138+00:00— report_created — created