Query

How do agents remember things across sessions?

Answer

The starting problem: LLMs are stateless. What Is Agent Memory? frames it directly: an LLM has only parametric memory (knowledge frozen into weights at training time) and contextual memory (the context window, lost when the session ends). Cross-session remembering is therefore always an external system layered on top — “Agent Memory = LLM memory + an external persistent memory management system,” which the article calls a “computational exocortex.” Without it, “an agent without augmented memory is merely a reflex agent.” A cited Microsoft/Salesforce study backs this: LLMs measurably degrade in extended conversations, and the “lost in the middle” attention problem means ever-larger context windows are not a substitute for real memory.

What actually persists. The same page gives the taxonomy of long-term memory types that survive session boundaries: episodic (turn-by-turn transcripts and compressed summarization digests), semantic (knowledge bases, entity profiles, persona), procedural (tool registries, workflow records), and shared (multi-agent coordination memory, requiring ACID guarantees). Everything reaches these stores through a five-stage pipeline: aggregate → encode (embeddings + metadata) → store → organize → retrieve.

The concrete mechanisms, per source:

  • Session-end summarization — the dominant practical pattern. Three Building Blocks: AI Virtual Assistants shows the production version: the LangGraph agent embeds and stores queries/responses within a session (short-term), then at session close writes a summarized conversation history plus sentiment into a structured database that future sessions retrieve — so customers never repeat context. The MongoDB article describes the same mechanism abstractly as the “episodic summarization trigger.”
  • Retrieval-scored memory poolsCh. 6 — Reflection and Refinement surveys the research systems: Generative Agents store experiences as text and retrieve by a composite recency + relevance score; MemoryBank/TiM/RecMind encode memories as vectors in FAISS indexes queried with the current situation; MemGPT treats the context window as RAM and external storage as disk, with the LLM itself deciding when to save or retrieve; REMEMBER stores (environment, task, action, Q-value) tuples so past outcomes steer future plans.
  • Weights as memory — the survey’s alternative: embodied memory, fine-tuning experiences directly into parameters via PEFT/LoRA (CALM, AgentTuning). From Human Memory to AI Memory formalizes this split in its 3D-8Q taxonomy (parametric vs. non-parametric × personal vs. system × short- vs. long-term) and states the tradeoff both sources agree on: retrieval-based memory is cheap to update in real time but depends entirely on retrieval accuracy; parametric memory has far greater capacity but costly updates and poor fine-grained retention.
  • Forgetting as a feature — rather than deleting stale memories, systems degrade a strength attribute so old memories fade from retrieval but can re-strengthen if reactivated (What Is Agent Memory?); the survey’s human-cognition analog is consolidation/reconsolidation.

One-sentence answer: across sessions, agents remember by persisting selected, encoded experience outside the model — most commonly as embedded summaries and typed memory stores retrieved by similarity and recency at the start of future sessions — with fine-tuning into weights as the heavier, rarer alternative.