Lesson 2 · Unit 01
Context is working memory
The window fills as the agent works; clip, filter and compact
What you practise
- Everything the agent knows is in the window each turn
- How it fills up
- Trimming and summarising old turns
- Large tool results
- What is lost when you compact
Try a question from this lesson
Pick one
A window holds 50,000 tokens. Instructions and tool definitions take 10,000. Each step adds a 2,000-token tool result. After how many steps is it full?
Correct answer
20
Why
40,000 tokens are free and each step uses 2,000 of them, so 20 steps. Real steps also add the model's own requests, so it fills sooner. An agent that works for long enough always meets this wall.
The ideas
Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.
Concept
Everything, every call
The model starts every call from zero. All it knows about the task is what the program sends: instructions, tool definitions, the task, and every request and result so far.
So the window is the agent's working memory, and each step uses up a little more of it.
+----------------------------+
| instructions |
| tool definitions |
| task |
| step 1: call + result |
| step 2: call + result |
| ... grows with every step |
+----------------------------+Concept
Compaction
When the window is nearly full, the program can compact it: ask the model to summarise the old steps, then replace them with that summary. The task and the newest steps stay whole.
It buys room and costs detail. A good summary keeps decisions, dead ends and file names. Exact text is gone unless it is read again.
9 more exercises in the app
- 3× type the answer
- 3× multiple choice
- 1× fill the blanks
- 1× true or false
- 1× order the lines
Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.