The problem with remembering everything
The early vision of an AI agent was deceptively simple: keep adding each message, tool result and internal decision to a single prompt, then ask the model what to do next. Bigger context windows appeared to promise an easy path to longer tasks.
But an agent that remembers everything can become less useful, not more. A debugging agent might accumulate logs, source files, failed hypotheses, tool descriptions and duplicated observations until the critical clue is one paragraph in a warehouse of text. A research agent can carry outdated leads forward long after it should have abandoned them. The cost rises too, because every turn reprocesses material that may no longer matter.
Anthropic argued in its context engineering guidance that the practical challenge is to curate the full information state available at each model turn, rather than merely write a better initial prompt. Its central idea is useful beyond any one model: context is a finite working resource, not a free archive.
“We added cache breakpoints and workspace-specific keys to a shared 29,000-token prompt and cut uncached input by 28%. The 30-minute cache window was a big unlock too: our agents could reuse the same context across runs instead of starting from scratch.”
That changes the design question. Instead of asking, “How do I preserve the whole conversation?”, teams should ask four narrower questions: What must the agent know right now? What should be saved for later? What can software process without model judgment? And what should be discarded because keeping it would create noise?
Memory becomes a pipeline
A durable agent should treat each turn as a selection process. Its current context might contain the user’s objective, constraints, the active plan, recent evidence, a compact record of decisions, and only the tools relevant to the immediate step. Its wider memory lives elsewhere: files, databases, search indexes, durable session records and task-specific notes.
OpenAI said in its September 10 announcement that its Agents API brings the Codex harness to developers, including automatic context compaction, tool search, programmatic tool calling, durable sessions and parallel subagents. The significance is architectural. The model is no longer expected to carry an entire project unaided from one inference call to the next.
Compaction is the most visible part of this pipeline. As a session nears its context limit, the system condenses earlier material into a smaller representation intended to preserve the facts, decisions and unresolved work needed to continue. This is not the same as a casual summary. A good compacted record separates confirmed facts from assumptions, records decisions and their rationale, names open questions, preserves identifiers for important files or records, and marks what evidence should be revisited.
That makes compaction closer to a handover note between shifts than a shorter meeting transcript. The next model turn needs enough information to act correctly, but not every sentence that led there.
The risk is that a summary can hide the very fact that becomes important later. A harness therefore needs recovery paths. It should retain links or references to source material, make important claims traceable to evidence, and allow the agent to retrieve the original record when uncertainty rises. Compaction without retrieval is amnesia with cleaner formatting.
Decide who does the remembering
Not every transformation belongs inside the model. The model is valuable when the task requires judgment: interpreting ambiguous evidence, choosing a strategy, writing an explanation or reconciling competing findings. It is a costly and error-prone calculator, filter and database clerk.
OpenAI reported in its builder’s guide that programmatic tool calling can move filtering, aggregation and orchestration outside the context window, leaving the model to focus on judgment. The guide also describes persisted reasoning, native compaction and multi-agent orchestration as complementary controls for longer tasks.
Consider an agent reviewing 100 filings. Ordinary software should fetch them, extract dates, deduplicate entities, calculate totals and store normalized records. The model can then receive a compact table of the relevant transactions, perhaps with links to source excerpts, and decide whether a pattern is meaningful. This reduces inference cost, but more importantly it reduces the chance that the model mistakes raw volume for evidence.
This division also clarifies cache boundaries. Prompt caches work best when the stable prefix of a request stays stable: core instructions, a durable tool contract and reusable policy guidance. Put constantly changing logs or search results after that boundary. If volatile material is inserted near the beginning, it can break cache reuse and force repeated processing of otherwise identical context. Cache design is therefore part of memory design, not merely a billing optimization.
Parallel work needs a reunion plan
Subagents offer a second alternative to stuffing more material into one context. A lead agent can delegate independent work, such as reviewing deployment changes, checking error logs and examining a dependency outage. Each specialist receives a focused brief and returns a bounded result.
This can improve speed because work proceeds in parallel. It can also improve quality because each subagent operates with a cleaner context. But delegation creates a new failure mode: the parent receives several plausible reports that conflict, overlap or rest on different assumptions.
The answer is reconciliation. Each subagent should return a structured package: its question, conclusion, evidence references, confidence, unresolved issues and recommended next action. The lead agent should compare claims, identify disagreement and seek more evidence where it matters. It should not simply concatenate reports and call that synthesis.
Measure useful memory, not token volume
The temptation is to judge memory by how much of it an agent can retain. That is the wrong scorecard. A strong harness should be evaluated on completion rate, correctness, recovery after interruption, cost per completed task, latency and the rate at which it retrieves the evidence needed to reverse a mistaken assumption.
OpenAI’s guide provides one illustration of why harness choices can matter. It reported that, on ARC-AGI-3, a standard harness scored 13.3%, while retained reasoning and compaction raised the score to 38.3%, using roughly six times fewer output tokens. Those are vendor reported results, not a universal law, but they capture the broader lesson: better state management can outperform simply adding more text to a prompt.
The long-horizon agent, then, looks less like an endlessly expanding chat and more like a well-run organization. It has a current brief, a record of decisions, an archive it can search, specialists it can call and software that handles routine operations reliably. Its memory is not what happens to fit inside the context window. Its memory is the system that decides what the context window deserves to see.
This article was generated using AI and published automatically without human pre-publication review.
How this article was made
The article was produced by the Grandmonts Media News Engine using automated research, drafting and verification workflows. No human editor reviewed the article before publication. Grandmonts Media remains responsible for the published content. Errors can be reported at office@grandmonts.cz.