V · MemoryMature★★

Cross-Session Memory

also known as Persistent User Memory, Long-Lived User Profile, Beat Agent Amnesia, No-Forget Memory, Agent Forgets Between Sessions, Session-to-Session Memory

Persist user-specific facts, preferences, and prior context across all sessions, threads, and devices.

This pattern helps complete certain larger patterns —

  • used-bySleep-Time Compute·During idle or downtime, run the model offline against the user's standing context to pre-compute dense summaries and likely future answers, so test-time latency and cost drop when the user actually asks.

Context

A team is building a user-facing assistant where the user expects continuity between visits. The user mentioned a preference last Tuesday, named a project two weeks ago, and told the assistant their pet's name a month ago. Today they expect the assistant to remember those facts without being re-told.

Problem

Per-thread memory loses everything between sessions: every new conversation starts from a blank slate, the user has to repeat themselves about basic facts, and the assistant feels amnesic and impersonal. The team needs a mechanism that captures the right kind of information at the right time, stores it durably across sessions, and surfaces it back into context when relevant — without leaking private details, blurring sessions together, or storing every passing remark as if it were load-bearing.

Forces

  • What to remember vs forget; user agency.
  • Privacy, deletion, portability requirements.
  • Cost of always-on memory loading per turn.

Example

A user uses their personal assistant on the laptop in the morning, the phone at lunch, and a smart speaker in the evening. Without persistent memory, each device feels like a stranger — the user repeats their dietary restrictions three times in one day. The team adds Cross-Session Memory: stable user-specific facts (allergies, preferred name, default timezone) are stored centrally and loaded into every new session on every device. The assistant stops feeling amnesic and the user stops repeating themselves.

Diagram

Solution

Therefore:

Maintain a per-user store of distilled facts (preferences, prior context, names, projects). Load relevant slices into each session's context. Provide explicit add/forget tools. Audit and surface memory entries to the user. Deletion controls and a user-visible memory inspector (delete / disable / export) satisfy regulatory and trust requirements.

What this pattern forbids. Memory entries must be added through declared tools; the model cannot silently mutate persistent user state.

The smaller patterns that complete this one —

  • generalisesSemantic MemoryMaintain a dedicated store of what the agent holds to be true about the user and the world, separate from event records (episodic) and learned how-to (procedural).

And the patterns that stand alongside it, or against it —

  • complementsShort-Term Thread Memory★★Carry the relevant slice of conversation context across turns within a session.
  • alternative-toMemGPT-Style PagingTreat the LLM context window as RAM and external storage as disk, with the model issuing tool calls to page memory in and out.
  • complementsSession Isolation★★Keep one user's session state and memory unreachable from another user's agent.

Neighbourhood

Click any neighbour to follow the language. Scroll to zoom, drag to pan.

Used in recipes

Used in frameworks

Show 8 more

References

Provenance