My AI agents' shared memory now sleeps on its own, and stopped losing conversations
Описание и применение
Автоматический сон в Agent Brain Hub предотвращает потерю ранних сообщений в длинных беседах, консолидирует память и избегает неожиданных расходов.
Задача
Working memory kept only the last 40 turns, so after 30 back‑and‑forth messages without a manual sleep, the first 10 turns were lost and never consolidated into long‑term memory.
Результат
Automatic sleep prevents loss of early conversation turns, consolidates memory, and avoids surprise billing by staggering summarization calls.
Рабочий процесс
- 1. Detect trigger: if turns >= cfg.maxPendingTurns → pressure; else if idleMinutes >= cfg.idleMinutes → idle; else null.
- 2. Run sleep cycle when trigger is not null.
- 3. Consolidate conversations into long‑term memory and forget expired facts.
- 4. Update brain view with note explaining why sleep occurred.
Доказательства
Working memory keeps only the last 40 turns. After 30 back‑and‑forth messages with nobody pressing the button, the first 10 questions were simply gone.
The core check is small: const trigger = turns >= cfg.maxPendingTurns ? 'pressure' : idleMinutes >= cfg.idleMinutes ? 'idle' : null;
Manual and automatic sleeps share one queue, so two runs never touch memory at the same time.
- Дата записи: 2026-10-07T16:41:08.803Z