Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/memory / / SessionMemoryStoreExt

Interface: SessionMemoryStoreExt

Defined in: packages/memory/src/internal/storage-adapter.ts:103

Extension of the typed SessionMemoryStore with optional token-cache + vector-search + cursor-aware reader helpers that storage adapters may expose.

Stable

Extends

Methods

list()

ts
list(scope, opts?): Promise<readonly Message[]>;

Defined in: packages/core/dist/contracts/memory-store.d.ts:51

Parameters

ParameterType
scopeSessionScope
opts?SessionListOptions

Returns

Promise&lt;readonly Message[]&gt;

Inherited from

SessionMemoryStore.list


listMessagesSince()?

ts
optional listMessagesSince(
   scope, 
   lastMessageId, 
limit): Promise<readonly SessionMessageRecord[]>;

Defined in: packages/memory/src/internal/storage-adapter.ts:122

List messages for the supplied scope past the optional lastMessageId cursor, oldest-first, capped at limit. Used by the consolidator's standard phase to advance the per-scope idempotency cursor without rereading already-processed turns.

Parameters

ParameterType
scopeSessionScope
lastMessageIdstring | null
limitnumber

Returns

Promise&lt;readonly SessionMessageRecord[]&gt;


push()

ts
push(scope, message): Promise<MessageRef>;

Defined in: packages/core/dist/contracts/memory-store.d.ts:50

Parameters

ParameterType
scopeSessionScope
messageMessage

Returns

Promise&lt;MessageRef&gt;

Inherited from

SessionMemoryStore.push


ts
search(
   scope, 
   query, 
opts?): Promise<readonly MemoryHit<MemoryRecord>[]>;

Defined in: packages/core/dist/contracts/memory-store.d.ts:52

Parameters

ParameterType
scopeSessionScope
querystring
opts?MemorySearchOptions

Returns

Promise<readonly MemoryHit&lt;MemoryRecord&gt;[]>

Inherited from

SessionMemoryStore.search


searchVector()?

ts
optional searchVector(
   scope, 
   embedding, 
   embedderId, 
topK): Promise<readonly MemoryHit<MemoryRecord>[]>;

Defined in: packages/memory/src/internal/storage-adapter.ts:104

Parameters

ParameterType
scopeSessionScope
embeddingFloat32Array
embedderIdstring
topKnumber

Returns

Promise<readonly MemoryHit&lt;MemoryRecord&gt;[]>


totalCachedTokens()?

ts
optional totalCachedTokens(scope): Promise<number | null>;

Defined in: packages/memory/src/internal/storage-adapter.ts:115

Sum of session_messages.token_count for the supplied scope. Returns null when the cache is empty / partially populated so callers can fall back to a heuristic. Surfaced per DEC-131.

Parameters

ParameterType
scopeSessionScope

Returns

Promise&lt;number | null&gt;