Skip to content

Long-term Memory (LTM)

External persistent storage that gives LLMs access to information beyond their context window, typically implemented using a vector database as the retrieval layer.

Long-term memory, often abbreviated LTM, refers to external storage that gives a language model access to information beyond its context window, persisting across sessions. Because a model itself remembers nothing between calls and can only hold a limited amount of text at once, long-term memory is supplied by an outside system — most commonly a vector database.

The vector database acts as the retrieval layer for this memory. Past conversations, documents, facts, and user preferences are embedded and stored, and when they become relevant again the system retrieves them by semantic similarity and feeds them back into the model’s context. This lets an assistant recall something you discussed weeks ago, or an agent draw on accumulated knowledge, despite the model having no inherent memory of its own.

It is important to understand what this memory is and is not. A vector database provides searchable memory — it retrieves relevant slices of the past on demand — but it does not by itself decide what is important, summarise, or maintain a narrative. Full long-term memory systems layer those capabilities on top, combining vector retrieval with logic for what to store, forget, and prioritise.