Designing a 'sleep cycle' for AI agents by decoupling memory cleanup from reasoning

For an AI agent to genuinely 'sleep' and consolidate its memory, the central decision-making (compared to the prefrontal cortex, or PFC) must be completely disconnected from the actual work of processing memory queues. If that central still has to monitor or approve the consolidation process, it isn't real rest — it's just micromanaging in the dark. What's needed instead is an automatic trigger system that operates below the level of active decision-making, controlling the memory queue (MQ) and a reflection queue (REFLECTQ) purely through structural rules.

Rather than a fixed timer, this uses a 'sleep pressure accumulator' modeled on drift- dynamics, letting the shift into idle/batch mode happen based on real system load. The pressure rises as unprocessed records pile up in the write-ahead log (WAL), the memory queue, and the reflection queue, and also increases with signals like fatigue or latency from a . It falls whenever active task signals pass through a central router (compared to the thalamus, or THAL), which keeps the system in an awake state.

Once the accumulated pressure crosses an upper threshold, the system switches into an idle state and begins offline .

Key points

  • Letting the central decision directly supervise memory consolidation defeats the purpose — it isn't real rest, just interference
  • Memory cleanup should be triggered by a fluctuating 'sleep pressure' signal rather than a fixed timer
  • Pressure rises as unprocessed records and fatigue/latency signals build up, eventually triggering offline
  • Active task signals lower the pressure and keep the system in an awake state
Read original