13.1 Episodic vs Semantic Memory

The Two Core Components of an Agent's Mind

For an AI agent to exhibit sophisticated intelligence, it needs a robust memory system. Inspired by human cognition, we can divide an agent's long-term memory into two fundamental types: Semantic Memory and Episodic Memory. Understanding the distinction is key to building agents that can both recall facts and remember personal experiences.

Semantic Memory: The Library of Facts

This is the agent's knowledge base of general, context-independent facts about the world. It's like an encyclopedia. It contains information such as "The sky is blue," "Paris is the capital of France," or technical data learned from documents.

  • Nature: Structured, factual, objective.
  • Implementation: Often stored in vector databases for fast, semantic searching of documents or knowledge graphs.
Episodic Memory: The Personal Diary

This memory stores specific events and experiences from the agent's past interactions, anchored in time and context. It's the agent's personal history, containing records like "At 10:30 AM, the user asked me about the weather in London," or "In our last session, we discussed project Alpha."

  • Nature: Sequential, autobiographical, subjective.
  • Implementation: Can be a chronological log of conversations, a timeline of events, or summaries of past interactions stored with timestamps.

Use the buttons in the visualization to query the agent. Observe which memory system it uses to answer different types of questions.