Skip to content
BENIBIX Learn

Hermes Context Compression

AI🪽 Hermes AgentHermes Memory

Also known as Hermes /compress, Hermes compression threshold, Hermes context summary

How Hermes shrinks a long chat. It sums up old turns at half the window.

Think of it like

It is like telling a long story again in a few lines. Then there is room to talk.

Example

Sara's chat with Hermes runs all afternoon. At half the window, the morning's turns become one short summary, and the chat keeps going.

Why it matters

Without it, a long chat hits the window limit and fails. With it, a session can run for hours.

Definition

Context compression is how Hermes stops a long chat from overflowing the model's context window. When the chat fills half the window, Hermes asks a model to sum up the older turns. The summary takes their place, and the most recent turns stay word for word. Before that, it saves anything worth keeping to memory. You can also run it yourself with /compress.

Example code

yaml
compression:
  enabled: true
  threshold: 0.50
  protect_last_n: 20
Summarise at half the window, and keep the last 20 messages as they are.
At half the window, the old middle turns become one short summary.

Common mistake

Trusting a detail from early in a long chat. After a summary, the exact words may be gone.

Key takeaways

  1. 1
    Half full. The default trigger is 50 percent.
  2. 2
    Recent stays. The last turns are kept word for word.
  3. 3
    Memory first. Facts are saved before the summary.