Skip to main content

Function: readTraceSnapshot()

readTraceSnapshot(db, brainId, traceId): Promise<TraceSnapshot | undefined>

Defined in: packages/agentos/src/cognition/memory/retrieval/store/tracePersistence.ts:348

Reads one row of a brain as a snapshot, with the form its scope id was read in (TraceSnapshot.scopeIdForm); undefined when there is no such row. The record is read before the row and, while it names the plain form, after it: a re-file writes the record in the transaction that moves the rows, once, so when both reads find the plain form the row was read in it. A re-file that commits between them leaves the row read in either form, and the row is read again.

Parameters​

db​

SnapshotDb

brainId​

string

traceId​

string

Returns​

Promise<TraceSnapshot | undefined>

Throws​

When the brain's form changed under each of three reads of the row.