Interface MemoryTrace

interface MemoryTrace {
    id: string;
    type: MemoryType;
    scope: MemoryScope;
    scopeId: string;
    turnUserId?: string;
    content: string;
    structuredData?: Record<string, unknown>;
    entities: string[];
    tags: string[];
    provenance: MemoryProvenance;
    emotionalContext: EmotionalContext;
    encodingStrength: number;
    importance?: number;
    stability: number;
    retrievalCount: number;
    lastAccessedAt: number;
    accessCount: number;
    reinforcementInterval: number;
    nextReinforcementAt?: number;
    associatedTraceIds: string[];
    policy?: MemoryTrustPolicy;
    createdAt: number;
    updatedAt: number;
    consolidatedAt?: number;
    isActive: boolean;
}

Hierarchy (view full)

Properties

id: string
scopeId: string
turnUserId?: string

The explicit user id of the turn that filed this trace when that turn had no learner: a second user speaking on another user's session, whose trace is filed under the session's scope. Account deletion for that user (LearningLayer.forgetUser) finds the trace by it. Absent on every other trace.

content: string
structuredData?: Record<string, unknown>
entities: string[]
tags: string[]
provenance: MemoryProvenance
emotionalContext: EmotionalContext
encodingStrength: number

S_0: initial encoding strength, set at creation.

importance?: number

Optional normalized salience score used by some consolidation/retrieval paths.

stability: number

Time constant (ms); grows with each successful retrieval.

retrievalCount: number

Number of times this trace has been successfully retrieved.

lastAccessedAt: number

Unix ms of last retrieval.

accessCount: number

Total access count (includes non-retrieval touches).

reinforcementInterval: number

Current interval (ms); doubles on each successful recall.

nextReinforcementAt?: number

When this memory is next due for reinforcement review.

associatedTraceIds: string[]

Per-trace capability gating. Set at encoding time from the source-type defaults table (DEFAULT_TRUST_POLICY_BY_SOURCE). When absent, the runtime treats the memory as unrestricted; callers should use canUseFor to gate against authorization / personalization / fact-claim use cases.

createdAt: number
updatedAt: number
consolidatedAt?: number
isActive: boolean