text: Skip to main contentğŸ¦œï¸�ğŸ”— LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKIntegrationsCallbacksChat modelsDocument loadersDocument transformersLLMsMemoryRetrieversAmazon KendraArxivAzure Cognitive SearchBM25ChaindeskChatGPT PluginCohere RerankerDocArray RetrieverElasticSearch BM25Google Cloud Enterprise SearchkNNLOTR (Merger Retriever)MetalPinecone Hybrid SearchPubMedSVMTF-IDFVespaWeaviate Hybrid SearchWikipediaZepText embedding modelsAgent toolkitsToolsVector storesGrouped by providerIntegrationsRetrieversCohere RerankerOn this pageCohere RerankerCohere is a Canadian startup that provides natural language processing models that help companies improve human-machine interactions.This notebook shows how to use Cohere's rerank endpoint in a retriever. This builds on top of ideas in the ContextualCompressionRetriever.#!pip install cohere#!pip install faiss# OR  (depending on Python version)#!pip install faiss-cpu# get a new token: https://dashboard.cohere.ai/import osimport getpassos.environ["COHERE_API_KEY"] = getpass.getpass("Cohere API Key:")os.environ["OPENAI_API_KEY"] = getpass.getpass("OpenAI API Key:")# Helper function for printing docsdef pretty_print_docs(docs):    print(        f"\n{'-' * 100}\n".join(            [f"Document {i+1}:\n\n" + d.page_content for i, d in enumerate(docs)]        )    )Set up the base vector store retrieverâ€‹Let's start by initializing a simple vector store retriever