Skip to main content

Overview

Contextual AI’s reranker is the first with instruction-following capabilities to handle conflicts in retrieval. It is the most accurate reranker in the world per industry-leading benchmarks like BEIR. To learn more about the reranker and its importance in RAG pipelines, please see our blog. This how-to guide uses the same example to demonstrate how to use the reranker with the Contextual API directly, our Python SDK, and our Langchain package. The current reranker models include:
  • ctxl-rerank-v2-instruct-multilingual
  • ctxl-rerank-v2-instruct-multilingual-mini
  • ctxl-rerank-v1-instruct

Global Variables & Examples

First, we will set up the global variables and examples we’ll use with each different implementation method.

REST API implementation

Python SDK

Langchain

Additional Resources