Interface IReranker
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
querystringThe original text query.
resultsIReadOnlyList<VectorSearchResult>The initial retrieval results to re-rank.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<IReadOnlyList<VectorSearchResult>>
All results re-scored and ordered by relevance (descending).