Cohere Rerank on LangChain (Integration Guide)
Cohere supports various integrations with LangChain, a large language model (LLM) framework which allows you to quickly create applications based on Cohereโs models. This doc will guide you through how to leverage Rerank with LangChain.
Prerequisites
Running Cohere Rerank with LangChain doesnโt require many prerequisites, consult the top-level document for more information.
Cohere ReRank with LangChain
To use Cohereโs rerank functionality with LangChain, start with instantiating a CohereRerank object as follows: cohere_rerank = CohereRerank(cohere_api_key="{API_KEY}")
.
You can then use it with LangChain retrievers, embeddings, and RAG. The example below uses the vector DB chroma, for which you will need to install pip install chromadb
. Other vector DBโs from this list can also be used.
Using LangChain on Private Deployments
You can use LangChain with privately deployed Cohere models. To use it, specify your model deployment URL in the base_url
parameter.