Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 1.94 KB

File metadata and controls

32 lines (26 loc) · 1.94 KB
title slug hidden description image keywords createdAt updatedAt
Cohere and LangChain (Integration Guide)
docs/cohere-and-langchain
false
Integrate Cohere with LangChain for advanced chat features, RAG, embeddings, and reranking; this guide includes code examples for each feature.
../../assets/images/51c6a07-cohere_meta_image.jpg
LangChain, Cohere integrations, Retrieval Augmented Generation
Tue Jan 16 2024 11:00:05 GMT+0000 (Coordinated Universal Time)
Tue May 28 2024 16:56:01 GMT+0000 (Coordinated Universal Time)

Cohere has first class support for LangChain, a framework which enables you to quickly create LLM powered applications. This doc will guide you through how to leverage different Cohere features with LangChain.

Prerequisite

To use LangChain and Cohere you will need:

  • LangChain and Cohere Packages. To install, run:
    • pip install langchain-cohere (to use the Cohere integrations in LangChain)
    • Optional: pip install langchain-community (to access third-party integrations such as web search APIs)
  • Cohere's SDK. To install it, run pip install cohere. If you run into any issues or want more details on Cohere's SDK, see this wiki.
  • A Cohere API Key. For more details on pricing see this page. When you create an account with Cohere, we automatically create a trial API key for you. This key will be available on the dashboard where you can copy it, and it's in the dashboard section called "API Keys" as well.

Integrating LangChain with Cohere Models

The following guides contain technical details on the many ways in which Cohere and LangChain can be used in tandem: