A context window sets the practical boundary for an agent’s working memory: it limits how much prompt information, interaction history, tool context, and task results a language model can use at once. Keeping more information in context can preserve continuity, but longer prompts increase token costs, latency, and potential inaccuracies. section 9.2.3 section 9.3.1
Manage the boundary by deciding what the agent should retain:
- Store only information that helps the next step, balancing usefulness against context size. section 9.2.3
- Use prompt context for current-session information such as activity traces, synthesized summaries, and relevant interactions. section 9.2.3
- Move durable history, results, and interaction records to long-term memory, retrieving them when later tasks need them. section 9.2.3
- Treat a longer window as an imperfect solution: it may support more in-context intelligence while making the system slower and less reliable. section 9.3.1
Roadmap-update agent
An agent researching trends for a product roadmap must carry useful results into its synthesis step. It can keep a compact summary in the current prompt and retrieve prior-quarter interactions from long-term memory, rather than placing the entire history in the context window. section 9.2.3
Figure 9.14 Agents need short-term memory for the current session and long-term memory for learning and improvement over time.
Compare short-term memory for the current session with long-term memory for retrieval, learning, and improvement over time. section 9.2.3





















