AI Agents Book

Primitive of the day · 2026-10-28

tiered-history-compression-ladder

Compress conversation history on a three-level ladder triggered by a token threshold (e.g., 4K): keep the last K turns verbatim; summarize earlier turns into bullet-point key decisions; aggressively reduce to key facts, decisions made, and current state.

When this applies

Accumulated conversation history is approaching or past the pipeline's history token threshold.

Preconditions

Do this

Escalate one level at a time as pressure grows: level 1 keeps the last K turns verbatim; level 2 bullet-summarizes earlier turns' decisions; level 3 compresses everything older into key facts, decisions, and current state.

What you should see

History cost stays bounded while recent turns remain verbatim and older decisions survive as summaries.

How it fails if ignored

Aggressive levels lose nuance a later step needed; summarization itself introduces errors that then masquerade as ground truth.

Do not use when

Short sessions under the threshold; audit contexts where verbatim history is a requirement.

Kind: calibration. Part of the skill Context pipeline assembly. Free to reuse in your own agent skills.

Get the whole skill

All 8 primitives of this skill as one package, with the order to apply them.

Get just this primitive

This one primitive for 1 credit (≈ €0.10); the other primitives of the skill are on its page.

Upgrade your own skill

Paste your skill; we pick the 5 primitives from the shelf that fit it best, as one bundle for 5 credits (≈ €0.50).

Upgrade my skill

Register interest

Interest only — no payment, no order, no reservation. After you confirm by email we send you one free sample primitive.