Memory Types · Comparison

Short-Term vs Long-Term Memory in AI Agents

Short-term memory holds the current conversation in the context window; long-term memory persists facts and history across sessions — agents need both, plus consolidation to move information between tiers.

Two-tier model

1
Short-term
Context window
Consolidate
2
Long-term
External store

Model

The two-tier memory model

Tier 1: working/short-term (hot, volatile). Tier 2: long-term (cold, durable). Information flows via consolidation.

Analogous to OS paging (MemGPT) and human memory metaphors — but technically: context window = short-term; vector/graph store = long-term. See memory hierarchy for the full stack.

Comparison

Short-term vs long-term: comparison table

Short-term = now; long-term = tomorrow.

DimensionShort-termLong-term
DurationCurrent session / turnDays to years
LocationContext window, Redis bufferVector DB, graph, memory API
Capacity128K–1M tokens (model-dependent)Effectively unbounded
Update rateEvery messageOn consolidation / write
BackendLLM context, Redis listsEngram, Mem0, Zep, pgvector
Example content“User just said they’re vegetarian”“User prefers email, vegetarian since 2024”

Short-term memory · Long-term memory

Consolidation

How information moves from short-term to long-term

Triggers: session end, salience threshold, explicit memory tool. Steps: extract → embed → store → optionally summarize source.

  1. Detect salient facts in current context
  2. Extract via LLM or framework pipeline
  3. Embed and write to LTM store
  4. Optionally summarize or evict raw transcript from short-term

Mem0 uses ~1,800 vs ~26,000 tokens per LOCOMO query after selective LTM retrieval (Chhikara et al., 2025).

Memory consolidation · Writing memories

Production

When agents need both tiers

Stateful agents always need both: context for reasoning now, LTM for tomorrow.

Single-shot Q&A may skip LTM. Any multi-session assistant, support bot or personalization system needs short-term context + durable long-term store. See why AI agents need memory.

Frameworks

Framework support for two-tier memory

  • Engram — Weaviate LTM vectors + your context window as STM
  • Letta — explicit core (STM) + archival (LTM) tiers with paging
  • Mem0 — LTM API + conversation context
  • Zep — temporal graph LTM + session context
  • LangMem — checkpointer (STM) + store (LTM)

Best AI memory tools

FAQ

Frequently asked questions

What is the difference between short-term and long-term AI memory?

Short-term = current conversation in the context window (volatile). Long-term = persisted facts in external storage across sessions (durable). Agents need both plus consolidation between tiers.

Is AI short/long-term memory the same as human memory?

Inspired by the metaphor but technically different — AI short-term is the LLM context window; long-term is vector/graph stores. No biological equivalence.

Is the context window the same as short-term memory?

Yes — the context window is the primary short-term memory substrate. Redis buffers and working memory extend it but context is the core STM layer.

When should agents consolidate short-term to long-term?

Session end, salience thresholds, memory pressure or explicit memory-tool calls. See memory consolidation.

Can agents skip long-term memory?

Single-shot Q&A can. Any multi-session assistant needs LTM — otherwise the agent forgets everything between sessions.

Does Mem0 support both memory tiers?

Yes — Engram and Mem0 both provide LTM extract/store/retrieve; you pair with conversation context as STM. Engram is Weaviate-native; Mem0 is framework-agnostic.

How does Letta handle memory tiers?

Explicit core memory (STM, in-context) and archival memory (LTM, paged in/out). MemGPT DMR 93.4% (Packer et al., 2023). See Letta alternatives.

Does Claude have short and long-term memory tiers?

Claude's context window acts as STM. Long-term memory requires external tools (Engram, Mem0, etc.) — not built into the model API alone.

Is LSTM the same as AI agent long-term memory?

No — LSTM is a recurrent neural network architecture. Agent LTM refers to external vector/graph stores, not RNN hidden states.

How do you benchmark both memory tiers?

LOCOMO and LongMemEval test multi-session recall (LTM). Measure token usage for STM vs full-context. Mem0 ~1,800 vs ~26,000 tokens (Chhikara et al., 2025).