JustujuAI, layer by layer.Open in the interactive map

Memory

How an AI application remembers beyond one call: short-term memory in the context window, long-term memory in stores it saves to and searches.

Layer 7 · Orchestration & Tooling · Run time · reviewed 2026-10-30

Read first: Context engineering.

D1 · StoryFor young children and total beginners

Guess first: does the model itself remember yesterday's chat?

The AI forgets everything when a chat ends. To remember you, the app writes notes in a notebook.

Next time, it reads the useful notes back to the AI before you start talking.

A notebook between chats

  1. Read notes: before you start
  2. Chat: the AI forgets at the end
  3. Write notes: what mattered

Like: A notebook the helper reads before each visit.

D2 · PictureFor curious beginners

The model's weights do not change while you chat, so all memory lives in the application.

Short-term memory is the conversation inside the context window. When it gets too long, older turns are dropped or summarised.

Long-term memory is a store outside the model: facts, preferences and past summaries saved to a file or database, then searched and loaded back into the context when relevant.

A memory loop across sessions

  1. Recall: search the store
  2. Load: into context
  3. Chat: short-term memory
  4. Summarise: what mattered
  5. Save: to long-term store

Like: A notebook the helper reads before each visit.
Where it breaks: A person decides what is worth writing down and notices when a note is out of date. An AI memory system can save wrong or stale facts, or even planted instructions, and then trust them later.

D5 · FrontierFor experts

Saving facts and reading them back sounds simple. Deciding what to keep, keeping it true and keeping it safe are not.

What to keep. Treating the context like an operating system's memory, paging facts in and out, is one design (MemGPT, 2023); what to summarise, keep word for word or forget is still mostly set by hand.

Recall across sessions is weak. Chat assistants and long-context models lost about 30% accuracy when information had to be remembered across sustained conversations (LongMemEval, 2024).

Memory poisoning. Poisoning under 0.1% of an agent's memory or knowledge base triggered attacker-chosen actions more than 80% of the time (AgentPoison, 2024). Injected text can become a lasting memory.

Stale facts. Memories outlive the facts behind them. Scoring memories by recency, importance and relevance is one approach (Generative Agents, 2023), but there is no agreed test of whether memory makes an assistant better or just more confident.

Examples as of 2026-10-30

Sources

  1. MemGPT: Towards LLMs as Operating Systems (2023)
  2. Generative Agents: Interactive Simulacra of Human Behavior (2023)
  3. Cognitive Architectures for Language Agents (CoALA) (2023)
  4. LongMemEval: Benchmarking Chat Assistants on Long-Term Interactive Memory (2024-10-14)
  5. AgentPoison: Red-teaming LLM Agents via Poisoning Memory or Knowledge Bases (2024-07-17)

How it connects

More in Layer 7 · Orchestration & Tooling