What is long-term memory in AI?
By FlirtAlly ยท October 3, 2026

What is long-term memory in AI?
Key Facts
- A context window isn't memory โ it's a desk; memory is the filing cabinet that persists across sessions, per Redis's analysis.
- In the LOCOMO benchmark, full-context retrieval hit 72.9% accuracy at 17.12 seconds, while selective memory scored 66.9% in 1.44 seconds according to Redis.
- AI memory follows cognitive science: semantic memory stores facts, episodic memory stores time-indexed events, and procedural memory stores learned skills as Oracle explains.
- Forgetting is one of the least solved parts of AI memory systems โ deciding what to drop remains open research according to Redis.
- The UK AI companion sector generated roughly ยฃ1.3 billion in 2024, with a projected 32% CAGR through 2030 per the Ada Lovelace Institute.
- A security audit of 17 companion apps found 14 critical and 311 high-severity vulnerabilities affecting 150+ million users per Security Brief.
- 14 of 16 AI companion platforms claim broad rights to train on private chats holding data comparable to therapy sessions according to the Ada Lovelace Institute.
Why Bigger Context Windows Aren't Real Memory
It's tempting to assume that as AI models get larger context windows, memory takes care of itself. It doesn't. A model with a million-token window still forgets everything the moment a session ends โ because a context window isn't memory at all. It's a desk. Memory is the filing cabinet.
The distinction comes down to persistence. Short-term memory lives inside the context window: everything the model can "see" during a single conversation, which resets to zero when the session closes. Long-term memory, by contrast, gives agents external storage โ vector databases, knowledge graphs, key-value stores โ that retains information across sessions, interactions, and tasks, well beyond what fits in context at any given moment, according to Redis's analysis of agent memory architectures. Atlan's comparison draws the same line: short-term memory dies with the session; long-term memory persists across sessions, agents, and time.
Without that external layer, an AI is what Redis calls a stateless responder โ it reprocesses context on every invocation and can't build continuity across interactions. It can hold a conversation, but it can't hold a relationship.
Oracle's developers put the limitation bluntly: "A bigger context window gives you more room, not a memory policy." More room means you can stuff more of the conversation into the prompt. It doesn't mean the system can decide which facts should survive into next week's chat, which details are authoritative, or what to do when information conflicts. Those are memory decisions, and no window size makes them for you.
The math makes the point concrete. In the LOCOMO benchmark cited by Redis, full-context retrieval scored 72.9% accuracy but took 17.12 seconds at p95 latency and burned roughly 26,000 tokens per conversation. Selective external memory hit 66.9% accuracy at 1.44 seconds using under 2,000 tokens. For real products, trading a few points of accuracy for ~91% lower latency is the only viable trade โ which is why production systems build layered memory rather than ever-longer prompts.
What real memory looks like in practice:
- Semantic memory: durable facts โ your job, your preferences, your dog's name.
- Episodic memory: time-indexed events โ what happened, what changed, why it mattered.
- Rolling summaries: compressed context that carries forward without re-reading everything.
- Semantic recall: retrieving the right memory even when it's phrased differently ("remember when" still works).
This is the architecture behind AI companions that actually feel continuous. FlirtAlly's companions, for example, use four memory layers โ facts, episodic, emotional, and rolling summary โ plus semantic recall, so telling your companion your dog's name means she asks about him next week, not just for the rest of tonight's chat. That continuity isn't a bigger window; it's a memory system doing its job quietly in the background.
The Architecture: How AI Memory Actually Works
Ask an engineer how AI memory works and you won't get a metaphor โ you'll get a diagram. Production systems borrow their structure directly from cognitive science, and the architecture that results looks surprisingly like the way human minds organize experience.
The industry-standard taxonomy, used by systems documented by both Redis and Oracle, splits long-term memory into three types:
- Semantic memory โ facts and concepts. Your name, your job, your dog's name.
- Episodic memory โ time-indexed events. What happened, what changed, and why it mattered.
- Procedural memory โ skills and routines the agent has learned to perform.
Oracle's framing sharpens the key distinction: a fact says what is true, while an episode says what happened and why it mattered. Over time, episodic memories often consolidate into semantic ones โ the same way a specific dinner becomes "we always order Thai."
On top of this taxonomy sits a layered architecture. Oracle recommends six layers: a sliding window of recent context, running summaries, vector retrieval, structured memory, episodic memory, and a memory manager that acts as the policy layer โ deciding what gets stored, what gets retrieved, and what actually reaches the model.
Redis describes the operational loop that runs through those layers: read before reasoning, write after acting. The pipeline has four stages โ chunking the conversation, embedding and indexing it, retrieving what's relevant, and consolidating it into durable memory. This is the pattern behind systems like FlirtAlly, where four memory layers (facts, episodic, emotional, and a rolling summary) plus semantic recall mean "remember when" works even when phrased differently.
Why not just stuff the entire history into every prompt? Because it doesn't work โ economically or technically. LOCOMO benchmark data makes the trade-off concrete: full-context retrieval achieves 72.9% accuracy at a 17.12-second p95 latency and roughly 26,031 tokens per conversation. Selective external memory reaches 66.9% accuracy at just 1.44 seconds and around 1,764 tokens โ a ~6-point accuracy cost for ~91% lower latency and over 90% token savings.
That gap is the whole argument. A companion who takes seventeen seconds to answer "what's my dog's name?" has failed at the one thing memory exists to do. Real products accept a small accuracy trade in exchange for responses that feel instant and human.