Semantic Memory

Semantic memory lets an AI recall only the most relevant past context — not everything — so conversations stay sharp, costs stay low, and the AI never hits a context-length wall.

The AI That Forgets — and the Fix That Backfires

Picture yourself using the EngineerPrep AI tutor during a mock interview session. You spend ten minutes discussing system design — load balancers, database sharding, the works. Then you pivot: "Remember that sharding strategy we talked about? How does it relate to this new question?" The AI stares back blankly. It has no idea what you discussed ten minutes ago. Your first instinct is reasonable: just keep a running log of every message and paste the whole thing into every new request. Problem solved, right? Not quite. After a long session that log grows to thousands of words. You're paying for every token sent to the model on every single turn. Worse, every model has a hard ceiling on how much text it can read at once — hit that ceiling and the whole thing breaks. So the real question is: how do you give the AI a memory that doesn't explode in size?

The Simple Idea Behind Semantic Memory

Think about how your own memory works. You don't replay your entire life before answering a question. You recall the relevant bits — the parts that match what's being asked right now. Semantic memory works the same way. Instead of remembering everything, it stores past pieces of a conversation and, when a new message arrives, it fetches only the pieces that are meaningfully related to that message. The word semantic just means "based on meaning" — as opposed to, say, "the five most recent messages" which is purely based on order, not relevance. Here's the everyday analogy: imagine a notebook where every page is about one topic. When someone asks you a question, you flip only to the pages that match the topic. You don't re-read the whole notebook. In practice, each turn of the conversation is saved as a small chunk. Each chunk is converted into a list of numbers — called an embedding…

Watching Semantic Memory Work Step by Step

Step 1 — The conversation starts. Imagine a whiteboard. On the left side there's a column labelled "Memory Store" — empty for now. On the right side is a chat window. The learner types: "Explain consistent hashing." The AI answers. That exchange — question plus answer — is written on a sticky note and placed on the whiteboard. Step 2 — The sticky note gets a fingerprint. A small robot walks up to the sticky note, reads it, and stamps a unique fingerprint on it — a row of numbers like 0.82, 0.14, 0.67, ... . This fingerprint (the embedding) captures the meaning of the text. The robot files the note in the Memory Store column. Step 3 — The conversation continues. The learner types three more messages about unrelated topics — Big O notation, Java generics, recursion. Each one becomes a sticky note with its own fingerprint, filed in the Memory Store. Step 4 — A related message arrives.…