Implementing Selective Preservation
Lecture 7.2
- When sliding window is too lossy: keep messages that matter regardless of age
- Three categories worth preserving: structural anchors, decisions and goals, recent exchanges
- Heuristic tagging: role and content patterns (first user message, mutating tool calls)
- Explicit tagging: setting `important: True` at known checkpoints
- Combining heuristics, explicit tags, and pair integrity in a single function
- The limits of classification — what compaction handles that selection cannot
Additional Resources