Skip to content
Agents · 4 of 6 · about 25 minutes · With a year

Keep notes on the task

During a long task, an agent learns facts that it needs later. The model does not remember them between calls: your program must send them again each time. The notes cannot grow without end, because the context window has a limit. So the program keeps a working memory. Some notes are pinned, such as the task itself, and always stay. From the other notes, the newest ones stay, as many as the budget permits.

About this lesson

Words to know

working memory
The notes that a program keeps during one task and sends to the model with each call.
token budget
The number of tokens you allow one part of a prompt to use.
context window
Everything a model can read and write in one request, measured in tokens. It has a fixed maximum size.

Why it matters

A long run of an agent fails when the model loses the task or an early fact. A working memory with pinned notes is the smallest design that prevents this.

With a year

How it works, a worked example, the exercise with its tests, three hints and the explained solution are in the app, with a year of Algo150 for $29 or ₾49. The first chapter, Model foundations, is free for everyone: start with Vector dot product.

What a year includes