HomeRoadmapsAgent Memory Day 3
Conversational AI, Agent Memory & Multi-Turn Testing Β· Day 3 Β· 20 min

Episodic & Semantic Memory Lifecycle
Conversational AI, Agent Memory & Multi-Turn Testing β€” Day 3

Test write/read/update/forget semantics, deterministic TTL eviction of ephemeral session facts, and recency-plus-confidence conflict resolution for contradictory customer updates.

⚑ Runtime: Python 3.10+ · Zero External Dependencies (unittest)🧠 Conversational AI & Agent Memory QE Lead
Episodic MemorySemantic MemoryTTL EvictionConflict ResolutionRight to Forget
About this lab

Production agents separate short-lived episodic facts (such as an OTP verification timestamp) from durable semantic profile preferences. Today you will validate TTL expiration, right-to-be-forgotten erasure, and conflict resolution when newer or noisier facts collide with verified memory.

πŸ“¦Sample Codebase & Working Solution (Day 3)Available Now
View on GitHub

The official reference codebase for Day 3 is hosted in the repository. Clone the repository and navigate to day-3-memory-lifecycle/test_day3.py to run the working solution.

Git Clone β€” Working Solution
git clone https://github.com/777abhi/agent-memory-testing-roadmap.git
cd agent-memory-testing-roadmap/day-3-memory-lifecycle/test_day3.py
🏭Production Context & Regulated Servicing Implementation
πŸ’‘ Why We Are Doing This: Retaining an expired OTP verification state creates an authentication bypass, while letting a low-confidence rumor overwrite a verified mailing address causes misdirected statements.
🏒 Real-World Production Usecase: Deterministic clock-driven memory lifecycle tests covering TTL eviction, explicit forget() erasure, and recency-plus-confidence conflict arbitration.
βš™οΈ How Implemented in Production: AgentMemoryStore and ConflictResolutionRecord in memlab/memory_store.py.
Phase 1

Run Memory Lifecycle & Conflict Tests

Execute the Day 3 memory store suite to verify eviction, erasure, and conflict resolution.

Step 1.1: Run Day 3 Lifecycle Tests
Terminal β€” Run Day 3
npm run test:day3
Step 1.2: TTL Eviction & Conflict Resolution
memlab/memory_store.py
store = AgentMemoryStore(recency_boost_window=300.0)
store.write("otp_verified", "true", "episodic", confidence=1.0, now=2000.0, ttl_seconds=120.0)
evicted = store.evict_expired(now=2200.0)
assert evicted == ["otp_verified"]
Day 3 Key Learnings
  • Verified full write, read, update, and explicit forget() erasure semantics with zero residual entries.
  • Enforced deterministic TTL expiration so ephemeral episodic facts expire while semantic facts persist.
  • Tested recency + confidence conflict arbitration with an auditable conflict_log.

🧠 Knowledge Check

How should an agent memory store resolve a conflict when a low-confidence noisy mention arrives shortly after a high-confidence verified fact?