Persistent AI assistants do not get memory for free. To stay coherent across days or weeks they periodically summarize and re-inject context — and that maintenance has an ongoing token cost that scales with your number of active sessions. This calculator makes that recurring spend visible, broken down by per-refresh, per-session, and whole-fleet costs so you can see where the budget goes and where to optimise.
How it works
Each refresh cycle has two cost components:
- Generation cost — output tokens spent producing the compressed summary of recent conversation.
- Injection cost — input tokens spent re-inserting that summary into the prompt for the next call (and every subsequent call until the next refresh).
The tool computes:
cost per refresh = (gen_tokens × output_price + inject_tokens × input_price) / 1,000,000
refreshes_per_month = refreshes_per_day × 30
monthly fleet cost = cost_per_refresh × refreshes_per_month × active_sessions
The result is broken into per-refresh, per-session-per-month, and whole-fleet totals.
Worked example
A support assistant that refreshes every 6 hours of active use (~4 refreshes/day), 2,000 re-injection tokens, 600 generation tokens per refresh, at $1/1M input and $5/1M output, across 5,000 active sessions:
- Cost per refresh: (600 × $5 + 2,000 × $1) / 1,000,000 = $0.005
- Per session/month: $0.005 × 120 refreshes ≈ $0.60
- Fleet/month: $0.60 × 5,000 = $3,000
Context maintenance alone is a $36,000/year line item at modest scale — well worth modelling before deployment.
Where to find the savings
Prompt caching is the single largest lever for re-injection cost. If your provider supports prompt caching (where a stable, unchanged prefix is billed at a fraction of normal input cost), the re-injected summary is the exact right target: it sits at the start of the prompt and is repeated every call. Modelling the cached rate instead of full input price often cuts the fleet cost by more than half.
Compress more aggressively. Halving the re-injected token size halves the dominant injection cost. A tighter summary format — bullet points rather than narrative prose, omitting resolved items — often loses very little semantic value.
Tier by session activity. Only sessions that received a new message since the last refresh actually need another refresh. Dormant sessions can be skipped entirely, which dramatically reduces effective refresh frequency for large fleets with mixed activity levels.
Refresh less often for low-velocity sessions. A daily personal assistant that exchanges 5 messages a day does not need a 6-hourly refresh. Match the frequency to how fast the session accumulates new context that is worth summarising.