New: Cookbooks and AI ExplanationsStep-by-Step recipes to solve problems connected to Roadmaps and Cheat Sheets. Need more details? Use AI buttons for structured and simple explanations with concrete examples throughout the whole platform.Take a look
A chat that only ever grows. Eventually the model chokes on it.
What you'll have at the end
A chat that keeps answering past the point where its full raw history would have overflowed the window, running on a short summary plus the newest few turns.
You need
You have a multi-turn chat or agent loop that already resends its running message history to the model on every call, and a way to count how many tokens that history uses before you send it.
Not covered
Making the assistant remember anything after this chat session ends, or across a brand-new one, is a separate technique with its own persistence layer; this only keeps one already-open conversation inside its token budget while it's still running.
Leans on
Chatbot won't drop the old topic
When the growth is really an unrelated new topic still dragging old facts along, not sheer length, reset the topic instead of summarizing it.
Paste only the specific part of a long document that answers the question
When one single huge paste is the growth, not many turns, trim that document before it ever joins the history.
Keep a running scratchpad through one long session
When what's slipping is track of a multi-part task's progress, not the token budget itself, a scratchpad solves that directly.
Checked 15 Aug 2026
Part of the Context Engineering cookbook