Conceptsv3 — Digital BrainDelta-encoded episodes

Delta-encoded episodes

Shipped in v3-alpha (Beta). Interfaces may still change before 3.0 stable.

The idea

Instead of storing each episode as a flat row, organize them as residual trees where similar episodes share common roots:

              ROOT: "Deploy process"
             /          |           \
   "Deploy v2.1"   "Deploy v2.2"   "Deploy v2.3"
   (Δ +rollback)  (Δ +canary)     (Δ +feature-flag)
                       |
              "Deploy v2.2 hotfix"
              (Δ +skip-canary)

Benefits

  1. Storage — only deltas stored, not full repetitive episodes
  2. Self-consolidating — high-frequency paths become new roots automatically
  3. Better recall — similar episodes retrieved together via tree traversal
  4. Explanation — “This is like Deploy v2.2 but with these differences”

Migration

ALTER TABLE mnemo_episode
  ADD COLUMN parent_episode_id TEXT REFERENCES mnemo_episode(id);
ALTER TABLE mnemo_episode
  ADD COLUMN delta_content TEXT;       -- what's different from parent
ALTER TABLE mnemo_episode
  ADD COLUMN is_root BOOLEAN DEFAULT false;
ALTER TABLE mnemo_episode
  ADD COLUMN depth INT DEFAULT 0;
 
CREATE INDEX idx_episode_tree
  ON mnemo_episode (workspace_id, parent_episode_id);

See also