Member Junction
    Preparing search index...

    Interface AgentPreExecutionRAGParams

    Parameters for executing pre-execution RAG for an agent.

    interface AgentPreExecutionRAGParams {
        agent: MJAIAgentEntity;
        contextUser: UserInfo;
        conversationSummary?: string;
        lastUserMessage: string;
        payload?: unknown;
        primaryScopeEntityId?: string;
        primaryScopeRecordId?: string;
        recentMessages?: ChatMessage[];
        secondaryScopes?: Record<string, SecondaryScopeValue>;
        streamingEnabled?: boolean;
        streamingTrace?: string[];
    }
    Index

    Properties

    The agent currently being executed.

    contextUser: UserInfo

    Calling user — threaded through to SearchEngine + Metadata.

    conversationSummary?: string

    Optional conversation summary.

    lastUserMessage: string

    The most recent user message — used as the default query when no template is configured.

    payload?: unknown

    Agent's current payload state. Available to templates under payload.

    primaryScopeEntityId?: string

    Multi-tenant primary scope entity ID.

    primaryScopeRecordId?: string

    Multi-tenant primary scope record ID (flows into SearchContext.PrimaryScopeRecordID).

    recentMessages?: ChatMessage[]

    Optional recent messages (role + content) for template rendering.

    secondaryScopes?: Record<string, SecondaryScopeValue>

    Multi-tenant secondary scope dimensions.

    streamingEnabled?: boolean

    Phase 2C: when true, consume SearchEngine.streamSearch() instead of the synchronous Search() per scope. The final aggregate is identical — what changes is that intermediate provider traces are written to streamingTrace (when supplied) so the agent's pre-execution scratchpad can show "while you wait" progress. Default false.

    streamingTrace?: string[]

    Optional sink for streamingEnabled traces. Caller pushes nothing itself — the RAG hook appends one markdown line per provider event per scope. Caller decides what to do with the lines (typically concat into the agent's pre-prompt scratchpad).