VICTORIA. Book a call

Home / Journal / How AI Works

How AI Works

Context Windows, Memory and Why Your AI Forgets

A model keeps nothing between requests. What feels like memory is software you have to design, own and test, and a bigger window does not do that work for you.

Why does your AI forget what it was told?

For the first twenty minutes your agent handled the case well. Then it asked the customer for the account number they had given it at the very start. Your team's assistant begins each Monday with no idea what happened last week. Business leaders keep hearing about the AI context window, and it gets the blame, but it explains only half of what is going on. Your AI forgets because a model holds on to nothing between requests, so everything it needs to know must be sent again every time. A bigger window is not the fix. The fix is deciding what gets kept, where it lives, who owns it and when it is deleted.

Below, in plain terms: what the context window and memory are, the five ways AI systems forget, what long context costs, and how to test memory before a customer runs into the gap.

What is an AI context window?

A context window is all the text a model can work with in a single request. Your instructions, the conversation so far, any documents and tool results, and the answer being written all have to fit inside it. Anthropic's documentation describes it as the model's working memory, which is separate from the data the model was trained on.

Tokens, the small chunks of text a model reads, are the unit used to measure windows. According to Google's Gemini documentation, one million tokens is roughly eight average English novels, or 50,000 lines of code. Here are three published limits, checked on 2 November 2026:

ModelPublished windowThe small print
Anthropic Claude Opus 5.5, Sonnet 5.51,000,000 tokensUp to 128,000 tokens of output per request. Billed at standard rates at any length.
OpenAI GPT-5.51,050,000 tokensUp to 128,000 tokens of output. Prompts over 272,000 tokens bill the full session at twice the input rate and 1.5 times the output rate.
Google Gemini 4 Argon1,048,576 tokensOne budget shared by input, thinking and output.

Each of the three is close to one million tokens. With that much room, the size of the window alone can no longer explain why your system forgets.

Is a context window the same as memory?

No. Think of the context window as the desk and memory as the filing cabinet behind it, a cabinet the model cannot open on its own. OpenAI's API documentation treats every request as independent and stateless. A conversation only hangs together because the earlier messages are sent again with each new one. Anthropic's documentation describes the same pattern, with each turn's input carrying the whole history.

What feels like memory, then, is software wrapped around the model, and it has four layers.

LayerWhat it holdsHow long it lastsHow it fails
Context windowEverything in this requestOne requestOverflow, or the key fact gets buried
Session historyThe transcript of this conversationAs long as your application keeps itTrimmed or summarized, and detail goes
Long-term memorySaved facts and preferencesUntil someone deletes itStale or wrong facts repeat in every session
Systems of recordCRM, ERP, tickets, policiesAs long as the business runsThe agent has no connection to them

Consumer tools keep these layers out of sight. According to OpenAI, ChatGPT blends saved memories with insights taken from past chats. Business systems cannot keep them out of sight, because every layer calls for a design decision. Anthropic's memory tool shows why: the model only asks for file operations, and your application decides what gets stored and for how long.

What are the five ways an AI system forgets?

Almost all AI forgetting comes down to five failures. Each one has its own cause and its own fix, so put a name to the failure before you buy anything.

FailureWhat you seeWhy it happensFix
1. Never storedEvery new session starts blankNothing was written anywhere after the last session endedSave state on purpose, per customer or per case
2. OverflowedEarly details vanish, or the request failsThe conversation outgrew the limitTrim tool output and compact before the limit
3. Summarized awayThe gist survives, the exact figure does notA summary replaced the original textKeep hard facts in fields, outside the summary
4. BuriedThe fact is in the window and the model still misses itToo much irrelevant text around itSend less, and send only what this step needs
5. Never connectedThe agent guesses, or asks for what your systems already knowThe answer sits in a system it cannot reachIntegrate the system of record

How the second failure plays out depends on the product. Anthropic's API refuses an input that is larger than the window, while its documentation says chat interfaces may drop the oldest content on a rolling first in, first out basis. The first gives you an error message. The second leaves a gap you may never notice.

The fifth failure has nothing to do with memory. In the Grant Thornton 2026 AI Impact Survey (n=950), 55% of CIOs and CTOs say fewer than half of their core applications are AI-ready. No memory design can hand the agent a fact it never had a way to reach. That job belongs to data and systems readiness.

Why does a bigger context window not fix it?

A larger window buys you room, not attention. Failures one, three and five stay exactly where they were, and failure four can get worse. The bill goes up as well.

Accuracy falls as context grows

Anthropic's context window documentation puts it plainly: accuracy and recall degrade as the token count grows. It names this context rot and says that curating what goes in matters as much as how much space there is. Its engineering team describes context as a "finite resource with diminishing marginal returns" (2025).

About 1M tokens is the published window on current Claude, GPT and Gemini models (Anthropic, OpenAI and Google documentation, 2026)

18 models were tested by Chroma, which found performance grew less reliable as inputs got longer, even on simple tasks (Chroma technical report, 2025)

99% is how far short of their published window models fell, in the most extreme cases, in one preprint (Paulsen, arXiv, 2025, revised 2026)

Read this evidence carefully. Chroma's 2025 report set focused prompts of about 300 tokens against full prompts of about 113,000 tokens across 306 test prompts, and every model did better on the focused versions. Chroma sells retrieval software, so it benefits from that finding. Paulsen's paper is a preprint, and it found that the effective window changes with the type of problem as well as with the model. Liu and colleagues (arXiv, 2023) found that models perform best when the relevant document is at the start or end of the input, and that GPT-3.5-Turbo can fall by more than 20% when it is in the middle. The model is dated. The lesson still holds.

Treat a published window as a ceiling rather than a working range. Your working range is whatever passes your own test on your own cases.

Cost compounds with every turn

History gets resent, so you pay for it again on every turn. OpenAI's documentation confirms that every earlier input token in a chain is billed as input. If a conversation runs twice as long, the input bill comes out at roughly four times as much.

The table is our own arithmetic, not a benchmark. It assumes 2,000 new tokens per turn at GPT-5.5's published rates of $5.00 per million input tokens and $0.50 per million cached input tokens, and it ignores output costs. The cached column shows the best case, where all earlier history is served from cache.

Turns in the conversationTotal input tokens billedInput cost, no cachingInput cost, best-case caching
10110,000$0.55$0.15
20420,000$2.10$0.39
401,640,000$8.20$1.18

Multiply that by thousands of cases a month and memory design turns into a line on the P&L. Anthropic prices Opus 5.5 at $4 per million input tokens and $0.20 for cache reads, with no premium for long context. Prices change, so check them when you set a budget.

How should a business design AI memory?

Work backwards from a single workflow. Settle what the system can never lose, then put each kind of information in the cheapest place that still keeps it safe. Anthropic's engineering team calls this discipline context engineering. It comes down to six decisions.

  • Write down what has to survive. Pick one real case and flag every fact whose loss would do harm: customer ID, amounts, promises made, approvals given.
  • Keep hard facts in fields, not in the chat. Save them as structured data and load them on every turn. Nobody can summarize away a database field.
  • Pull everything else when it is needed. Hold references, and fetch the policy or the order record at the step that needs it. Anthropic calls this just-in-time retrieval.
  • Compact deliberately. Summarize the story before the window fills up, clear out old tool output, and store the full transcript somewhere else. Both Anthropic and OpenAI offer compaction in their APIs.
  • Break up long jobs. Hand focused sub-tasks a clean window and have them return a short result. Anthropic reports that sub-agents often return 1,000 to 2,000 tokens.
  • Put one person in charge of memory. That person decides what gets stored, who fixes it and when it expires.

Every engagement we run works this way: one workflow, one owner, one number, all agreed at the start. See our services for where memory work sits inside a build.

What are the governance risks of AI memory?

The biggest risk is that AI memory is a new store of business data that your current policies may not cover. It can hold customer details, pricing and personal information outside the systems your controls were designed around. Handle it like any other database, with access rules, retention limits and an audit trail.

  • Deleting one thing does not delete the other. OpenAI says that removing a ChatGPT conversation leaves the memories saved from it in place. Those have to be deleted separately.
  • Retention comes with defaults. OpenAI's API keeps response objects for 30 days by default unless you switch storage off. Check what your own stack does.
  • You may have to build the safeguards. Anthropic's memory tool runs inside your application, and its documentation tells you to validate file paths, limit file sizes and expire old files.
  • Mistakes stick. A wrong fact in a transcript touches one conversation. A wrong fact in long-term memory touches every session that follows.
  • Workspace settings count. OpenAI says Enterprise owners can switch memory off across the whole organization. Make that a deliberate choice, not a default.

In the Grant Thornton 2026 survey, 78% are not strongly confident they could pass an independent AI governance audit within 90 days. An unmapped memory store makes that harder. This work belongs under Governance, evaluation and measurement.

How do you test whether your AI remembers?

