S.S
All posts
Soufiane Sejjari··8 min

Compressing Conversation History Without Losing What Matters

Naive summarization destroys exactly the details users ask about later. The compression strategy behind iRemember: episode-vs-fact split, progressive oldest-first gating, temporal anchor preservation, and a probe-question evaluation method.

Compressing Conversation History Without Losing What Matters

Long-horizon agents hit a wall: the history grows, retrieval gets noisier, context budgets stay finite. Compression is the obvious answer — and naive summarization is the obvious mistake.

We learned this on iRemember: our first summarizer made conversations shorter and the assistant dumber. Users asked "what exactly did he commit to?" and the summary said "discussed plans." This post is the strategy that replaced it.

Summaries answer the wrong question

A summary optimizes for narrative coherence. Memory queries are evidential: exact promises, dates, numbers, who-said-what. Those are precisely the details summaries flatten.

Rule one: compress episodes, keep facts. Anything the extractor classified as a durable fact lives independently and never depends on a summary surviving. Summaries carry only atmosphere and flow.

Progressive, gated compression

Compression runs oldest-first under a coverage gate:

  1. Take the oldest uncompressed segment
  2. Verify every durable fact inside it exists as a standalone structured memory
  3. If yes -> replace segment with a compact episode summary
  4. If no -> extract first, compress next cycle

The gate matters more than the summarizer quality. A brilliant summary over an unextracted fact is permanent data loss.

Preserve temporal anchors

Relative dates rot fastest. "After the Rabat trip" becomes meaningless when the Rabat trip itself got compressed away. Our compressor must resolve relative anchors to absolute ranges ("2026-03-14 -> 2026-03-20") before deleting anything. This single rule fixed most of our time-sensitive retrieval failures — the same failure mode LongMemEval highlights.

Evaluate with probe questions, not vibes

Before compressing any segment we generate probe questions answerable from its raw text ("what budget did she approve?"). After compression, each probe must still be answerable from the retained store. Any failed probe blocks that compression cycle and routes the segment back to extraction.

This turns compression from a leap of faith into a tested operation — same philosophy as write control: nothing leaves the system without evidence it's safe to lose.

Numbers, honestly

On our internal set (~120 compressed sessions): probe-pass rate 97.2% after adopting the gate + anchor rules, versus 81% with plain summarization. Storage dropped ~60%. Not a benchmark paper — but reproducible method, published numbers.

#LLM#Memory#RAG

FAQ

Why not just summarize old conversation history?

Summaries preserve narrative but destroy retrievable specifics. Users ask 'what exactly did she promise?' not 'what was that chat about?'. Compress episodes, keep extracted facts intact.

When should history be compressed?

Progressively and oldest-first, gated by structured coverage: a segment is only compressible once every durable fact inside it exists as an independent structured memory.

How do you verify compression didn't lose information?

Probe questions. Before compressing a segment, generate questions answerable from its raw text; after compression, they must still be answerable from the retained store. Failed probes block the compression.

Soufiane Sejjari

Software Engineer · AI Researcher