← Table of Contents · Page 675 of 868

PROJECT TWO - ADDING CONTEXT MANAGEMENT

Part 2 of 11

WHY A LONGER JOB NEEDS A SMARTER DESK In Stage 1 the agent reviewed five resumes, and each review started from a blank slate. Now imagine that the agent must review twenty-five resumes in one sitting while keeping one long running conversation. The context window is the amount of text a model can look at in a single call, a bit like the surface of a desk. A small job fits easily on the desk. A long job piles up papers until the desk overflows and the most important page is buried underneath. Two problems follow. The first is context bloat, which means the conversation has grown larger than it needs to be, so every call is slower and more expensive, because models are charged by the amount of text they read. The second is context rot, which means that as the pile grows the model tends to pay less reliable attention to what is in it, so earlier facts get missed or muddled. Context management is the harness's job of keeping the desk tidy. It does three things in this chapter. A context builder decides what goes on the desk for each call. Compaction squeezes old material into a short summary when the pile gets big. An external notes file records finished work outside the conversation, like a notepad kept in a drawer, so that nothing important lives only in the model's short-term memory.
Advertisement
Read Aloud:
0:00 / 0:00