Graphorin API reference v0.7.0
Graphorin API reference / @graphorin/sessions / facade / SessionMemoryFacade
Interface: SessionMemoryFacade
Defined in: packages/sessions/src/facade.ts:83
Subset of the Memory.session surface this package consumes. Kept structural so callers can pass either the Memory facade from @graphorin/memory or any custom shim with the same shape.
Stable
Methods
compact()?
optional compact(scope, opts?): Promise<{
removed: number;
summarized: number;
summary?: string;
}>;Defined in: packages/sessions/src/facade.ts:102
Parameters
| Parameter | Type |
|---|---|
scope | SessionScope |
opts? | { keepLastN?: number; } |
opts.keepLastN? | number |
Returns
Promise<{ removed: number; summarized: number; summary?: string; }>
flushImportant()?
optional flushImportant(scope, opts?): Promise<{
flushed: number;
}>;Defined in: packages/sessions/src/facade.ts:101
Parameters
| Parameter | Type |
|---|---|
scope | SessionScope |
opts? | { silent?: boolean; } |
opts.silent? | boolean |
Returns
Promise<{ flushed: number; }>
list()
list(scope, opts?): Promise<readonly Message[]>;Defined in: packages/sessions/src/facade.ts:85
Parameters
| Parameter | Type |
|---|---|
scope | SessionScope |
opts? | SessionListOptions |
Returns
Promise<readonly Message[]>
listWithMetadata()?
optional listWithMetadata(scope, opts?): Promise<readonly SessionMessageWithMetadata[]>;Defined in: packages/sessions/src/facade.ts:92
List messages with their persisted identity (RP-5): the stored message id, sequence, and createdAt. Optional - when absent, export falls back to fabricating those fields (the legacy behaviour). Implemented by @graphorin/memory.session over the store's real rows.
Parameters
| Parameter | Type |
|---|---|
scope | SessionScope |
opts? | SessionListOptions |
Returns
Promise<readonly SessionMessageWithMetadata[]>
push()
push(scope, message): Promise<MessageRef>;Defined in: packages/sessions/src/facade.ts:84
Parameters
| Parameter | Type |
|---|---|
scope | SessionScope |
message | Message |
Returns
Promise<MessageRef>
search()
search(
scope,
query,
opts?): Promise<readonly MemoryHit<MemoryRecord>[]>;Defined in: packages/sessions/src/facade.ts:96
Parameters
| Parameter | Type |
|---|---|
scope | SessionScope |
query | string |
opts? | { signal?: AbortSignal; topK?: number; } |
opts.signal? | AbortSignal |
opts.topK? | number |
Returns
Promise<readonly MemoryHit<MemoryRecord>[]>