Interface TraceSnapshot

A memory_traces row as a ledger row's before-state holds it: every column but the embedding. A restore keeps the row's embedding where the row holds the snapshot's content (writeTraceSnapshot); a trace restored to other content regains a vector when it is next written (as memory_update clears it when the content changes).

interface TraceSnapshot {
    id: string;
    type: string;
    scope: string;
    scopeId: string;
    content: string;
    strength: number;
    createdAt: number;
    lastAccessed: null | number;
    retrievalCount: number;
    tags: string;
    emotions: string;
    metadata: string;
    deleted: 0 | 1;
    scopeIdForm?: "plain" | "encoded";
}

Properties

id: string
type: string
scope: string
scopeId: string
content: string
strength: number
createdAt: number
lastAccessed: null | number
retrievalCount: number
tags: string
emotions: string
metadata: string
deleted: 0 | 1
scopeIdForm?: "plain" | "encoded"

The form of the brain's user and persona scope ids when the snapshot was read: 'encoded' once a learning layer re-filed the brain (SCOPE_ID_FORM_KEY), else 'plain'. Memory.restoreTrace writes a plain snapshot into a brain re-filed since under the encoded id, as the re-file wrote the row: there a plain id that holds a / reads as a namespaced user's (team/ana names user ana of namespace team). Unset, a restore writes the scope id as the snapshot holds it.