Skip to main content

Function: openForgottenCopy()

openForgottenCopy(filePath): Promise<{ adapter: StorageAdapter; existed: boolean; }>

Defined in: packages/agentos/src/cognition/memory/suppression/forgottenCopy.ts:22

Opens the SQLite file that holds the tombstone copy, made when missing, with secure_delete on. The file keeps SQLite's default rollback journal, so a closed copy is one file. existed tells whether the file was there before.

The caller closes the adapter.

Parameters​

filePath​

string

Returns​

Promise<{ adapter: StorageAdapter; existed: boolean; }>

Throws​

When the file is there and is not a SQLite database; no handle is left open.

Example​

const { adapter: copy } = await openForgottenCopy('./memory/.store/forgotten.sqlite');
const ledger = await ForgottenLedger.open({ primary: storeAdapter, copy });