Volume VI
Context & Memory
What the model is allowed to see
Context is the product. Compaction, prefetch, structured notes, and long-term memory are not accessories — they are the difference between a demo and a system that still works on hour three of a task.
- VI.1Context EngineeringThe discipline of deciding, every turn, what tokens the model sees. More leveraged than prompt wording, more neglected than tool choice.8 min
- VI.2Compaction and ErrorsFactor 9: compact errors into the window. The general rule: every observation should be the smallest string that still lets the model choose the next correct action.5 min
- VI.3Long-Term MemoryLetta/MemGPT: a small core window, an archival store the agent can search and edit, and explicit memory operations as tools. Session logs are not memory.6 min
- VI.4Retrieval and Document AgentsLlamaIndex's claim: the hard problem is often the corpus, not the orchestrator. Agentic RAG is a router over query engines, not a smarter chatbot.6 min