Advanced
Open
Pro
Choosing a Compaction Strategy for a Long-Running Agent
You're building an agent that helps engineers debug production incidents. A session can run 60+ turns: the agent runs commands, reads logs, forms hypotheses, and reports findings. Conversation history at turn 60 would be roughly 90,000 tokens if kept verbatim — well past your 20,000-token practical budget for this endpoint. You need a compaction strategy.
- Compare truncation, prose summarization, and structured notes for this specific use case (a debugging agent), and recommend one — justify against what a debugging session actually needs to preserve, not compaction methods in the abstract.
- Your recommended approach still needs a concrete update policy — when does compaction run, and what triggers it? Propose one.
- Identify one specific piece of information a debugging session would be at high risk of losing under your recommended approach, and propose a mitigation that doesn't just mean "compact less aggressively."
Share this question