Concepts / Role of Wrappers in AI Models

Role of Wrappers in AI Models

Anterograde amnesia in AI is a failure mode in which models do not learn from one session to the next and do not retain previous conversations or corrections.

  • Programming

A Session That Starts From Zero

Imagine you correct an AI system's output on Monday. You explain what it got wrong and what you wanted instead. On Tuesday you open a new session and ask a similar question, and the system repeats the same mistake. Was the correction lost because the system was careless, or because of how the system is built? This article answers that question by looking at where memory actually lives in an AI system.

What do you think happens?

Does the model itself keep the correction you made in Monday's session when Tuesday's session begins?

  • Yes, the model stores it internally

  • No, the model keeps nothing on its own between sessions

Reveal answer
Answer:

No, the model keeps nothing on its own between sessions

The source states that the model does not hold memory between sessions on its own. Any continuity has to be supplied from outside the model, which is the job of the wrapper.

What Anterograde Means for AI

Definition

Anterograde amnesia in AI is a failure mode in which models do not learn from one session to the next and do not retain previous conversations or corrections.

The word anterograde refers to the forward direction. In the general sense, anterograde amnesia describes an inability to form new memories going forward, while older memories may still be available. Applied to AI, the failure is specifically about the carry-over of information into future sessions. The older material the model was built with is not the issue here. The issue is that nothing from a new session survives into the session after it.

This failure has a name in this course because it shapes design decisions. When people build systems around AI models, one of the first questions to ask is what the system remembers from one interaction to the next. A common failure mode is that it remembers nothing, and each new session starts as though earlier sessions never happened. Naming the failure makes it something you can check for, rather than a vague sense that the system is forgetful.

Kinds of Information That Get Lost

The source names three kinds of information the model does not keep. Each one would be useful in a later session, and none of them is retained by the model on its own. Seeing them side by side shows why a single fix does not cover every case.

Kind of informationWhat it isWhy a later session needs it
Past conversationsWhat was discussed in earlier sessionsThe new session cannot continue a thread it never saw
CorrectionsChanges made to the model's outputWithout them, the same error can come back in the next session
Feedback on what is acceptableGuidance about what counts as an acceptable answerWithout it, the model has no record of the standards it was given

The three kinds of information the source says the model does not keep on its own.

Tracing a Correction Across Two Sessions

Follow one correction through the system. In session 1, the model produces an output, and a person corrects it. The model itself does not keep that correction. The only path the system has for carrying information forward runs through the wrapper. The correction enters the wrapper during the first session, is held there, and leaves the wrapper when the second session is built. The model is not a store on that path.

Session 1 outputmodel responseCorrectionperson's fixWrapper storeholds the correctionSession 2 promptbuilt by the wrapperSession 2 outputmodel responseis correctedsaved by wrapperread when session 2 startssent to model
How does a correction made in session 1 get from the wrapper's store into the prompt of session 2, when the model itself keeps nothing?

Notice that the correction passes through the wrapper twice: once on the way in and once on the way out. If the wrapper does not store it, there is nothing to read back when the second session begins. The model then receives a prompt that contains no trace of the correction.

Where the Memory Must Live

If the model does not carry memory from one session to the next, the memory of the system has to be located somewhere else. The source is direct about this: whatever memory the system has lives in the wrapper, not in the model. The wrapper is the layer built around the model, and it is where stored information, such as past corrections or prior conversation details, must be kept.

Wrapperlayer built around themodelModelkeeps no memory betweensessionsStorepast corrections andconversationsPrompt buildersupplies stored piecescontainscontainscontainsfeedshands prompt to
What sits inside the wrapper, what sits outside it, and which part is responsible for memory?

A Sketch of Wrapper Storage

The following sketch is an original illustration, not a real system. It uses a plain Python list as the wrapper's store. A function saves a note, and another function builds the text that would be sent to the model. The model is not shown; the point is only where the note lives and how it reaches the prompt.

Code walkthrough
notes = []

def save_note(note):
    notes.append(note)

def build_prompt(user_request):
    if notes:
        remembered = "\n".join(notes)
    else:
        remembered = "none"
    return f"Saved notes:\n{remembered}\n\nRequest: {user_request}"

save_note("Use metric units")
print(build_prompt("Convert 5 miles"))
  1. 1
    Line 1 creates an empty list. This list plays the role of the wrapper's store.
  2. 2
    save_note appends a note to that list. This is the wrapper keeping information the model cannot keep.
  3. 3
    build_prompt checks whether the store has anything, joins the notes into text, and places that text ahead of the new request.
  4. 4
    The final print shows the stored note reaching the new prompt, which is the path the correction took in the previous section.
  • notes is the wrapper's store; it lives outside any model
  • save_note writes into the store during the first session
  • build_prompt reads the store when a new session is built
Output
Saved notes:
Use metric units

Request: Convert 5 miles

What Happens When the Store Is Empty

Notice what the sketch does and does not do. It keeps the note because the wrapper keeps it, and it supplies the note to the new prompt. Now suppose the store is emptied before the second session. The same builder runs, but there is nothing to supply.

python
Output (expected)
Saved notes:
none

Request: Convert 5 miles
Notes on the code
  • clear() removes the stored note from the wrapper
  • The prompt now reads none in place of the note

Nothing in the model can recover the lost note. The model was never holding it. This is the practical meaning of memory living in the wrapper: the information exists only where the wrapper put it, and if that place is emptied, the information is gone.

Modelno stored correctionsModelno retained changeWrapper storeemptyWrapper storeone correction
What is different about the model's knowledge and the wrapper's stored data after a session ends, compared with before it started?

The diagram shows the asymmetry. After the session ends, the model is in the same state it started in, because it retains nothing. The wrapper's store is the only component that has changed, and that change is what makes the next session's continuity possible.

Mistakes About Where Memory Lives

  • Common mistake

    Assuming the model learned from yesterday's correction

    What it looks like

    A user corrects an answer, then expects the next session to already reflect that fix.

    Why it fails

    The source states that the model does not hold memory between sessions on its own.

    Do this instead

    Check whether the wrapper stored the correction and supplies it to the new session.

  • Common mistake

    Treating only past conversations as lost information

    Why it fails

    The source names three kinds of information the model does not keep: past conversations, corrections, and feedback about what is acceptable.

    Do this instead

    When diagnosing forgetting, check all three kinds, not just the chat history.

  • Common mistake

    Looking inside the model when repeated errors appear

    Why it fails

    Memory that carries across sessions is held in the wrapper, so the storage and retrieval logic is where it is missing or broken.

    Do this instead

    First ask whether the wrapper stores the relevant information and supplies it to the new session.

  • Common mistake

    Believing that storing data in the wrapper automatically makes it appear in every prompt

Trace the Note Through the Sketch

EASY

Using the sketch from earlier, suppose you call save_note with the text "Use short answers", then save_note with "Cite sources", and then call build_prompt with the request "Explain photosynthesis". Before running anything, write down what the prompt will contain, and state which component holds each note before the second session begins.

Hints
  • Each call to save_note appends one item to the same list.
  • build_prompt joins every item in the store, in the order they were added.
  • The model is never part of the store, so nothing about the notes is kept on the model's side.

Key Takeaways

  • Anterograde amnesia in AI is a failure mode in which models do not learn from one session to the next and do not retain previous conversations or corrections.
  • The model keeps no memory between sessions on its own, so any continuity must be supplied from outside the model.
  • Whatever memory the system has lives in the wrapper, and the wrapper is the FDE's responsibility to design.
  • A correction reaches a later session only when the wrapper stores it during the first session and supplies it when the second session is built.