firehose> #llmops

Context Compression

The mechanism that keeps a long-running conversation inside a finite context window: when the accumulated message history crosses a threshold of the window, the agent summarizes the previous messages, replaces them with the summary, and appends it to the context — so the conversation continues with its load-bearing state intact but its token footprint collapsed. Three design decisions define an implementation: when to trigger (the threshold, and at which moments it is checked), how usage is measured (estimation vs provider-reported token counts), and what the summary preserves (the structure of the compression prompt — the quality lever that decides whether the agent "forgets" mid-task). The Hermes implementation is the worked example: default trigger at 50% of the window, checks before every turn plus on context-window errors, chars÷4 estimation until real usage numbers exist, and a rich structured summary prompt.

Claims


Linked from