Skip to content

[Feature]: Cognitive Memory Layer — Persistent, Semantic Memory with Ebbinghaus Decay #52532

Description

@wazionapps

Summary

Add a cognitive memory layer based on the Atkinson-Shiffrin model (1968) that gives OpenClaw persistent, semantic memory across sessions — with natural forgetting curves, metacognitive error prevention, and trust-based relationship tracking.

Problem to solve

OpenClaw sessions are stateless. Every new conversation starts from zero:

  • No memory of past decisions — the assistant doesn't know what was decided last week or why
  • Repeats mistakes — makes the same error the user corrected yesterday because it has no learning system
  • No context continuity — can't connect today's work with last week's patterns
  • Keyword-only search — if you don't remember the exact word, you can't find the memory
  • No relationship — treats every session identically regardless of history with the user

This is the #1 frustration for power users who work with AI assistants daily.

Proposed solution

NEXO Brain — an open-source cognitive memory system already implemented and published:

What it provides:

Memory Model (Atkinson-Shiffrin):

  • Sensory Register → Short-Term Memory (7-day half-life) → Long-Term Memory (60-day half-life)
  • Ebbinghaus forgetting curves — memories fade without use, strengthen with access
  • Automatic consolidation: frequently-used STM promotes to LTM
  • Dormant memories reactivate when relevant context appears

Semantic Search (Vector RAG):

  • fastembed (BAAI/bge-small-en-v1.5, 384 dims, CPU-only, no API needed)
  • Finds memories by meaning, not just keywords
  • "deploy problems" finds "SSH connection timeout on production" even with zero word overlap

Metacognitive Guard:

  • Before every code change: "Have I made this mistake before?"
  • Searches past errors semantically, surfaces warnings BEFORE acting
  • Trust score modulates verification rigor (low trust = more checks)

Cognitive Dissonance Protocol:

  • Detects when new instructions conflict with established knowledge
  • Verbalizes the conflict instead of silently obeying or resisting
  • Three resolutions: paradigm_shift, exception, override

Discriminative Fusion:

  • Near-duplicate memories for different contexts (Linux vs Mac) stay separate as "siblings"
  • Prevents "lobotomy by averaging" when merging similar memories

Trust Score (0-100):

  • Tracks alignment with the user over time
  • Positive events (thanks, successful delegation) increase trust
  • Errors and corrections decrease trust
  • Score modulates internal rigor, not permissions

Sentiment Detection:

  • Adapts tone based on user's mood (concise when frustrated, proactive when positive)

Automated Sleep Cycle:

  • 03:00 — Ebbinghaus decay + memory consolidation + duplicate merging
  • 07:00 — Self-audit + health checks + metrics
  • 23:30 — Post-mortem + pattern extraction from day's events
  • Boot — Catch-up for any missed processes

Technical specs:

  • 50+ MCP tools across 12 categories
  • Hot-loadable plugin system
  • SQLite-only (no external DB)
  • ~100KB package, ~200MB with dependencies (fastembed+numpy)
  • macOS (LaunchAgents), Linux support planned

Alternatives considered

  1. Simple key-value memory — Doesn't support semantic search or forgetting. Accumulates noise indefinitely.
  2. Cloud-based vector DB (Pinecone, Weaviate) — Adds latency, cost, and privacy concerns. NEXO runs 100% local.
  3. LLM-summarized memory — Expensive (API calls for every memory operation) and lossy (summaries discard detail).
  4. No memory (current state) — Users compensate with manual CLAUDE.md/AGENTS.md maintenance. Doesn't scale.

Impact

  • Affected: Every user who works with OpenClaw across multiple sessions
  • Severity: High — memory loss is the fundamental limitation of current AI assistants
  • Frequency: Every session start (100% of users experience the cold-start problem)
  • Consequence: Repeated mistakes, lost context, manual documentation overhead, reduced trust in the assistant

Evidence/examples

Additional information

This could integrate with OpenClaw as:

  1. A ClawHub skill — standalone extension users can install
  2. A core memory module — native integration into OpenClaw's architecture
  3. Both — skill for immediate use, native integration as a roadmap item

The entire system is MIT-licensed and designed to be framework-agnostic. The MCP tools can be adapted to OpenClaw's extension API.

We're happy to contribute directly, adapt the architecture to OpenClaw's patterns, or collaborate on integration design.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions