Skip to main content

Class: GMIManager

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:199

Manages the lifecycle of Generalized Mind Instances (GMIs).

Constructors​

Constructor​

new GMIManager(config, subscriptionService, authService, conversationManager, promptEngine, llmProviderManager, utilityAI, toolOrchestrator, retrievalAugmentor?, personaLoader?): GMIManager

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:242

Parameters​

config​

GMIManagerConfig

subscriptionService​

ISubscriptionService | undefined

authService​

IAuthService | undefined

conversationManager​

ConversationManager

promptEngine​

IPromptEngine

llmProviderManager​

AIModelProviderManager

utilityAI​

IUtilityAI

toolOrchestrator​

IToolOrchestrator

retrievalAugmentor?​

IRetrievalAugmentor

personaLoader?​

IPersonaLoader

Returns​

GMIManager

Properties​

activeGMIs​

activeGMIs: Map<string, IGMI>

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:205


gmiSessionMap​

gmiSessionMap: Map<string, string>

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:206


managerId​

readonly managerId: string

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:221

Methods​

cleanupInactiveGMIs()​

cleanupInactiveGMIs(inactivityThresholdMinutes?): Promise<number>

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:1273

Parameters​

inactivityThresholdMinutes?​

number

Returns​

Promise<number>


clearAgencyPersonaOverlay()​

clearAgencyPersonaOverlay(agencyId, roleId): void

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:305

Parameters​

agencyId​

string

roleId​

string

Returns​

void


createAgencySeat()​

createAgencySeat(spec): Promise<{ gmi: IGMI; personaId: string; release: Promise<void>; }>

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:1050

Builds and registers the GMI of one seat of a team a GMI launched (launch_agency on the full runtime): the registered persona a personaId seat names, checked as a session's persona is (strict validation, the user's tier), or the definition the launch made for a temporary seat. The GMI has no cognitive memory and no retrieval augmentor (its input is a manager's or a sibling's text), a prompt engine and a statistical utility that make no model call, the tool view and provider manager the launch gives it, and, with the runtime's learning layer, no learner (a workflow seat's source): it still renders its persona's traits, and with the layer off it sends no personality section. It is registered under the seat session id, so its own tool calls resolve it; release() shuts it down and takes it out of the manager, and a handle released after the manager shut down leaves alone whatever holds the session since. Until then the session is the seat's: getOrCreateGMIForSession() refuses it with PERMISSION_DENIED, whatever persona the request names (a request whose GMI was being built when the seat took the session included, that GMI shut down unregistered), processUserFeedback() records nothing for it and cleanupInactiveGMIs() passes it by. shutdown() waits for a seat being built, as it waits for a session's GMI, and the build then fails with its GMI shut down.

Parameters​

spec​

AgencySeatSpec

Returns​

Promise<{ gmi: IGMI; personaId: string; release: Promise<void>; }>

Throws​

PERSONA_NOT_FOUND for an unknown persona; PERMISSION_DENIED for one the user's tier or strict validation refuses; INVALID_STATE for a session that already has a GMI; CONFIGURATION_ERROR (SYS_CONFIGURATION_ERROR) without agencySeatPromptEngineConfig; NOT_INITIALIZED when the manager is not, or shuts down while the seat is built.

Throws​

GMI_INITIALIZATION_ERROR when the GMI does not initialize.


deactivateGMIForSession()​

deactivateGMIForSession(sessionId): Promise<boolean>

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:983

Parameters​

sessionId​

string

Returns​

Promise<boolean>


getAgencyPersonaOverlay()​

getAgencyPersonaOverlay(agencyId, roleId): PersonaStateOverlay | undefined

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:310

Parameters​

agencyId​

string

roleId​

string

Returns​

PersonaStateOverlay | undefined


getGMIByInstanceId()​

getGMIByInstanceId(gmiInstanceId): IGMI | undefined

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:978

Parameters​

gmiInstanceId​

string

Returns​

IGMI | undefined


getOrCreateGMIForSession()​

getOrCreateGMIForSession(userId, sessionId, requestedPersonaId, conversationIdInput?, preferredModelId?, preferredProviderId?, userApiKeys?, agencyOptions?, turnOrganizationId?): Promise<{ conversationContext: ConversationContext; gmi: IGMI; }>

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:769

The GMI of a session: the one the session has, or a new one built for it. A session that a seat of a team a GMI launched holds (createAgencySeat()) is refused with PERMISSION_DENIED until the seat is released.

Parameters​

userId​

string

sessionId​

string

requestedPersonaId​

string

conversationIdInput?​

string

preferredModelId?​

string

preferredProviderId?​

string

userApiKeys?​

Record<string, string>

agencyOptions?​

GMIAgencyContextOptions

turnOrganizationId?​

string

The resolved organization of the turn the GMI is acquired for ('' for none). With a learning layer a new GMI's learner session is bound under it; a caller that cannot resolve it before the GMI is acquired leaves it out, and the learner session is bound at the GMI's first prepared turn.

Returns​

Promise<{ conversationContext: ConversationContext; gmi: IGMI; }>


getPersonaDefinition()​

getPersonaDefinition(personaId): IPersonaDefinition | undefined

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:528

Parameters​

personaId​

string

Returns​

IPersonaDefinition | undefined


initialize()​

initialize(): Promise<void>

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:399

Returns​

Promise<void>


listAvailablePersonas()​

listAvailablePersonas(userId?): Promise<Partial<IPersonaDefinition>[]>

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:533

Parameters​

userId?​

string

Returns​

Promise<Partial<IPersonaDefinition>[]>


loadAllPersonaDefinitions()​

loadAllPersonaDefinitions(): Promise<void>

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:420

Returns​

Promise<void>


processUserFeedback()​

processUserFeedback(userId, sessionId, personaId, feedbackData): Promise<void>

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:1375

Routes user feedback to the GMI that serves the session; feedback that names the session of a seat of a launched team (createAgencySeat()) is not recorded. The payload is normalized first (see normalizeUserFeedback): a rating label decides the polarity, otherwise a numeric rating is read on the 1 to 5 scale. The GMI then records a trace entry and, when cognitive memory is configured, stores the feedback and any correction as memories of the user.

Parameters​

userId​

string

The user who sent the feedback.

sessionId​

string

The session the feedback refers to.

personaId​

string

The persona involved; used for logging only.

feedbackData​

any

Raw feedback, normally a UserFeedbackPayload.

Returns​

Promise<void>


shutdown()​

shutdown(): Promise<void>

Defined in: packages/agentos/src/cognition/substrate/GMIManager.ts:1327

Returns​

Promise<void>