Interface LongTermMemoryRetrievalInput

interface LongTermMemoryRetrievalInput {
    userId: string;
    organizationId?: string;
    conversationId: string;
    personaId: string;
    mode: string;
    queryText: string;
    memoryPolicy: ResolvedLongTermMemoryPolicy;
    retrievalPolicy?: MemoryRetrievalPolicy;
    maxContextChars?: number;
    topKByScope?: Partial<Record<"user" | "persona" | "organization", number>>;
    turnScopes?: TurnScopes;
}

Properties

userId: string
organizationId?: string
conversationId: string
personaId: string
mode: string
queryText: string
retrievalPolicy?: MemoryRetrievalPolicy
maxContextChars?: number

Advisory character budget for the returned context string. Implementations may truncate to stay within this budget.

topKByScope?: Partial<Record<"user" | "persona" | "organization", number>>

Optional per-scope retrieval caps. Implementations are free to ignore/override.

turnScopes?: TurnScopes

With a learning layer: the turn's scope ids, from the GMI's learner session. A retriever reads the user, persona and conversation scopes under them (a learner's, or the session's own form on a turn with no learner); without them it reads under the plain ids, as with no layer.