Memory Architectures

You will understand the four types of memory an AI system can use, when each one fits, and how EngineerPrep's tutor uses them together so conversations feel coherent without ballooning in cost.

The Tutor That Forgot You

Picture this: you have just shipped the EngineerPrep AI tutor. A learner spends forty minutes going deep on recursion. They ask great questions. The tutor gives great answers. Everyone is happy. Then the learner types: 'Can we do a quick quiz on what we just covered?' The tutor replies: 'Of course! What topic would you like to be quizzed on?' The learner stares at the screen. They just told it the topic — forty minutes ago. Your first fix feels obvious: send the entire conversation history on every request. Simple. Done. Except a forty-minute tutoring session can easily run to tens of thousands of tokens. Claude on Amazon Bedrock charges per token, so costs climb with every exchange. And when the context window fills up, the model drops the oldest messages — so the 'fix' quietly breaks itself. There has to be a smarter way to give the AI the right memory at the right time.…

The Simple Idea

Think about how you remember things as a person. Some things live in your head right now — the last sentence you read. That is your working memory : short, temporary, right here. Some things you wrote in a notebook — a list of topics you studied last week. That is external storage : not in your head, but you can look it up. Some things got compressed into a habit — you do not remember learning to type, you just type. That is baked-in knowledge : slow to form, but always available. And some things you remember because they felt important — the moment a concept finally clicked. That is episodic memory : selective, personal highlights. AI memory architectures map closely onto these four kinds: 1. In-context memory — the messages you include in the current prompt. Fast, immediate, but limited and costly. 2. External memory — a database the AI can query.…

See It in Action

Imagine the EngineerPrep tutor as a helpful engineer sitting at a desk. Picture four tools on that desk. Tool 1 — a whiteboard (in-context memory) At the start of every message exchange, the tutor writes the recent conversation on the whiteboard. When it answers you, it is reading from that whiteboard. When the session ends, the whiteboard is erased. Nothing persists automatically. Now picture the learner asking: 'Explain binary search.' The tutor writes that question on the whiteboard, thinks, and answers. The whiteboard now has one question and one answer on it. The learner asks three more questions. The whiteboard fills up. At some point there is no more room. The tutor has to erase the oldest lines to make space. That is the context window limit in action. Tool 2 — a filing cabinet (external memory) Next to the desk sits a big filing cabinet…