Plain-English explanation

An LLM by itself has no memory between separate conversations: every new chat starts from a blank slate except for whatever the app sends it as context. Long-term memory is the general term for systems built to work around that: storing important information from earlier conversations somewhere durable, then pulling relevant pieces of it back into the model's context window when it becomes useful again, potentially days, weeks, or months later.

How it works

Long-term memory systems generally involve three steps: extracting what's worth remembering from a conversation (a name, a preference, a plot point), storing it somewhere outside the model itself (often a database, sometimes paired with embeddings for semantic search) and then retrieving and re-inserting the relevant pieces into a future conversation's context window before the model generates a reply. That retrieval step is frequently implemented using RAG, though simpler apps sometimes use plainer methods like a fixed user-fact profile that's always included.

The key distinction from ordinary conversation history is durability and scope: long-term memory is designed to survive past the point where the original conversation has scrolled out of the active context window, and often to persist across entirely separate sessions or even separate conversation threads.

Adult-AI use

Long-term memory is what lets an AI companion feel like it has an actual continuous relationship with a user rather than restarting fresh every session, remembering an established backstory, inside jokes, or ongoing storylines from weeks earlier. It's a major selling point for premium companion app tiers, since running a persistent memory store (and the retrieval infrastructure behind it) at scale is more expensive than simply relying on the context window of a single conversation.

How it differs from context window and character memory

Context window is short-term and strictly bounded; it only covers what fits in the current request and has no persistence at all once the conversation resets or grows past it. Long-term memory is explicitly about persistence beyond that boundary. Character memory is the broader, user-facing product term for "the character remembers me": long-term memory is one of the technical ingredients that can make that feature work, alongside (or instead of) simpler in-context or summarization approaches.

Limitations and misconceptions

  • Retrieval isn't perfect. A long-term memory system can retrieve the wrong stored detail, miss a relevant one, or surface something outdated, leading a character to bring up stale or contradictory information.
  • Storage isn't the same as understanding. Saving a fact doesn't guarantee the model will use it correctly or consistently once it's back in context; it's still subject to the same generation behavior, including potential hallucination, as any other input.
  • It has real privacy implications. Persistent memory means a platform is durably storing details about you and your conversations, not just processing them transiently: check the platform's data-retention and deletion policy before storing sensitive details.

Related terminology

Related database entities