What Is the Difference Between Semantic Memory and Episodic Memory?

Semantic memory is memory for general facts and knowledge that hold true independent of any specific moment — like knowing that Paris is the capital of France — while episodic memory is memory for specific events tied to a particular time and context, like remembering a conversation you had yesterday. The core difference is that semantic memory answers “what is generally true,” and episodic memory answers “what happened, and when.” In AI systems, this same distinction is used deliberately to design agent memory: general knowledge gets stored one way, and a record of past interactions gets stored another, because the two serve different purposes and need to be retrieved differently.

Facts versus events. Semantic memory is general knowledge that stays true across moments — capitals, product rules, domain facts. Episodic memory is what happened in a particular interaction, tied to time and context. ainativedigest.com

Where This Distinction Comes From

The semantic-versus-episodic split originates in cognitive psychology, as a way of dividing declarative memory — the kind of memory you can consciously recall and state outright, as opposed to procedural memory, which is more like knowing how to ride a bike without being able to fully explain the steps. Within declarative memory, semantic memory holds context-free facts: word meanings, historical dates, category knowledge. Episodic memory holds first-person experiences: a specific meeting, a particular meal, the moment you learned a fact, not just the fact itself. Whether something counts as semantic or episodic isn’t always a hard binary in human cognition — a fact you learned yesterday starts out tied to that specific memory of learning it before eventually settling into pure, context-free semantic knowledge — but the underlying distinction between “a fact” and “an event” is exactly what AI systems have found useful to borrow.

What Each Looks Like Inside an AI Agent

When people talk about AI agent memory today, they’re almost always describing a long-term memory layer that sits outside the model’s own context window — since a language model has no memory of its own between calls, everything it “remembers” has to be stored externally and re-supplied to it at the right moment. That external memory is commonly split into the same categories borrowed from cognitive science, alongside a third: procedural memory for learned routines and workflows.

Semantic memory, in this context, is the agent’s accumulated general knowledge — facts about the user, domain knowledge, standing preferences, anything true independent of a specific conversation. If a user mentions once that they’re vegetarian, that’s a fact worth keeping as semantic memory: it should apply to every future interaction, regardless of which conversation it originally came up in.

Different jobs inside an agent. Semantic stores answer what is generally true. Episodic stores answer what this user said or did before. Mixing them in one pile makes retrieval noisy and personalization unreliable. ainativedigest.com

Episodic memory, by contrast, is the agent’s record of specific past interactions — what was discussed in a particular session, what was tried and didn’t work, what a specific past task actually involved. This is what lets an agent say “last time we worked on this, we tried X and it failed” rather than only ever operating on distilled, timeless facts.

A Concrete Example Inside One Agent

Consider a coding assistant used across many sessions. If the user mentions “I prefer tabs over spaces,” that’s a standing preference — semantic memory — and it should influence every future code suggestion regardless of which session it was first stated in. If, in a specific session last week, the user tried a particular library version and hit a bug, that’s an episodic memory — a fact tied to a specific point in time that may no longer even be true (the library might get patched), so it needs to be treated differently from a stable preference. Storing both the same way — as one undifferentiated pile of “things the user said” — makes it much harder for the agent to know which memories are safe to treat as durably true and which are time-bound facts that might already be stale.

Why the Distinction Is a Practical Design Decision, Not Just Terminology

This split matters in practice because semantic and episodic memories have different retrieval needs and different decay behavior. Semantic memories are generally meant to persist and generalize — a user’s stated preference should keep applying until it’s explicitly contradicted or updated. Episodic memories are naturally more perishable: what happened in a specific session becomes less relevant as time passes, and unlike a fact, an event doesn’t need to be “corrected” so much as it needs to be allowed to age out of active relevance.

Store and retrieve them apart. In a vector database, keep separate collections or topics with the right scopes: shared knowledge versus user-scoped history. Retrieve each with the question it is meant to answer. ainativedigest.com

This has a direct effect on how a memory system should be built. Naively storing every message from every conversation and retrieving the most similar ones by embedding search treats a six-month-old episodic detail exactly the same as a standing semantic fact, which causes real problems: stale, contradicted, or outdated information can resurface and get treated as equally trustworthy as a stable fact, quietly degrading the quality of an agent’s responses over time. A more deliberate memory architecture reflects on new information before storing it, decides which category it belongs to, and applies different retention and retrieval rules to each — pruning or summarizing episodic detail as it ages, while deduplicating and merging semantic facts so contradictions get resolved rather than silently accumulating side by side.

Implementing This in a Vector Database

In practice, both semantic and episodic memories are typically stored as embeddings so they can be retrieved by similarity search, but kept as logically distinct collections (or distinguished by a type property) so an agent can query them differently — pulling standing facts regardless of recency, while filtering episodic memories by how recent or session-specific they are. Here’s what that separation looks like set up in Weaviate:

from weaviate.classes.config import Configure, Property, DataType
from weaviate.classes.query import Filter
from datetime import datetime, timezone, timedelta

# Semantic memory: durable facts, not tied to a specific point in time
client.collections.create(
    name="SemanticMemory",
    properties=[
        Property(name="fact", data_type=DataType.TEXT),
        Property(name="user_id", data_type=DataType.TEXT, skip_vectorization=True),
    ],
    vector_config=Configure.Vectors.text2vec_weaviate(source_properties=["fact"]),
)

# Episodic memory: events tied to a specific session and time
client.collections.create(
    name="EpisodicMemory",
    properties=[
        Property(name="event", data_type=DataType.TEXT),
        Property(name="session_id", data_type=DataType.TEXT, skip_vectorization=True),
    ],
    vector_config=Configure.Vectors.text2vec_weaviate(source_properties=["event"]),
    inverted_index_config=Configure.inverted_index(index_timestamps=True),
)

# Retrieval: semantic facts apply regardless of age
semantic = client.collections.use("SemanticMemory")
facts = semantic.query.near_text(query="dietary preferences", limit=5)

# Retrieval: episodic memory filtered to recent sessions only
episodic = client.collections.use("EpisodicMemory")
recent_events = episodic.query.near_text(
    query="library issues we ran into",
    filters=Filter.by_creation_time().greater_or_equal(
        datetime.now(timezone.utc) - timedelta(days=30)
    ),
    limit=5,
)

Notice the two collections aren’t just a naming convention — they’re queried differently on purpose. The semantic query has no time constraint at all, because a durable fact doesn’t become less true with age. The episodic query explicitly filters by recency, because an event’s relevance is expected to fade as time passes. That difference in how each is retrieved is the entire practical payoff of keeping the two separate in the first place.

Why It Matters

The semantic-versus-episodic split isn’t academic trivia carried over from psychology for its own sake — it’s a direct answer to a real engineering problem: an agent that treats every past interaction as equally durable and equally relevant will eventually surface stale, contradicted, or context-specific information as if it were a stable fact, and that failure mode gets worse the longer an agent runs and the more it accumulates. Designing memory around this distinction from the start — deciding deliberately what belongs in each category, and applying different retrieval and decay rules to each — is what separates a memory system that stays useful over months of operation from one that slowly degrades into an unreliable pile of everything the agent has ever seen.