Skip to main content

Interface: AttachedWiki

Defined in: packages/agentos/src/cognition/memory/io/facade/Memory.ts:123

What Memory.attachWiki takes: a page store per conversation scope, a compiler, and two optional hooks.

Properties​

compiler​

compiler: object

Defined in: packages/agentos/src/cognition/memory/io/facade/Memory.ts:126

compile()​

compile(input): Promise<WikiCompileResult>

Parameters​
input​
reason​

"explicit" | "consolidation" | "session-end"

store​

WikiCompilerStorePort

The store of the scope the traces are of: the compile reads and writes its pages there.

traces​

MemoryTrace[]

Returns​

Promise<WikiCompileResult>

Methods​

beforeScopeCompile()?​

optional beforeScopeCompile(scopeId, traces): Promise<{ traces: MemoryTrace[]; } | { skip: "policy_raw" | "screen_failed" | "forgotten"; }>

Defined in: packages/agentos/src/cognition/memory/io/facade/Memory.ts:138

Asked once a batch of a scope's traces, before the compiler: the traces to compile, or why this scope's compile does not run. A skipped scope keeps its watermark.

Parameters​

scopeId​

string

traces​

MemoryTrace[]

Returns​

Promise<{ traces: MemoryTrace[]; } | { skip: "policy_raw" | "screen_failed" | "forgotten"; }>


compileSkipReasonOf()?​

optional compileSkipReasonOf(error): "budget" | undefined

Defined in: packages/agentos/src/cognition/memory/io/facade/Memory.ts:151

The reason to log for an error a scope's compile threw: 'budget' for a spend budget's refusal. Undefined: the error is the call's, thrown once every scope has run.

Parameters​

error​

unknown

Returns​

"budget" | undefined


runScope()?​

optional runScope<T>(scopeId, work): Promise<T>

Defined in: packages/agentos/src/cognition/memory/io/facade/Memory.ts:146

Runs one scope's compile: a host that orders each subject's writes, compiles and deletion one after another passes it, and runs work in the subject's turn. Unset: the compile runs at once.

Type Parameters​

T​

T

Parameters​

scopeId​

string

work​

() => Promise<T>

Returns​

Promise<T>


storeFor()​

storeFor(scopeId): WikiCompilerStorePort

Defined in: packages/agentos/src/cognition/memory/io/facade/Memory.ts:125

The page store of one conversation scope: a user's or a session's key.

Parameters​

scopeId​

string

Returns​

WikiCompilerStorePort