Long-Term Memory Storage Patterns
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
| Pattern | Contents | Good fit |
|---|---|---|
| Files | Stored as documents such as Markdown | Few entries, people want to edit them |
| Structured records | Data with fixed fields | Settings and profiles with a known shape |
| Vector search | Embedded and retrieved by similarity | Large volume, only related entries needed |
| Summaries | Compressed history | History matters but full text does not |
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" consistentlyOnce 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.
| Field | Value |
|---|---|
| Answer style | Concise, bullet-point focused |
| Language | English |
| Operations requiring approval | Production deploy |
Free text can end up holding both “be concise” and “be detailed”; structured fields make that contradiction far less likely.
Vector Search
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