Reranker

Cohere Reranker

CohereReranker reorders retrieved documents by relevance using Cohere rerank models.

CohereReranker reorders retrieved documents by relevance to the query using Cohere's rerank models. Pass it to the reranker parameter of Knowledge. See Reranking.

ParameterTypeDefaultDescription
modelstr"rerank-multilingual-v3.0"The Cohere model to use for reranking.
api_keyOptional[str]NoneThe Cohere API key. If not provided, will attempt to use environment variables.
cohere_clientOptional[CohereClient]NoneAn optional pre-configured Cohere client instance.
top_nOptional[int]NoneThe maximum number of documents to return after reranking. If None, returns all documents.
candidate_multiplierint3Candidates Knowledge fetches per requested result when this reranker is set on Knowledge.
max_candidatesint100Ceiling on the candidate fetch. It never reduces the fetch below max_results.