[Enhancement]: Automatic context compaction #7484
Replies: 1 comment 2 replies
-
Thank you for your feature request about context compaction. I want to clarify that we already have a similar feature in place, but there's definitely room for improvement based on the Forge implementation you shared. Our system already intelligently manages conversations when they get too long by selectively removing older messages while preserving critical information. This helps prevent hitting token limits while maintaining conversation quality. The key difference between our current approach and what Forge implements is:
Potential Improvements We Could MakeBased on the article and code you shared, we could enhance our system to:
If you're experiencing this, you're reaching the model's upper limit beyond the 90% allotted by the system (which is not perfectly accurate but "good enough"). I'm not sure how critical this might be to implement because on the next turn the model should then get back at least 10% of its limit. This would still be worthwhile exploring so I thought it'd be good for me to outline. As mentioned before, control options could help net improvements without the complexity of adding summaries into the mix, because we could control the context window more, especially once a certain threshold is met, etc. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What features would you like to see added?
When large chunks of text are returned from the MCP tool, it is very easy to consume whole context of the model. It will just stop generating next tokens.
One of the approach to tackle that is to automatically compact the context. This is what Claude Code does when you are approaching the limits.
More details
Prompt for compacting the conversation: https://www.reddit.com/r/ClaudeAI/comments/1jr52qj/here_is_claude_codes_compact_prompt/
A bit of theory and implementation example in Forge
Which components are impacted by your request?
General
Pictures
No response
Code of Conduct
Related
#1179
Beta Was this translation helpful? Give feedback.
All reactions