Skip to slide
071 / 221

CH 05 · Context Engineering and Memory · 11/18

Read as one page

Managing long histories

Conversations grow past the context budget. Strategies, in rough order of preference:

  • Recent-window: include the last N turns verbatim. Simple, and often enough.
  • Summarise-and-prepend: periodically compress older turns into a running summary, keep recent turns verbatim. Preserves the gist while bounding tokens.
  • Selective recall: store all history in the database and retrieve only the turns relevant to the current message (semantic search over history). More complex; useful for very long-lived conversations.
  • Event-log replay with selective inclusion: store rich turn events durably, but include in context only what the current turn needs.

Whatever you choose, the principle holds: history lives in durable storage; you load a curated slice into context.

Finished this idea?

Your learning progress stays in this browser.