Interface MemoryView

A read-only snapshot of memory state visible to a node during execution. Populated by the runtime before the node's executor is called; immutable thereafter.

interface MemoryView {
    traces: readonly {
        traceId: string;
        type: MemoryTraceType;
        content: string;
        strength: number;
        scope: GraphMemoryScope;
        createdAt: number;
        metadata?: Record<string, unknown>;
    }[];
    pendingWrites: readonly {
        type: MemoryTraceType;
        content: string;
        scope: GraphMemoryScope;
    }[];
    totalTracesRead: number;
    readLatencyMs: number;
}

Properties

traces: readonly {
    traceId: string;
    type: MemoryTraceType;
    content: string;
    strength: number;
    scope: GraphMemoryScope;
    createdAt: number;
    metadata?: Record<string, unknown>;
}[]

Traces retrieved according to the node's MemoryPolicy.read configuration.

pendingWrites: readonly {
    type: MemoryTraceType;
    content: string;
    scope: GraphMemoryScope;
}[]

Writes staged during this node's execution, not yet committed to the store.

totalTracesRead: number

Total number of traces that matched the read filter (before maxTraces capping).

readLatencyMs: number

Wall-clock time in milliseconds spent on the memory read operation.