Urgent.News

What's breaking now, across thousands of outlets.

AI

My AI agents' shared memory now sleeps on its own, and stopped losing conversations

I'm building Agent Brain Hub , an open-source memory that several AI agents share. It's modeled on the human brain, and like a brain it needs sleep: that's when conversations get consolidated into long-term memory, expired facts get forgotten, and the brain reflects on what it learned. Until this week, sleep only happened when someone clicked Run sleep cycle . The bug that pushed me While adding…

A new open-source memory system, named Agent Brain Hub, is being developed by the author. This system allows multiple AI agents to share a common memory, modeled after the human brain. Just as the human brain requires sleep, Agent Brain Hub also needs sleep for its operations.

Previously, sleep was initiated only when someone manually clicked "Run sleep cycle". However, the author added automatic sleep functionality and discovered a significant issue. Working memory can only retain the last 40 turns of conversation. After 30 exchanges of messages without any user interaction, the initial 10 questions were lost, as they were not consolidated into long-term memory. Consequently, no agent could recall these early questions.

There are three new ways Agent Brain Hub can fall asleep:

1. When the customer is silent, implying the session is over, which lasts for 30 minutes as the default idle time.

2. If there are too many turns waiting to be consolidated, specifically when there are 24 turns or more.

3. Once a day at 03:00 UTC for customers that have been active since the previous night.

The core trigger for sleep is determined by comparing three variables: the number of turns, the maximum pending turns, and the idle minutes. The default idle time of 30 minutes is not arbitrary; it matches the brain's own mechanism to determine when a new session begins.

The pressure threshold is set below the 40-turn cap, ensuring that no data is lost during the consolidation process. Manual and automatic sleeps share the same queue, preventing simultaneous access to memory. This design ensures that no customers incur unexpected charges, as there are no bursts of summarization calls on the first start.

The author has also ensured that there's a live view of the automatic runs in the brain view, with a note indicating why the brain fell asleep. For Docker users, the system operates in UTC, so setting the timezone accordingly is recommended to ensure the correct sleep times.

Settings for sleep cycle can be managed through the User Interface (Settings → Sleep cycle) or via environment variables (BRAIN_SLEEP_*). The author has added 9 new tests, including one that reproduces the lost-turns bug. Users are encouraged to test the system by running "docker compose up".

The source code is available on GitHub at https://github.com/leluong141996-dev/Agent-Brain-Hub. The author is open to feedback, particularly if readers have achieved memory consolidation differently in their own AI agents.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

EverSpark Forge V2 — Building a Distributed AI OS

EverSpark Forge V2 — Building a Distributed AI OS EverSpark Forge V2 is now available. This release marks a major architectural shift for the project.

  • EverSpark Forge V2 introduces Distributed AI Operating System architecture.
  • Archon serves as control layer, modules operate on registered nodes.
  • Workflow includes remote node registration, Tailscale networking, deployment.

IBM Granite Guardian: el motor del guardrail

Respuesta corta IBM Granite Guardian es el motor de guardrails integrado en los modelos IBM Granite, diseñado para aplicar políticas de seguridad, cumplimiento y ética en tiempo real durante la…

LGPD y datos personales en la IA

Respuesta corta La LGPD exige que el tratamiento de datos personales mediante inteligencia artificial cumpla con sus principios fundamentales: finalidad, necesidad, transparencia, seguridad y…

  • LGPD requires lawful basis, impact assessments, and DPO for AI processing personal data in Brazil.
  • ANPD issued guidelines linking LGPD requirements explicitly to AI systems.

More from Wednesday 7 October →