Coders In Hoods
  • Courses
  • Roles
  • Blog
  • Setup

Coders In Hoods AI Academy

Every course is free. Sign in to start, and your progress, quiz scores and bookmarks follow you.

AI Academy

  • Courses
  • Paths
  • Setup guides
  • How we teach

Role roadmaps

  • AI Engineer
  • Forward Deployed Engineer
  • Machine Learning Engineer
  • All roles

Coders In Hoods

  • The agency
  • Coaching for teams
  • Blog
  • LinkedIn
  • X (Twitter)

Contact

codersinhoods@gmail.com

© Coders In Hoods · since 2019

Course overview

Agent Memory

Free · sign in to start and track progress

1 · How agents remember

  • 1Memory types for agents
  • 2The context window as working memory
  • 3Files, skills and memory tools
  • 4Memory frameworks and benchmarks

2 · Memory in production

  • 5Scoping, retention and erasure
  • 6Write, update and forget

    Exercise answers

    • Answer: Build the write-update-forget pipeline for a 12-week matter
    • Answer: Design a reviewed consolidation job
  • 7Shared state and memory poisoning
  • 8Evaluating memory
CapstoneA memory layer for a 12-week caseReference implementation

Module 2 · Memory in production · Lesson 6

Write, update and forget

Policies for the whole life of a memory. What to write and how to extract it, deduplication, resolving conflicts when facts change, retrieval that respects time, and forgetting by expiry, decay and consolidation, with provenance throughout.

80 min 1 video 3 exercises 6-question quiz Answers
Setup for the exercises:Install Claude CodePython with uv

By the end of this lesson you can

  • Write a policy that decides which observations become memories, with typed extraction and provenance
  • Implement supersession with valid time and recorded time, so a moved deadline updates the current fact without losing history
  • Rank sources by authority and route lower-authority contradictions to review instead of applying them
  • Compute the effect of exponential recency decay over a case's lifetime, and decide which memories should decay and which must not
  • Design a consolidation job (sleep-time or dreaming) whose output is reviewed before it replaces the live store

On this page

  • Intuition: the attendance note, the file summary and the shredder
  • Write policy: what becomes a memory
  • Typed extraction with provenance
  • Deduplication
  • Update policy: when facts change
  • Worked example: the completion date
  • Retrieval policy: time-aware working memory
  • Forget policy: expiry, decay and consolidation
  • Worked example: what decay does over a matter
  • Misconceptions and limits
  • Connections
  • Summary
  • Sources & further reading
  • Quiz

In this lesson

  1. 01Intuition: the attendance note, the file summary and the shredder
  2. 02Write policy: what becomes a memory
  3. 03Update policy: when facts change
  4. 04Retrieval policy: time-aware working memory
  5. 05Forget policy: expiry, decay and consolidation
  6. 06Misconceptions and limits
  7. 07Connections
  8. 08Summary

Sources & further reading

  • Generative Agents: Interactive Simulacra of Human BehaviorPaper · Park, O'Brien, Cai, Morris, Liang, Bernstein · 2023Section 4.1: retrieval by recency (decay factor 0.995 per hour), importance (a 1–10 rating) and relevance; section 4.2: reflection triggered when summed importance passes 150. The origin of most decay and consolidation designs.
  • Zep: A Temporal Knowledge Graph Architecture for Agent MemoryPaper · Rasmussen, Paliychuk, Beauvais, Ryan, Chalef · 2025The bi-temporal model: valid and invalid times for the world, created and expired times for the system, and invalidation of contradicted edges.
  • Mem0: Building Production-Ready AI Agents with Scalable Long-Term MemoryPaper · Chhikara, Khant, Aryan, Singh, Yadav · 2025Section 2.1's update phase (ADD, UPDATE, DELETE, NOOP decided by an LLM against similar memories): a clear example of write-time conflict resolution, and of its failure mode.
  • LongMemEval: Benchmarking Chat Assistants on Long-Term Interactive MemoryPaper · Wu, Wang, Yu, Zhang, Chang, Yu · 2024Knowledge updates as a tested ability, and design improvements including session decomposition, fact-augmented keys and time-aware query expansion.
  • Sleep-time Compute: Beyond Inference Scaling at Test-timePaper · Lin, Snell, Wang, Packer, Wooders, Stoica, Gonzalez · 2025The Letta and Berkeley paper behind background memory work: precompute useful context offline, before queries arrive, to cut test-time cost.
  • Dreams (Managed Agents docs)Docs · AnthropicConsolidation as a job: a memory store plus up to 100 session transcripts in, a new reorganised store out, inputs never modified, output reviewed before use.
Free · sign in to start

Sign in to keep reading.

Free, no card. We use your account to save progress, quiz scores, bookmarks and occasionally send updates from our team.

  • 8 more sections
  • 3 hands-on exercises
  • A 6-question quiz
  • Progress, quiz scores and bookmarks