Member Junction
    Preparing search index...

    Cohere rerank-v3.5 re-ranker for SearchEngine. Configured per scope via SearchScope.ScopeConfig.reRanker.driverClass = 'CohereReRanker'.

    The model name can be overridden via ScopeConfig.reRanker.config.model (e.g. 'rerank-multilingual-v3.0').

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    CostReporter: ReRankerCostReporter = null

    Optional cost reporter. When set, the reranker invokes it after each successful Rerank call with the actual cents charged. The SearchEngine wires this from the RerankerBudgetGuard to the scope-level spend tracker — see Phase 2D.6.

    Accessors

    • get DriverClass(): string

      The DriverClass key used by @RegisterClass(BaseReRanker, 'DriverClassName') so the SearchEngine can resolve this subclass via ClassFactory from the scope's ScopeConfig.reRanker.driverClass value.

      Returns string

    • get Name(): string

      Human-friendly display name. Defaults to DriverClass so subclasses don't have to override unless they want a different label in UI dropdowns / cost reports.

      Returns string

    • get Version(): string

      Reranker semantic version (independent of the package version). Bump this on a subclass when the prompt, scoring formula, or upstream model identifier changes in a way that invalidates cached scores. Defaults to '1'.

      Returns string

    Methods

    • Cohere bills per "search". 1 search reranks up to 100 documents; above 100, count as ceil(N/100) searches. As of 2026-04, $2.00 per 1k searches = 0.2¢ per search. Override via config.cents_per_search if Cohere's pricing changes.

      Parameters

      • resultCount: number

      Returns number

    • Return the underlying @memberjunction/ai BaseReranker instance to use.

      Provider-specific subclasses (Cohere, BGE, Voyage) override this to return a configured AI reranker. Returning null (the default) tells ReRank() to skip the AI layer and fall back to a simple top-N slice — useful for Noop and test implementations.

      Parameters

      • config: Record<string, unknown>

        Provider-specific config from ScopeConfig.reRanker.config.

      • _contextUser: UserInfo

        The calling user (for auth / tenant propagation).

      Returns BaseReranker

    • Enumerate every reranker currently registered with ClassFactory under BaseReRanker. Designed for the SearchScope form's reranker dropdown (P2D.7) — the form populates the dropdown from this single call rather than hardcoding a list, so any ClassFactory-registered reranker (including third-party ones published as separate packages) shows up automatically.

      Each entry includes the driver-class registration key, the friendly Name, Version, and a HasCost flag (true when EstimateCostCents(1) > 0). Sorted by Name for stable UI ordering.

      Returns RegisteredReRankerInfo[]