Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Agent Memory  ›  Lesson

Episodic and Semantic Memory

User Profile Storage 12 minEpisodic memory stores dated records of what happened, semantic memory stores facts that stay true such as a user profile, and repeated episodes can be distilled into semantic facts.

Episodic and Semantic Memory

Tripmate knows two very different kinds of things about Asha. It knows that "Asha is vegetarian". It also knows that "in October, the Thursday sleeper to Jaipur was full, so we took the Friday train and she said it was comfortable". The first is a fact. The second is a story about something that happened. Storing them the same way makes both harder to use.

The rule

Episodic memory recalls what happened; semantic memory knows what is true.

The two terms come from how people describe human memory, and they map neatly onto agents:

  • Episodic memory — records of past events, each tied to a time and situation: "15 Oct: searched Pune → Jaipur, Thursday full, booked Friday, user happy." Useful for "last time", for learning from what worked, and for explaining past actions.
  • Semantic memory — general facts, true regardless of when they were learned: "Asha is vegetarian", "home station: Pune", "prefers lower or window berths". Useful on almost every request.

A user profile is the most common semantic store: a small, structured record the agent reads at the start of each session.

{
  "user": "asha",
  "home_station": "PUNE",
  "diet": "vegetarian",
  "seat_preference": "window or lower berth",
  "budget_default_inr": 2500,
  "updated": "2026-10-20"
}

Episodes are often stored as dated entries that can be searched later. Over time, repeated episodes can be distilled into semantic facts: after three trips where Asha picked the cheaper, later train, "prefers price over speed" becomes a profile fact.

The shortcut

For any new piece of information, ask: "Does it have a date that matters?" If the when matters → an episode. If it stays true regardless of when → a semantic fact. Then store each where it is easiest to use: facts in a small structured profile, episodes in a searchable log.

Filing what Asha said after the tripStep 1 of 4
  1. "The Friday sleeper was comfortable"

    It describes one trip on one date. Episode: log it with the date and route.

The trap is storing a profile fact only as an episode. If "vegetarian" lives only inside a long trip log, the agent must search old stories to find it — and may miss it.

Drills

Answer fast — trust the rule.

quick drill

"On 3 November, the Udaipur train was delayed 4 hours" is an example of…

quick drill

Which belongs in a user profile?

quick drill

Asha says she has moved to Mumbai. What should happen to home_station?

quick drill

What does "distilling" episodes into semantic memory mean?

Remember

  • Episodic memory recalls dated events; semantic memory holds facts that stay true.
  • Shortcut: "Does its date matter?" Yes → episode log; no → profile fact.
  • Trap: burying lasting facts inside episodes, where they are hard to find.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainFile these memories

Asha says: "Last Diwali the train was so late I missed dinner. I always want to arrive before 6 pm now. Also, I've switched to a new phone number." Explain which parts are episodic and which are semantic, and how Tripmate should store each.