Interface GMIBaseConfig

Base configuration required to initialize a GMI instance.

Interface

GMIBaseConfig

interface GMIBaseConfig {
    workingMemory: IWorkingMemory;
    promptEngine: IPromptEngine;
    llmProviderManager: AIModelProviderManager;
    utilityAI: IUtilityAI;
    toolOrchestrator: IToolOrchestrator;
    retrievalAugmentor?: IRetrievalAugmentor;
    cognitiveMemory?: ICognitiveMemoryManager;
    defaultLlmProviderId?: string;
    defaultLlmModelId?: string;
    maxToolLoopIterations?: number;
    defaultReasoningTraceMaxEntries?: number;
    defaultReasoningTraceMaxMessageLength?: number;
    customSettings?: Record<string, any>;
    completionGateway?: CompletionGateway;
    beforeModelCall?: ((context) => void | ChatMessage[] | Promise<void | ChatMessage[]>);
    shutdownTimeoutMs?: number;
    learning?: ILearnerSession;
    personaTraits?: {
        authored: Partial<Record<"honesty" | "emotionality" | "extraversion" | "agreeableness" | "conscientiousness" | "openness", number>>;
        overlay?: Partial<Record<"honesty" | "emotionality" | "extraversion" | "agreeableness" | "conscientiousness" | "openness", number>>;
    };
}

Properties

workingMemory: IWorkingMemory
promptEngine: IPromptEngine
llmProviderManager: AIModelProviderManager
utilityAI: IUtilityAI
toolOrchestrator: IToolOrchestrator
retrievalAugmentor?: IRetrievalAugmentor
cognitiveMemory?: ICognitiveMemoryManager

Cognitive memory system (personality-affected encoding/retrieval with Ebbinghaus decay).

defaultLlmProviderId?: string
defaultLlmModelId?: string
maxToolLoopIterations?: number

Maximum number of tool-loop iterations before the safety break engages. Prevents runaway tool loops in processTurnStream(). Defaults to 5.

defaultReasoningTraceMaxEntries?: number

Runtime default for the reasoning trace's entry cap when the persona sets no reasoningTraceConfig.maxEntries. Defaults to 500.

defaultReasoningTraceMaxMessageLength?: number

Runtime default for the characters kept per trace message. Defaults to 1000.

customSettings?: Record<string, any>
completionGateway?: CompletionGateway

One model layer for the turn. When set, the GMI resolves the hop through it before it builds the prompt, streams through it, and moves to the next hop when an attempt fails before any output with a retryable error. llmProviderManager is then a GatewayProviderManager (see src/api/runtime/gatewayProviderManager.ts).

beforeModelCall?: ((context) => void | ChatMessage[] | Promise<void | ChatMessage[]>)

Called for every model attempt after its prompt is built and before it is sent, a fallback hop's rebuilt prompt included. Messages it returns replace that attempt's prompt and do not enter the history; a hook that throws or returns an empty list is recorded on the reasoning trace and the built prompt is sent. agent({ runtime: 'gmi' }) routes onBeforeGeneration here.

Type declaration

    • (context): void | ChatMessage[] | Promise<void | ChatMessage[]>
    • Parameters

      Returns void | ChatMessage[] | Promise<void | ChatMessage[]>

shutdownTimeoutMs?: number

How long shutdown() waits, in milliseconds, for the turns it stopped to end before it closes the GMI's memories anyway. Defaults to 8000. GMIManager passes its own shutdownTimeoutMs.

learning?: ILearnerSession

The session's learner session, passed by a host whose learning option is on. The GMI asks it once per user turn, before the tool loop, for the personality section (a system prompt at priority 2, after the persona's base prompt) and tells each tool call the turn's learner and mode (sessionData.learning). A session that fails or does not answer within 2,000 ms never fails the turn. The host that passes the session ends it.

personaTraits?: {
    authored: Partial<Record<"honesty" | "emotionality" | "extraversion" | "agreeableness" | "conscientiousness" | "openness", number>>;
    overlay?: Partial<Record<"honesty" | "emotionality" | "extraversion" | "agreeableness" | "conscientiousness" | "openness", number>>;
}

The persona's traits as the GMI renders them itself, when it has no learner session or the session did not answer: authored is the registry persona's traits and overlay a workflow role overlay's patch. They are read once, at initialize(), never from the persona copy setPersonalityTrait() replaces. Honesty-humility and emotionality always come from authored; an overlay that names either is not applied to it, and the trace says so. Without this field the GMI renders no personality section of its own.

Type declaration

  • authored: Partial<Record<"honesty" | "emotionality" | "extraversion" | "agreeableness" | "conscientiousness" | "openness", number>>
  • Optional overlay?: Partial<Record<"honesty" | "emotionality" | "extraversion" | "agreeableness" | "conscientiousness" | "openness", number>>