Conceptsv3 — Digital BrainWorking memory (Redis layers)

Working memory

Shipped in v3-alpha (Beta). Adds two ephemeral tiers (L0, L1) on top of the hot/warm/cold cascade. Interfaces may still change before 3.0 stable.

The complete memory stack (v3)

L0: WORKING MEMORY  (Redis, TTL 1–60min)
    Tool outputs awaiting processing
    Intermediate computation results
    "Currently looking at file X" state
    Multi-step workflow checkpoints
    Rate-limit counters / dedup bloom filters
    Key: mnemo:{ws}:work:{agent}:{key}
    Eviction: TTL-based (never LRU)

L1: SESSION MEMORY  (Redis, TTL 24h)
    Session buffer (turns + pins + scratch)
    Conversation-scoped entity co-reference
    In-flight task state
    Key: mnemo:{ws}:sess:{id}:*
    Eviction: TTL + collapse trigger

L2: HOT CACHE       (Redis, TTL 5min–24h)
    ACT-R activation scores (sorted set, top-1000/ws)
    Recent recall results (query hash → hits)
    Agent profile summary
    RBAC policy cache
    Key: mnemo:{ws}:hot:*
    Eviction: LRU by activation score

L3: SEMANTIC CACHE  (PostgreSQL, TTL 24h)
    mnemo_query_cache (cosine ≥0.95 shortcuts full pipeline)
    Embedding LRU (avoid re-embedding same text)

L4: LONG-TERM       (PostgreSQL, bitemporal)
    All 10 cognitive primitives
    Knowledge graph (hypergraph relations)
    Reasoning library
    Citations + provenance

L5: ARCHIVE         (PostgreSQL, partitioned, immutable)
    mnemo_fact_archive (merged/pruned facts)
    mnemo_audit_log (Merkle-chained)
    mnemo_session_log (collapsed sessions)

Graceful degradation

Redis healthy     → Full stack (L0–L5)
Redis degraded    → L0/L1 fall to in-process Maps (bounded 10MB)
                    L2 served from PG (slower but correct)
Redis unavailable → Sessions disabled (503 on session ops)
                    Recall works (L3+L4 only, ~100ms not ~5ms)
                    Tasks work (PG-backed, no hot cache)

Why two new layers, not one

L0 (working memory) holds active computation state — tool outputs the agent is about to consume. L1 (session memory) holds conversation state — turns, pins, scratch. Mixing them would mean the bloom filter for dedup competes with session buffers for the same eviction policy. Splitting them lets us pin L0 to strict TTL (never LRU) while L1 follows lifecycle-based eviction.

See also