Test memory the way it breaks: at real length, on real cases, against a pass mark you set beforehand. A short demo proves nothing, since most of these failures only show up late in a long case. Put these six checks into your evaluation harness.

  • Plant and recall. Give a fact early in a long case and ask for it at the end.
  • Update. Change a fact halfway through and confirm the newest value wins.
  • Compaction. Trigger a summary, then ask for an exact amount or date from before it.
  • New session. End the session, come back, and check what carried over and what should not have.
  • Isolation. Ask for a detail belonging to a different customer. The right answer is a refusal.
  • Deletion. Remove a memory, then confirm that no later session can bring it back.

Run them on 100 to 300 of your real cases, at the longest case length you normally see, and track cost per case next to the pass rate. Every system we deploy goes through the same discipline, with spend limits and a kill switch in production.

If you already run a system that loses the thread, begin with the five failures above. AI Rescue is a 48-hour triage that finishes with a written verdict: fix, rebuild or retire.

Questions we get asked

Why does my AI assistant forget what I told it yesterday?
Models retain nothing from one request to the next. Whatever an assistant remembers has to be saved by the software around the model and fed back in. If your tool has no long-term memory, or memory is turned off, every new chat starts empty. Long chats add a second problem, because older content can be trimmed or summarized to free up room. Look at your tool's memory settings first, then ask what it actually stores.
How much text fits in a one million token context window?
Google's Gemini documentation puts one million tokens at about eight average English novels, or 50,000 lines of code. That sounds like more than enough, but the window also has to carry your instructions, tool definitions, retrieved documents and the model's own reply. Fitting in the window is not the same as being used well, either. Anthropic's documentation cautions that accuracy and recall degrade as token count rises, so treat the limit as a ceiling.
Does a bigger context window make AI more accurate?
Not on its own. A bigger window lets you send more, but the model does not pay equal attention to all of it. Chroma's 2025 report tested 18 models and found performance grew less reliable as inputs got longer, and in its memory test focused prompts beat full ones. Anthropic's documentation reports the same effect. What you put in usually matters more than how big the window is.
What is context engineering?
Context engineering means deciding what a model sees at each step. Anthropic describes it as curating the best set of tokens for a task, one step beyond writing prompts. In practice it covers what to load, what to fetch when needed, what to summarize and what to keep outside the window. For a business it is mainly a question of data design and ownership, not clever wording.
What is the difference between RAG and AI memory?
RAG, short for retrieval-augmented generation, searches a body of content such as policies or manuals and drops the relevant passages into the context window. Memory keeps what the system learned from earlier interactions, such as a preference or the status of a case. RAG covers what the business knows. Memory covers what happened with this particular customer. Plenty of production systems need both, plus live connections to systems of record.
How do we stop an AI agent losing track on long tasks?
Store the facts that matter outside the conversation, in structured fields the agent reloads at every step. Have it write progress notes to storage, compact the conversation before the window fills, and pass focused jobs to sub-agents that get a clean window. Then test it on your longest real cases: plant a fact early, force a summary, and make sure the exact detail is still there at the end.
Is AI memory a privacy risk for a company?
It can be, since memory is stored data. It may contain personal or commercial information that falls outside your current retention and access controls. Find out where it is kept, who can read it, how long it stays and how it gets deleted. OpenAI notes that deleting a ChatGPT chat does not remove the memories saved from it. Give it an owner, and bring memory stores into your audit scope.

Sources

  1. Context windows. Anthropic, Claude Platform documentation (2026)
  2. Memory tool. Anthropic, Claude Platform documentation (2026)
  3. Pricing. Anthropic, Claude Platform documentation (2026)
  4. Effective context engineering for AI agents (September 2025). Anthropic Engineering
  5. GPT-5.5 model page. OpenAI API documentation (2026)
  6. Conversation state. OpenAI API documentation (2026)
  7. Memory and new controls for ChatGPT (updated June 2025). OpenAI
  8. Long context. Google, Gemini API documentation (2026)
  9. Context Rot: How Increasing Input Tokens Impacts LLM Performance (July 2025). Hong, Troynikov and Huber, Chroma
  10. Lost in the Middle: How Language Models Use Long Contexts (2023). Liu et al., arXiv
  11. Context Is What You Need: The Maximum Effective Context Window (2025, revised 2026). Paulsen, arXiv preprint
  12. 2026 AI Impact Survey (n=950). Grant Thornton

One workflow. One owner. One number.

We agree the number with you before the build starts, test on 100 to 300 of your real cases against a pass mark set in advance, and deploy with spend limits, retry limits, a kill switch and people in the loop where errors cost money.

No obligation. A person replies within one business day.
Or send us a system that keeps forgetting