actrone-memory
    Preparing search index...

    Interface Reranker

    Reorders retrieved memories by cross-encoder relevance to a query.

    interface Reranker {
        rerank(
            query: string,
            entries: readonly MemoryEntry[],
            topK?: number,
        ): Promise<MemoryEntry[]>;
    }
    Index
    • Return entries reordered by descending relevance to query. Implementations should rescore only the first topK (retrieval is assumed to have surfaced the strongest first) and append any remainder in place, so the result is a same-length permutation of the input.

      Parameters

      • query: string
      • entries: readonly MemoryEntry[]
      • OptionaltopK: number

      Returns Promise<MemoryEntry[]>