After many tool calls returning huge blobs, the agent slows down and loses the thread.
- AAppend every full result to the history
- BSummarize / trim tool results before adding them
- CMove to a model with a larger context window so every full result still fits in the history
- DRestart the conversation each turn
Answer: B
Summarize / trim tool results before adding them
Why
The context window is finite. Summarize or trim large tool outputs so the signal survives - don’t append everything verbatim.
- ContextA long conversation is nearing the context-window limit and you must free space.
- 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.
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