Memory Blocks and Sleep-Time Compute (Letta)

MemGPT became Letta in 2024. The 2026 evolution adds two ideas: discrete functional memory blocks the model can edit directly, and a sleep-time agent that consolidates memory asynchronously while the primary agent is idle. This is how you scale memory beyond one conversation.

Build 1.3 hr Python (stdlib)

Prerequisites: Phase 14 · 07 (MemGPT)

#Learning Objectives

  • Name the three memory tiers Letta uses (core, recall, archival) and the role of each.
  • Explain the memory-block pattern: Human block, Persona block, and user-defined blocks as first-class typed objects.
  • Describe what sleep-time compute is, why it sits off the critical path, and why it can run a stronger model than the primary agent.
  • Implement a scripted two-agent loop where a primary agent serves responses and a sleep-time agent consolidates blocks between turns.
Full Access lesson

Keep going. The rest of this lesson is one step away.

Unlock all 503 lessons, video, code, quizzes and every future update. Pay in your own currency with Paystack.

The text and code of this lesson are based on AI Engineering from Scratch by Rohit Ghumare, MIT licensed.