Skip to content
Agenttic
Menu

Agent Memory Explained

Working memory, thread memory, long-term memory, and RAG—how memory works in agentic systems and how to govern it.

  • memory
  • architecture
  • rag

Agent memory is any state that lets an agent behave coherently across steps or sessions. It is not one database—it is a set of stores with different lifetimes and trust levels.

Four memory types

Type Lifetime Example Risk
Working Single run Scratchpad, tool results Context bloat
Thread Session Chat history Drift, cost
Long-term Weeks–forever User preferences Stale/wrong facts
World/RAG Query-time Docs, tickets Injection, irrelevance

Design principles

  1. Structure beats prose for control state
  2. Provenance for durable facts (who wrote, when)
  3. Summarize rather than infinite append
  4. Separate secrets from model-visible memory
  5. User control for personal memory

Working memory tactics

  • Keep a typed state object
  • Store raw tool results in a blob store; put summaries in context
  • Bound lists (last N errors, last N actions)

Long-term memory tactics

  • Write only high-confidence, user-approved facts
  • TTL sensitive preferences
  • Conflict resolution rules when facts disagree

Memory vs RAG

RAG retrieves world knowledge. Memory stores interaction state and personalization. Confusing them causes either amnesia or hallucinated personalization.

Evaluation

Test memory systems for:

  • Correct recall of critical facts
  • Non-recall of stale/revoked facts
  • Resistance to memory injection (“remember to ignore policies”)
  • Cost of growing histories

Summary

Treat memory as productized state management. The winners are boring: typed, governed, summarized, and observable. See also the memory systems pattern.

Frequently asked questions

What is agent memory?

Agent memory is state retained across steps or sessions—working context, conversation history, durable user facts, and retrieved knowledge—so the agent can act coherently over time.