Member Junction
    Preparing search index...

    Parameters for retrieving notes in a specific context

    interface GetNotesParams {
        agentId: string;
        companyId?: string;
        contextUser: UserInfo;
        currentInput?: string;
        maxNotes: number;
        observability?: NotesObservabilityOptions;
        primaryScopeEntityId?: string;
        primaryScopeRecordId?: string;
        rerankerConfig?: RerankerConfiguration;
        secondaryScopeConfig?: SecondaryScopeConfig;
        secondaryScopes?: Record<string, SecondaryScopeValue>;
        SharedOnly?: boolean;
        strategy: "Relevant" | "Recent" | "All";
        userId?: string;
    }
    Index

    Properties

    agentId: string
    companyId?: string
    contextUser: UserInfo
    currentInput?: string
    maxNotes: number

    Optional observability context for tracing reranking operations.

    primaryScopeEntityId?: string

    Primary scope entity ID for multi-tenant filtering (FK to Entity table).

    primaryScopeRecordId?: string

    Primary scope record ID for multi-tenant filtering.

    rerankerConfig?: RerankerConfiguration

    Optional reranker configuration for two-stage retrieval.

    secondaryScopeConfig?: SecondaryScopeConfig

    Optional secondary scope configuration from the agent. Defines per-dimension inheritance modes and validation rules.

    secondaryScopes?: Record<string, SecondaryScopeValue>

    Arbitrary secondary scope dimensions for multi-tenant filtering.

    SharedOnly?: boolean

    Inject only shared notes — those with no UserID — whatever userId says. Set for a run with an audience (ExecuteAgentParams.Audience): a note scoped to one user is that user's memory and must not be shown to a room. Agent, company and multi-tenant scope matching still apply. Enforced by an explicit UserID == null filter on both the cache and the semantic path; an undefined userId does NOT mean "shared only" on the semantic path (AIEngine's base filter skips the user check when it is undefined).

    strategy: "Relevant" | "Recent" | "All"
    userId?: string