Context Management Strategies
Lecture 4.2
- Strategy 1: Sliding window — keep last N messages, drop oldest
- Strategy 2: Selective preservation — keep system + key decisions + recent messages
- Strategy 3: Compaction — use the LLM to summarize conversation, restart with summary
- What to preserve in compaction: decisions, current goals, unresolved items
- What to discard: raw tool outputs already acted on, superseded plans, redundant exchanges
- When to use each strategy — trade-offs of coherence vs. efficiency
Additional Resources