Interface LearningLayerOptions

What a layer is built from: the host's learning config, and what the host says about itself.

interface LearningLayerOptions {
    profile?: LearningProfile;
    surface?: "gmi" | "custom" | "runtime";
    hostLoops?: Partial<Record<"memory" | "hitl" | "memory_mechanisms" | "memory_observer_reflector" | "memory_store" | "sentiment" | "metaprompts" | "emergent_tools" | "self_improvement_tools" | "forged_code_executor" | "tool_policy" | "rag", LoopState>>;
    memory?: ICognitiveMemoryManager;
    storageAdapter?: StorageAdapter;
    openStore?: (() => Promise<LearningStore>);
    memoryFacades?: LearningMemoryTools[];
    mode?: LearningMode;
    agentKey?: string;
    namespace?: string;
    anonymousUserIds?: string[];
    traits?: boolean;
    lessons?: boolean;
    skills?: boolean;
    store?: LearningStore;
    ledgerKey?: string;
    clock?: (() => number);
    memoryTools?: LearningMemoryTools;
}

Hierarchy (view full)

Properties

profile?: LearningProfile

The host's cognition profile, which sets the switches the config leaves unset. Default 'custom'.

surface?: "gmi" | "custom" | "runtime"

The host that builds the layer. Default 'custom': a product that calls the layer around its own turn loop.

hostLoops?: Partial<Record<"memory" | "hitl" | "memory_mechanisms" | "memory_observer_reflector" | "memory_store" | "sentiment" | "metaprompts" | "emergent_tools" | "self_improvement_tools" | "forged_code_executor" | "tool_policy" | "rag", LoopState>>

What the host's own configuration says about the loops it runs, for the manifest.

A memory manager the host built itself (a product that runs its own turn loop): re-filed once, and kept by the layer.

storageAdapter?: StorageAdapter

The host's storage adapter: the learning store is SQL over it when store is unset and it has transactions.

openStore?: (() => Promise<LearningStore>)

Opens the learning store on first use (gmi(): over the adapter of the Brain memory.store opens). A throw leaves the layer degraded until a later call opens it.

Type declaration

memoryFacades?: LearningMemoryTools[]

Memory-tools facades beside memoryTools (the full runtime's second one): each is re-filed once and kept by its brain id.

Default 'on'.

agentKey?: string

Names the agent its learners belong to. Unset: the id of the registered persona, or of a named gmi() agent.

namespace?: string

The organization of a gmi() agent's learners, fixed for the agent. The full runtime takes each turn's resolved organization and refuses this field.

anonymousUserIds?: string[]

User ids that never name a learner, added to DEFAULT_ANONYMOUS_USER_IDS.

traits?: boolean

Asks for trait changes. Default: asked for in the full profile. The manifest says whether the loop runs.

lessons?: boolean

Asks for lessons. Default: asked for in the full profile. The manifest says whether the loop runs.

skills?: boolean

Asks for the skill library. Default: asked for in the full profile. The manifest says whether the loop runs.

Where learned state lives. Default: SQL over the host's storage adapter, else the process.

ledgerKey?: string

Keys every ledger hash (HMAC-SHA-256), so a writer of the store that cannot read it cannot recompute the chain. A secret the store never holds; without it the manifest says ledger: unkeyed.

clock?: (() => number)

Milliseconds since the epoch; the ledger's and the trait row's clock. Default Date.now.

Type declaration

    • (): number
    • Returns number

memoryTools?: LearningMemoryTools

The Memory facade the host's memory tools (and, on the full runtime, its standalone retriever and sink) are built over: forgetUser deletes the user's scopes in its Brain and revert undoes a memory tool's write there. The full runtime fills it; gmi() and a host that registers the tools itself pass it.