Skip to content
LinkedInX

Short-Term and Long-Term Memory

Target audience: Those deciding what an AI should remember and for how long, those organizing the split between short-term and long-term memory
Prerequisites: Basic understanding of What Is Memory

Memory divides into short-term and long-term memory based on how long it persists. The two differ in role and in the criteria used to decide what gets written.

Comparing the Two

AspectShort-term memoryLong-term memory
LifespanOnly within that session or taskPersists across sessions
Typical contentsConversation history, recent tool results, working draftsUser preferences, settled agreements, past results
Write criteriaAccumulates automaticallyWritten selectively, based on future usefulness
Main riskOverflows and buries important instructionsStale entries create wrong assumptions
This table scrolls horizontally. Keyboard users can focus the table and use the left and right arrow keys.

Short-Term Memory: Overflow Is the Default

Short-term memory always grows if left alone. Full tool outputs stay on record and trial-and-error history piles up, which crowds the context window and dilutes the original instruction.

There are only two responses: discard or summarize.

  • Do not keep intermediate results that are no longer needed, such as full logs or discarded options
  • Summarize long history down to decisions, open questions, and constraints

The test when summarizing is whether a detail still affects upcoming decisions. History that does not can be dropped.

Long-Term Memory: Select Before Writing

Long-term memory is not an automatic accumulation but a deliberate write. Three criteria apply.

  1. Reusability — will a future task reference it?
  2. Stability — is it unlikely to change immediately?
  3. Verifiability — can an error be noticed later, and is the provenance recorded?
# Good fit for long-term memory
- Prefers concise, bullet-point answers
- Production deploys run only after approval

# Poor fit for long-term memory
- The list of files currently under review
- Three approaches tried and failed today

Stale Information Is the Biggest Risk

Most quality problems in long-term memory come not from missing information but from stale entries that were never removed. Reversed decisions and resolved issues lead the AI to reason from wrong assumptions.

  • Attach a date and a source when writing
  • When a decision changes, update the existing entry rather than appending a new one
  • Review periodically and delete entries that have served their purpose

Summary

  • Short-term memory holds in-session working state; long-term memory holds knowledge that crosses sessions
  • Design short-term memory expecting overflow, and decide what to discard or summarize
  • Write to long-term memory selectively, judged on reusability, stability, and verifiability
  • The biggest quality risk is stale information, not missing information
Quiz