MidnightTokensdeveloper portal
Sign In
Unit Study Document

Long-Term Memory: Semantic & Episodic Buffers

6 min readβ€’Visual explainer included

Episodic vs Semantic Memory

Agents utilize different kinds of memory to maintain context:

  • Episodic Memory: A log of the specific sequence of actions and thoughts from the current session.
  • Semantic Memory: Vector-based semantic database lookups containing general knowledge or past interactions.

Episodic Memory Buffer in Python

class EpisodicMemory:
 def __init__(self):
 self.log = []
 
 def add_step(self, action, result):
 self.log.append({"action": action, "result": result})
Fast Drill

Active Recalls

Card 1 of 1
Question

What is episodic memory in AI agents?

Tap card to flip
Answer

The sequential history of user interactions, thoughts, tool inputs, and observations within the current run context.

Mastery: 0%
Knowledge Check

Quiz Practice

Question 1 of 1
Which type of memory uses vector similarity search?

Chapter Scratchpad

Auto-saves immediately

Active Recall Cards

Review core concepts before doing the quiz

Fast Drill

Active Recalls

Card 1 of 1
Question

What is episodic memory in AI agents?

Tap card to flip
Answer

The sequential history of user interactions, thoughts, tool inputs, and observations within the current run context.

Mastery: 0%

AI Study Buddy

Always online

Hi! I'm Spooky, your study buddy! Let's learn together.