Table of Contents

Interface IReranker

Namespace
Mythosia.AI.Rag
Assembly
Mythosia.AI.Rag.Abstractions.dll

Re-ranks retrieval results to improve relevance ordering. Applied after the initial retrieval strategy and before context building. The reranker only re-scores and reorders; topK trimming is the pipeline's responsibility.

public interface IReranker

Methods

RerankAsync(string, IReadOnlyList<VectorSearchResult>, CancellationToken)

Re-ranks the given search results based on their relevance to the query. Returns all results with updated scores, ordered by relevance (descending).

Task<IReadOnlyList<VectorSearchResult>> RerankAsync(string query, IReadOnlyList<VectorSearchResult> results, CancellationToken cancellationToken = default)

Parameters

query string

The original text query.

results IReadOnlyList<VectorSearchResult>

The initial retrieval results to re-rank.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<IReadOnlyList<VectorSearchResult>>

All results re-scored and ordered by relevance (descending).