← Table of Contents · Page 230 of 868
MEMORY HIERARCHIES FOR CONTEXT
Part 4 of 11
OFFLOADING DETAIL TO FILES
Offloading means moving bulky information out of the window and into storage, keeping only a small pointer in the window.
A pointer is a short reference that says where the full information lives, like a library catalog card that tells you which shelf holds the book.
Suppose an agent runs a tool that produces a log file with 10,000 lines.
Pasting the log into the window would be enormously wasteful.
Instead the agent or the harness saves the log to disk and keeps only a short note in the context, such as "full log saved to the logs folder as run 42; the key error is at line 230."
The window holds roughly twenty tokens instead of tens of thousands.
If the agent later needs more detail, it uses a file-reading tool to fetch just the lines it needs, perhaps lines 220 through 240.
This pattern has a nickname in some circles: just-in-time retrieval, meaning the agent keeps lightweight references and loads the actual data only at the moment it is needed.
It mirrors how people work.
You do not memorize an entire book, you remember that it is on the shelf and where to find the chapter you need.
Good offloading practice includes a few habits.
Always leave an informative pointer, not just a file name, so the agent knows what the file contains and why it might matter.
Keep stable naming and folder conventions so files are easy to find.
Include summaries or indexes with large files, such as a table of contents, so the agent can jump to the right place instead of reading everything.
Protect the files with the same permission rules as other data, since offloaded files may contain sensitive content.
And clean up temporary files when the run ends, as you will study in Chapter 26.
Advertisement
Read Aloud:
0:00 / 0:00