A long conversation is nearing the context-window limit and you must free space.
- ADrop the system prompt and the earliest tool results to make room, since the model has already absorbed what they said.
- BSummarise the older turns into a compact running summary and keep the recent turns verbatim.
- CTruncate the newest message so the history stays intact.
- DAlways switch to a bigger-context model instead.
Answer: B
Summarise the older turns into a compact running summary and keep the recent turns verbatim.
Why
Compress history by summarising the old turns while keeping recent turns and the system prompt verbatim. Dropping the system prompt or truncating the newest message loses the parts the model needs most; a bigger model just defers the same problem.
- ContextAs the context grows you must decide what MUST always stay in the window.
- ContextThe agent might need facts from a 200-page manual to answer some questions.
- ContextYou enabled prompt caching, the system prompt is huge and identical every time - and the savings are zero.
- ContextInstructions placed in the middle of a very long prompt are followed far less often than the same words at the start or end.
More on Way of the Agent
- Course programThe first three modules are free: start in the browser or the app, no card needed.
- Library: guides, skills and promptsReady prompt templates, grouped into collections.
- AI ChroniclesSourced stories from the history of AI.
- ConceptsPlain-language explainers of agent engineering.
- Learn AI agentsApps and courses for learning AI agents, compared honestly.
Real situations from building agents - with the answer and why.
Solve a new one every day on the Path