Interface ILearnerSession

One session's view of the layer: what a GMI calls around its turns.

interface ILearnerSession {
    prepareTurn(input): Promise<TurnPreparation>;
    endSession(): Promise<void>;
    currentTraits(): Partial<Record<"honesty" | "emotionality" | "extraversion" | "agreeableness" | "conscientiousness" | "openness", number>>;
    scopesFor?(turn): TurnScopes;
    recordSelfChange?<T>(input, turn?): Promise<ProposalResult<T>>;
    guardMemoryWrite?<T>(input, turn?): Promise<{
        status: "written";
        result: T;
    } | {
        status: "rejected";
        reason: "forgotten" | "store_unavailable";
    }>;
    isFrozen?(turn?): boolean;
}

Methods

  • The traits the session renders.

    Returns Partial<Record<"honesty" | "emotionality" | "extraversion" | "agreeableness" | "conscientiousness" | "openness", number>>

  • The scope ids of a turn, by the session's rule, without counting the turn: the pipeline asks it for the standalone retriever and sink before the GMI prepares the turn, and a turn of another user or namespace latches the session's loss of its learner here as prepareTurn does.

    Parameters

    • turn: {
          userId: null | string;
          namespace: string;
          workflowSeat: boolean;
      }
      • userId: null | string
      • namespace: string
      • workflowSeat: boolean

    Returns TurnScopes

  • Runs a write of the user's memory inside the user's write chain, with the tombstone read before and after it. A store that cannot be read refuses the write (store_unavailable), so nothing is filed that a deletion could miss.

    Type Parameters

    • T

    Parameters

    Returns Promise<{
        status: "written";
        result: T;
    } | {
        status: "rejected";
        reason: "forgotten" | "store_unavailable";
    }>

  • Whether a freeze holds right now (AGENTOS_LEARNING_FREEZE=1, mode frozen, a run-time freeze) for the turn's scope: the learner's on a learner's turn, the agent's on a turn with none; without turn, the session's own.

    Parameters

    Returns boolean