Skip to content

roadmap: make BrainLayer self-maintaining #628

Description

@EtanHey

Ruling

BrainLayer must maintain its own memory quality. Deduplication, supersession, correction, enrichment, and hygiene cannot depend on agents remembering to invoke maintenance tools.

The July 2026 nine-tool profile incident demonstrated the failure mode: maintenance calls were unavailable for days while stale memories continued to win retrieval, with no autonomous repair loop.

Scope

Design a background maintenance subsystem that:

  • detects duplicate, stale, contradicted, and under-enriched memories;
  • schedules enrichment, deduplication, correction, supersession, and archival work without agent prompting;
  • preserves the one-writer contract and explicitly handles SQLite locking, WAL growth, retries, and backpressure;
  • records auditable decisions and exposes health/progress metrics;
  • applies conservative safety gates for personal data and user-intent memories;
  • fails visibly rather than silently degrading memory hygiene.

Non-goal for the urgent nine-tool unblock

Do not build this system in the gated-tool error/runtime-unblock patch. This issue is the durable roadmap record for a separately designed and reviewed project.

Definition of ready

  • architecture and failure-mode review completed;
  • maintenance policy and safety boundaries documented;
  • measurable quality/health criteria defined;
  • rollout plan includes shadow mode, observability, recovery, and WAL/lock verification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions