Files
hermes-agent/website/docs/developer-guide
Teknium 09599f09a0 fix(prompt-cache): keep 5m chats warm between messages, compact them at the edge
Under cache_ttl: auto a person's chat starts on the 5m tier. Until now it got no idle
keep-alives before its upgrade to 1h, and the cache edge never compacted a window under
30 minutes, so every pause past 5 minutes re-wrote the whole prompt and the chat lost its
cache with nothing done first.

- Idle keep-alives now run on the 5m window too (up to 3 reads, ~17 minutes of cover), so a
  pause they cover keeps the cheap 5m entry.
- The cache edge compacts on any tier once that budget ends (the 30-minute floor is gone),
  under the same context/growth rules as before.
- An auto chat compacted on 5m moves to 1h right there (upgrade_at_compaction): the compacted
  prompt is written fresh anyway, and the chat just idled past its 5m keep-alives.
- The tier still changes only when the 5m entry is gone. Live Nous Portal probes: a request
  asking 1h over a warm 5m entry re-writes the whole prompt at 2x (5m->5m control reads it),
  and a 1h request of the same prompt only reads the 5m entry without extending it.

Backtest on the owner's real calls (34 human chats, agent.log, measured Portal rates):
keeping 5m warm between messages costs 4.1% less than today (1.9% at a 0.1x read rate);
starting on 1h costs 0.9% less.
2026-11-26 18:06:51 -08:00
..