Interface: KernlStorage
Defined in: packages/kernl/src/storage/base.ts:14
The main storage interface for Kernl.
Provides access to system stores (threads, tasks, traces) and transaction support.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
memories | MemoryStore | Memory store - manages memory records for agents. | packages/kernl/src/storage/base.ts:23 |
threads | ThreadStore | Thread store - manages thread execution records and event history. | packages/kernl/src/storage/base.ts:18 |
Methods
bind()
bind(registries: {
agents: IAgentRegistry;
models: IModelRegistry;
}): void;Defined in: packages/kernl/src/storage/base.ts:33
Bind runtime registries to storage.
Called by Kernl after construction to wire up agent/model lookups.
Parameters
| Parameter | Type |
|---|---|
registries | { agents: IAgentRegistry; models: IModelRegistry; } |
registries.agents | IAgentRegistry |
registries.models | IModelRegistry |
Returns
void
close()
close(): Promise<void>;Defined in: packages/kernl/src/storage/base.ts:53
Close the storage backend and cleanup resources.
Returns
Promise<void>
init()
init(): Promise<void>;Defined in: packages/kernl/src/storage/base.ts:48
Initialize the storage backend.
Connects to the database and ensures all required schemas/tables exist.
Returns
Promise<void>
migrate()
migrate(): Promise<void>;Defined in: packages/kernl/src/storage/base.ts:58
Runs the migrations in order to ensure all required tables exist.
Returns
Promise<void>
transaction()
transaction<T>(fn: (tx: Transaction) => Promise<T>): Promise<T>;Defined in: packages/kernl/src/storage/base.ts:41
Execute a function within a transaction.
All operations performed using the transaction-scoped stores will be committed atomically or rolled back on error.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
fn | (tx: Transaction) => Promise<T> |
Returns
Promise<T>