CH 05 · Context Engineering and Memory · 01/18
Read as one pageContext Engineering and Memory
Context is assembled fresh each turn, not stored, and the window is a hard budget. Covers referencing data instead of embedding it.
18 slides · 14 min read
In this chapter
- 01Context is constructed, not stored
- 02Real code: pi rebuilds the request on every call
- 03The context window is a budget
- 04Reference, don't embed
- 05Real code: OpenClaw's memory search returns addresses, not files
- 06Distill external and tool data before it lands
- 07Real code: OpenCode caps every tool result at the boundary
- 08The stale-content problem
- 09Prior-turn memory: lightweight continuity
- 10Managing long histories
- 11Layering the context
- 12Real code: OpenClaw stacks workspace files in order
- 13Map user references to model handles
- 14Memory beyond the conversation
- 15Real code: OpenClaw surfaces memory per session
- 16The quiet truth about agent quality
- 17Read the source yourself
If you remember one chapter from this folder, make it this one. Context engineering (deciding exactly what goes into the model on each call) is the discipline that most determines whether an agent feels sharp or scattered. The model can only reason about what's in its context window; everything else may as well not exist. This chapter is about constructing that context well, and about the memory system that feeds it.
Finished this idea?
Your learning progress stays in this browser.