Graphorin API reference v0.7.0
Graphorin API reference / @graphorin/memory / / SemanticMemoryStoreExt
Interface: SemanticMemoryStoreExt
Defined in: packages/memory/src/internal/storage-adapter.ts:109
Extension of the typed SemanticMemoryStore with optional embedding-aware helpers + lifecycle helpers that storage adapters may expose.
Stable
Extends
Methods
count()?
optional count(scope): Promise<number>;Defined in: packages/memory/src/internal/storage-adapter.ts:158
Count the recall-eligible facts for the scope (CE-5) - a COUNT(*) with the default recall filters (live, non-archived, non-quarantined), never materialising rows. Powers honest metadata() counts.
Parameters
| Parameter | Type |
|---|---|
scope | SessionScope |
Returns
Promise<number>
forget()
forget(
id,
reason?,
scope?): Promise<void>;Defined in: packages/core/dist/contracts/memory-store.d.ts
Soft-delete a fact. W-154: when scope is supplied, adapters that support tenant isolation MUST treat a fact outside the scope as a deterministic no-op (0 rows changed) - defense in depth so a leaked / cross-user id reaching a mutator cannot touch another user's memory. Omitting scope preserves the historical unscoped behaviour (trusted internal callers: consolidator, erasure cascades). The parameter is additive - existing adapter implementations with the narrower arity remain structurally compatible.
Parameters
| Parameter | Type |
|---|---|
id | string |
reason? | string |
scope? | SessionScope |
Returns
Promise<void>
Inherited from
get()?
optional get(id): Promise<Fact | null>;Defined in: packages/memory/src/internal/storage-adapter.ts:138
Lookup a single fact by id (returns null when absent or soft-deleted).
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<Fact | null>
historyOf()?
optional historyOf(scope, factId): Promise<readonly Fact[]>;Defined in: packages/memory/src/internal/storage-adapter.ts:184
Walk the bi-temporal supersede chain that factId belongs to and return every fact in it, oldest → newest (by validFrom), including superseded / soft-deleted rows so callers can answer "how did this fact change over time". Scope-guarded and cycle-safe; returns [] for an unknown id. Powers SemanticMemory.history (P0-2). The default @graphorin/store-sqlite adapter implements it.
Parameters
| Parameter | Type |
|---|---|
scope | SessionScope |
factId | string |
Returns
Promise<readonly Fact[]>
linkPendingSupersede()?
optional linkPendingSupersede(newId, oldId): Promise<void>;Defined in: packages/memory/src/internal/storage-adapter.ts:174
W-019: record a PENDING supersede link - set newId.supersedes = oldId WITHOUT closing the old fact's validity interval. Used when a supersede's successor lands quarantined: the old fact must stay in default recall until the successor is validated, at which point SemanticMemory.validate completes the closure via SemanticMemoryStore.supersede. No schema change - the supersedes column already exists.
Parameters
| Parameter | Type |
|---|---|
newId | string |
oldId | string |
Returns
Promise<void>
purge()?
optional purge(
id,
reason?,
scope?): Promise<void>;Defined in: packages/memory/src/internal/storage-adapter.ts:164
Hard-delete a fact (GDPR path). The audit log row is preserved but the row itself + every per-embedder vec0 entry is removed. Distinct from SemanticMemoryStore.forget (soft-delete).
Parameters
| Parameter | Type |
|---|---|
id | string |
reason? | string |
scope? | SessionScope |
Returns
Promise<void>
remember()
remember(fact): Promise<void>;Defined in: packages/core/dist/contracts/memory-store.d.ts
Parameters
| Parameter | Type |
|---|---|
fact | Fact |
Returns
Promise<void>
Inherited from
rememberWithEmbedding()?
optional rememberWithEmbedding(fact, options): Promise<void>;Defined in: packages/memory/src/internal/storage-adapter.ts:110
Parameters
| Parameter | Type |
|---|---|
fact | Fact |
options | EmbeddedWriteOptions |
Returns
Promise<void>
search()
search(scope, opts): Promise<readonly MemoryHit<Fact>[]>;Defined in: packages/core/dist/contracts/memory-store.d.ts
Parameters
| Parameter | Type |
|---|---|
scope | SessionScope |
opts | MemorySearchOptions |
Returns
Promise<readonly MemoryHit<Fact>[]>
Inherited from
searchVector()?
optional searchVector(
scope,
embedding,
embedderId,
topK,
asOf?,
includeQuarantined?,
includeSuperseded?,
owner?): Promise<readonly MemoryHit<Fact>[]>;Defined in: packages/memory/src/internal/storage-adapter.ts:111
Parameters
| Parameter | Type | Description |
|---|---|---|
scope | SessionScope | - |
embedding | Float32Array | - |
embedderId | string | - |
topK | number | - |
asOf? | string | Point-in-time filter applied after KNN: only facts whose validity interval contains asOf (ISO-8601) survive. P0-2. |
includeQuarantined? | boolean | Include quarantined facts in the KNN result (validation / inspector path). Default reads exclude them. P1-4. |
includeSuperseded? | boolean | Include superseded / validity-expired facts. Default reads evaluate validity at NOW (memory-retrieval-01). |
owner? | | MemoryOwner | readonly MemoryOwner[] | Retrieval-time principal filter (D3). Rows with no stored owner are treated as 'user'. Absent ⇒ no owner filter. |
Returns
Promise<readonly MemoryHit<Fact>[]>
setStatus()?
optional setStatus(
factId,
status,
reason?,
scope?): Promise<void>;Defined in: packages/memory/src/internal/storage-adapter.ts:147
Set a fact's retrieval-trust status and write a memory_history audit row (P1-4). Promotes a quarantined fact to active (the validation path) or re-quarantines an active one. Never touches content / embedding / tombstone - quarantine is a retrieval gate. Powers SemanticMemory.validate; the default @graphorin/store-sqlite adapter implements it.
Parameters
| Parameter | Type |
|---|---|
factId | string |
status | MemoryStatus |
reason? | string |
scope? | SessionScope |
Returns
Promise<void>
supersede()
supersede(
oldId,
newFact,
reason?): Promise<void>;Defined in: packages/core/dist/contracts/memory-store.d.ts
Parameters
| Parameter | Type |
|---|---|
oldId | string |
newFact | Fact |
reason? | string |
Returns
Promise<void>