Skip to content
LinkedInX

Long-Term Memory Storage Patterns

Target audience: Those deciding how to actually store long-term memory, those weighing the trade-offs between storage formats
Prerequisites: Basic understanding of Short-Term and Long-Term Memory

How long-term memory is stored determines how manageable and how accurate it stays. Four patterns dominate, and real systems usually combine them.

The Four Patterns

PatternContentsGood fit
FilesStored as documents such as MarkdownFew entries, people want to edit them
Structured recordsData with fixed fieldsSettings and profiles with a known shape
Vector searchEmbedded and retrieved by similarityLarge volume, only related entries needed
SummariesCompressed historyHistory matters but full text does not
This table scrolls horizontally. Keyboard users can focus the table and use the left and right arrow keys.

File-Based Storage

The simplest pattern, suited to small volumes. Its biggest advantage is that a person can read the contents and fix them directly. A wrong memory is noticed immediately and corrected on the spot.

# Project notes
- Japanese is the source of truth; English is translated
- Production deploys only after approval
- Use the term "AI transformation" consistently

Once entries pass a few dozen, though, passing the whole file every time becomes wasteful.

Structured Records

This suits information whose fields are known in advance. Unlike free text, it allows precise overwriting.

FieldValue
Answer styleConcise, bullet-point focused
LanguageEnglish
Operations requiring approvalProduction deploy
This table scrolls horizontally. Keyboard users can focus the table and use the left and right arrow keys.

Free text can end up holding both “be concise” and “be detailed”; structured fields make that contradiction far less likely.

This becomes necessary once volume grows beyond what can be passed every time. The mechanism matches RAG: only the entries relevant to the current task are retrieved.

The caveat is that people lose visibility into the contents. Because a wrong memory can hide unnoticed, store a date and source as metadata so stale entries can be filtered out.

Summaries

Long history is compressed down to decisions, open questions, and constraints. This preserves the thread while cutting volume, but anything dropped during summarization cannot be recovered. Keep important source text separately.

Choosing a Pattern

graph TD
    S["Is the volume large"] -->|No| F["Files / structured records"]
    S -->|Yes| V["Vector search + summaries"]
    F --> H["Keep contents readable and correctable by people"]
    V --> M["Attach date and source as metadata"]

Starting with files or structured records and adding vector search once volume becomes unmanageable is the practical path. Building the complex version first tends to mean operating for a long time without noticing errors in the contents.

Summary

  • The four storage patterns are files, structured records, vector search, and summaries
  • Small volumes suit files that people can correct; known shapes suit structured records
  • Move to vector search as volume grows, and always attach date and source
  • Summaries cut volume, but dropped details do not come back
Quiz