Skip to main content

The compression problem

Agent context windows fill up. When they do, the agent compresses — summarizing conversation history to free space. Plaintext facts embedded in that history are destroyed or degraded.

Why FDM survives

The [MEM] block survives compression in two ways: If the compressor keeps it: The block is 512 tokens of opaque signal. A compressor treating it as a semantic unit will either keep it whole or drop it. If kept, the signal is intact and the model can still decode all 40 channels. If the compressor drops it: Call /flush before compression fires. The server re-encodes all facts from the persistent .mem file and injects a fresh [MEM] block. The compressor sees a brand-new signal.

The /flush mechanism

Agent context grows → agent decides to compress
→ plugin calls POST /flush
→ server loads .mem file
→ re-encodes all facts into fresh FDM signal
→ injects fresh [MEM] block
→ compression fires on fresh signal
→ facts survive into next session
This is why Spectral Memory is lossless by construction: the .mem file on disk is the ground truth. The signal in the prompt is a projection of it. /flush always reconstructs a valid projection from the source.

Wiring /flush in the Hermes plugin

The Hermes plugin calls /flush automatically before the agent’s /compress endpoint. No manual wiring required. If you are integrating manually, call /flush before any operation that truncates the agent’s context window.