What is Long Term Memory?
Also called Persistent Store, Cross Session Memory.
Long term memory is information an AI system retains across sessions and recalls much later, such as stable user preferences, learned facts, and records of completed work. It lives in a database, document index, or knowledge graph outside the model, and it is retrieved selectively rather than carried in every prompt.
The defining property is survival past the current conversation. Where short term context is replayed wholesale, long term memory is far too large to include in a prompt, so it is queried instead. Retrieval decides which few stored items are relevant now, which makes long term memory a retrieval problem more than a storage problem.
Writing is the harder half. A system must decide what in a conversation is durable and general rather than incidental, since storing every statement fills the store with noise that later crowds out useful recall. Common approaches extract candidate facts with a model, deduplicate against existing entries, and attach a source and timestamp.
Updates and contradictions need an explicit policy. A stored preference can be reversed later, so records are usually versioned or superseded rather than silently overwritten, and conflicting entries need a rule such as most recent wins. Without this, a system confidently recalls a preference the user abandoned months ago.
Long term memory is also the surface where privacy obligations concentrate. Entries about identifiable people are personal data, so retention periods, export, correction, and deletion must reach the memory store, its indexes, and any derived embeddings. Deleting only the source row leaves the fact recallable through its vector copy.
Key points
- Persists across sessions and is queried, not replayed.
- Deciding what to write matters more than capacity.
- Contradictions need versioning or a most recent wins rule.
- Deletion must reach derived embeddings and indexes.
- Timestamps and sources make recalled facts auditable.
In practice
During onboarding a user says they prefer written summaries over calls. The statement is stored with a date and a source reference. Four months later, while planning a project handoff, the system retrieves that preference and proposes a written brief instead of a meeting. When the user later asks for calls, the earlier entry is superseded rather than deleted.