- Context is the input now; retrieval selects evidence; memory preserves chosen state.
- Compare evidence volume without assuming equal quality or billed cost.
- Keep source, scope, timestamp and expiry on persistent records.
The manual fits.
The saved note is stale.
Size and authority are different decisions.
Hypothetical scenario. Act 2, the price change. Priya asks whether Northwind should paste its entire policy manual into every prompt. She also wants the assistant to remember concise-answer preferences without treating last month’s generated policy summary as the current rule.
Context, retrieval and persistence solve different problems
A context window contains the material available within one model request. It can include instructions, conversation and an entire small manual. A large allowance makes more text available at once; it does not establish that the answer uses every relevant condition correctly or that the same text will be supplied next time.
Retrieval selects evidence for a particular request from a source collection. Northwind’s RAG service chooses policy passages and then places them in context. Selection reduces the material the model must consider, while adding an indexing and ranking path whose failures need to be evaluated.
Memory is application state intentionally preserved across sessions. A saved presentation preference, a pending task and a generated summary have different authority and expiry rules. Computational prompt caching is another mechanism: it reuses eligible processing of repeated input, rather than deciding which saved statements should govern future requests.
The storage-hierarchy analogy has limits
A computer's memory hierarchy is a useful analogy for different access costs. It does not establish that every AI application must divide information into fixed token-size tiers. A small handbook can fit directly in a request; a large collection may require selection; a narrow record lookup may need no generated answer.
Likewise, a model's key/value cache is not a durable notebook of verified facts. In a compatible runtime it holds intermediate attention state for retained tokens and may support computational reuse. Persisting a user preference or correcting a source claim is an application-level data decision, not an automatic property of that cache.
Lost in the Middle, by Nelson Liu and colleagues, studies how relevant information's position affects the evaluated models and tasks. It motivates testing evidence use. It does not establish a mandatory storage hierarchy or a universal size at which one method should replace another.
Separate persistence, selection, and computation
Start with the source of each item. A current policy comes from an identified source revision. A presentation preference can come from an explicit user choice. A conversation summary is a derived representation that can omit or distort details. These items should not acquire equal authority merely because they appear together in a prompt.
For durable state, record the subject, origin, applicable scope, revision, and a lifetime or invalidation rule when needed. Distinguish explicit statements from inferred summaries. An earlier approval for one action is not a standing authorization for unrelated future actions.
At request time, select relevant permitted records and source passages. Reconcile contradictions according to an explicit authority rule; do not simply let the most recently retrieved text win. Then measure the complete assembled request under the generator's tokenizer.
A runtime may reuse eligible computation when its documented conditions are satisfied. That can affect execution work, but it does not make obsolete text current or an unauthorized record permissible. Keep cache eligibility separate from evidence validity.
Budget what enters the request, not what exists in storage
Hypothetical scenario. Choose a combined request allowance of 32,768 tokens. Reserve 2,048 for output, 1,536 for instructions and fixed formatting, 512 for the question, and 1,024 for selected durable-state records including their formatting. These are chosen application assumptions, not a provider specification.
The allowance for retrieved source passages is 32,768 − 2,048 − 1,536 − 512 − 1,024 = 27,648 tokens. Selecting 12,000 source tokens uses a combined 17,120 tokens, including the output reserve, and leaves 32,768 − 17,120 = 15,648.
Suppose the application stores 200 durable records averaging a chosen 300 bytes of payload each. That is 200 × 300 = 60,000 bytes, or 60 decimal kB. This storage estimate excludes indexes and metadata, and it cannot be converted to model tokens without the actual text and tokenizer.
Only eight records are selected for this request. If each selected record contributes exactly 80 tokens, their text totals 8 × 80 = 640 tokens. A chosen 384 tokens for labels and formatting brings the selected-state allocation to 1,024. The request count depends on selected text, not all 200 stored records.
Those allocations do not establish latency, billing, or answer quality. If selection changes, recount the real formatting and verify that the chosen source passages still support the answer. A summary that fits beautifully but loses an exception is not a successful compression policy.
Durable state needs authority and a lifetime
Some information is intended to persist: a user's selected display units, a draft's workflow stage, or an explicitly saved project decision. Other information is provisional: a generated hypothesis, an incomplete tool response, or a temporary permission. Store these distinctions rather than flattening them into one growing transcript.
Deletion and updates need a complete path. Correcting a source does not automatically repair an earlier summary or saved preference. Track derived records by their source revision, then invalidate or revalidate them when that revision changes.
Permissions also apply when state is read into a later request. A record created in one project's scope should not automatically become available in another. A durable store is another disclosure boundary, even when its content looks like an innocuous note.
Evaluate remembering and forgetting together. Can the application retain a useful preference, stop applying an obsolete decision, distinguish two users, and recover after a source correction? Persistence alone establishes none of these behaviors.
A generated answer can become a false source
Hypothetical scenario. An assistant guesses that all weekend returns are allowed. A summarizer saves “Weekend returns are allowed” as a durable note without recording that it was an unsupported inference. Later requests retrieve that note and cite its existence as evidence. Repetition makes the claim look established without adding a primary source.
Increasing context size does not repair the provenance failure. Preserve the origin and uncertainty of derived notes, require a source where the task demands one, and recheck current policy before using an old summary as authority. Some generated material should remain provisional or not be persisted at all.
After correcting the policy source, test that the obsolete derived note no longer governs the answer. Also retain a case where a genuine user preference should survive. A repair that forgets everything avoids one error by discarding the useful purpose of durable state.
Four different meanings of remembering
“A long context replaces a durable store.” It makes supplied material available within one request. Future availability, correction, and access still need an application design.
“A cached request makes its facts current.” Reusing computation and validating source freshness are separate decisions.
“A summary is the same evidence in fewer words.” It is a derived representation that may lose scope, exceptions, or uncertainty. Preserve a path to the source.
“The largest record should go into the coldest tier.” Size alone does not define authority, update frequency, access, or usefulness. There is no universal token threshold in this chapter.
Choose the missing capability
Use direct context when a suitable permitted set fits and performs adequately. Use retrieval when selecting evidence from a collection addresses the task. Use durable application state when information must persist across requests with an explicit update and access policy. Use runtime reuse when the implementation's eligibility rules and measured benefit justify it.
These mechanisms can be combined, but combination is not evidence of necessity. Begin with a baseline that is easy to inspect and add the missing capability. A structured preference lookup may be sufficient; a semantic index is not automatically required for every saved value.
For an architecture review, ask what is retained, why it is authoritative, how it reaches the next request, how it is corrected, and who can access it. Those answers are more useful than naming three storage tiers without their operating rules.
Count the manual before choosing the evidence path
Hypothetical worked example: a 200-page manual averages 500 tokens per page, so it contains 200 × 500 = 100,000 tokens. Sending it for 50 questions per day supplies 100,000 × 50 = 5,000,000 manual input tokens. This excludes instructions, question text and generated output.
A retrieval path supplies 5 chunks of 500 tokens per question: 5 × 500 = 2,500. Across 50 questions, that is 2,500 × 50 = 125,000 tokens. The manual-evidence volume ratio is 5,000,000 / 125,000 = 40. This is 40 times less supplied evidence under the chosen assumptions, not a prediction of answer quality or billed savings.
Full context remains a useful baseline when a permitted corpus is small enough and the question needs relationships across many sections. Retrieval is attractive when selective evidence is enough. Persistent memory belongs where a fact or preference needs to survive, with source, scope, timestamp and expiry. These choices can coexist without becoming interchangeable.
In the wild: context engineering retains a path back
Manus’s context-engineering write-up by Yichao Ji describes retaining references to files while moving bulky observations out of immediate context. That is a concrete way to separate working context from external state. It does not mean an arbitrary saved summary becomes authoritative policy.
OpenAI’s prompt-caching documentation describes eligible matching-prefix reuse. Caching can change execution cost but does not reduce the evidence’s logical size or update an obsolete rule. OpenAI’s retrieval guide documents selection from indexed files; Microsoft’s deletion guidance makes source removal an explicit indexing concern. Check those mechanisms independently when a saved note continues quoting an old policy.
Limits: the token comparison assumes fixed page and chunk sizes, and omits the cost and quality of retrieval. Long-context performance depends on the model and task. Northwind chooses the simplest path that returns current permitted evidence, and treats every persistent note as a record with provenance and a defined lifetime.
Check yourself: inspect what persists
A preference was saved correctly, but the next request concerns a different user. Is retrieving a similar preference enough to apply it?
No. Identity and applicable scope must match. Similarity does not authorize transferring one user's state to another.
A source document is corrected. Does rebuilding its search index prove that an earlier generated summary is also corrected?
No. The summary is another derived artifact. Revalidate, update, or invalidate it under the chosen provenance policy. Test the path by which it reaches future requests.
A durable store occupies 60 kB. Can that figure establish whether all of it fits a model request?
No. Bytes of stored payload and tokens of assembled request text are different units. Select the relevant records, render their actual text and formatting, and count with the chosen tokenizer.
Next read: Trace a missing policy paragraph.