Graphorin API reference v0.1.0
Graphorin API reference / @graphorin/memory / / SharedMemory
Class: SharedMemory
Defined in: packages/memory/src/tiers/shared-memory.ts:13
SharedMemory — many-to-many attach mode for blocks / facts / rules across multiple agents. Storage adapters represent attachments as a join table (shared_attachments in @graphorin/store-sqlite).
Stable
Constructors
Constructor
new SharedMemory(args): SharedMemory;Defined in: packages/memory/src/tiers/shared-memory.ts:17
Parameters
| Parameter | Type |
|---|---|
args | { store: MemoryStoreAdapter; tracer: Tracer; } |
args.store | MemoryStoreAdapter |
args.tracer | Tracer |
Returns
SharedMemory
Methods
attach()
attach(
recordId,
agentId,
userId): Promise<void>;Defined in: packages/memory/src/tiers/shared-memory.ts:23
Attach recordId to agentId. Idempotent.
Parameters
| Parameter | Type |
|---|---|
recordId | string |
agentId | string |
userId | string |
Returns
Promise<void>
detach()
detach(
recordId,
agentId,
userId): Promise<void>;Defined in: packages/memory/src/tiers/shared-memory.ts:36
Detach recordId from agentId. Idempotent.
Parameters
| Parameter | Type |
|---|---|
recordId | string |
agentId | string |
userId | string |
Returns
Promise<void>
listFor()
listFor(agentId, userId): Promise<readonly MemoryRecord[]>;Defined in: packages/memory/src/tiers/shared-memory.ts:49
List every attachment for agentId.
Parameters
| Parameter | Type |
|---|---|
agentId | string |
userId | string |
Returns
Promise<readonly MemoryRecord[]>