Skip to content

Memory

1. What Is It?

One-sentence definition

Memory is the mechanism that allows an AI system to "remember" prior statements, user preferences, and important past facts. It is a key step in turning an agent from a one-shot answer machine into a more persistent assistant.

2. Why Does AI Forget?

LLMs are fundamentally closer to turn-based systems. In most products, the system sends "history + new message" back to the model every time.

This creates the illusion of memory. Once the history becomes too long and exceeds the context window, earlier information gets dropped, and the model seems to forget.

3. Types of Memory

Memory typeHuman analogyAI implementationCharacteristics
Short-term memorywhat you are actively thinking aboutsession buffer / rolling windowsmall, fast, local to current conversation
Long-term memoryaccumulated experiencesummaries, databases, knowledge graphs, vector storeslarge, cross-session, persistent

4. Common Short-Term Memory Strategies

text
1. Buffer memory
2. Window memory
3. Summary memory

Summary memory is often the most practical because it preserves important facts while controlling token usage.

5. How Long-Term Memory Works

  1. detect information worth saving
  2. store it in a database or vector store
  3. retrieve it when relevant later
  4. place it back into context

6. Intuitive Analogies

AnalogyMeaning
Sticky notesshort-term memory
Notebook / diarylong-term memory
Brain vs external notebookcontext window vs external store
RAM vs hard driveshort-term fast and small, long-term slower and larger

7. Business Applications

ScenarioMemory use
Customer supportorder history, complaint history, preferences
Personal assistantschedule, family info, food preferences
Education AIweak areas, progress, mistakes
Sales CRMcommunication history, intent, decision chain
Health managementallergy history, medication records, goals

8. What You Need to Remember

  • memory is not just another name for chat history
  • its value is keeping important information active across turns and sessions
  • without memory, many agents remain short-lived and forgetful

From Zero, To Next