An agent's primary working memory is its context window, and that window is finite. In a long loop, every tool call result, every observation, every prior step gets appended to the context, and eventually the request hits the window limit, or the harness truncates or compacts older turns, and either way the model loses access to early material. The agent is not losing memory in a philosophical sense; it is running out of space for it. The fixes sit at a few levels. First, context compaction: periodically summarize older turns into a compact representation and replace the raw transcript with the summary. Second, pruning: not all content is equal, drop tool results that are no longer relevant, keep conclusions rather than raw data. Third, external memory: write important facts to a file or database and retrieve them on demand rather than keeping them live in context. The framing I use is that context is expensive, hot working memory, and external stores are cheap, cold storage. Design accordingly.
Insider read
Really testing: Whether the candidate understands the context window as a resource with limits and can design around those limits rather than assuming the model will cope.
The tell: Juniors say the model should just handle it or increase the context limit. Seniors describe a tiered memory architecture: hot context for the immediate task, summarization for recent history, external stores for durable facts, and explicit policies for what gets evicted versus persisted.
Follow-up: If your compaction summary loses a critical detail from step 3 that turns out to matter in step 47, how do you catch that?
Say thisContext is hot working memory with a price. Design for eviction from the start: summarize what you can, persist what matters, and never assume the window is big enough for the whole job.