skillfed

langchain-cohere

An integration package connecting Cohere and LangChain

langchain-cohere v0.6.0 960.3K downloads/30d#4,635 on PyPI50
Permissive license MIT Active released

What it is and what it does

langchain-cohere is a bridge package that exposes Cohere's language models and retrieval tools through LangChain's standard interfaces. It provides four main capabilities: a chat interface for building conversational applications, text embeddings for semantic search, a retrieval-augmented generation (RAG) retriever for connecting to external data sources, and a reranking tool for sorting results by relevance. The package also includes a ReAct agent for multi-step reasoning with tool use.

The package was migrated from langchain-community starting at version 0.0.30, consolidating Cohere integrations into a dedicated namespace. It requires Python 3.10 or later and depends on cohere (the Cohere Python SDK), langchain-core (LangChain's base abstractions), pydantic (for data validation), and types-pyyaml (type hints). You authenticate by setting a COHERE_API_KEY environment variable before instantiating any Cohere component.

Use it for:

  • Build chatbots and conversational agents using Cohere's chat models through LangChain's message interface.
  • Embed documents and queries into vector space for semantic search and similarity matching.
  • Implement retrieval-augmented generation pipelines that fetch and rank external documents before generating responses.
  • Rerank search or retrieval results by relevance without building a full RAG pipeline.
  • Create multi-step reasoning agents that use tools and external data sources to answer complex questions.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Connects LangChain applications to Cohere's language models, providing chat, text embedding, retrieval-augmented generation, and reranking capabilities through a unified integration layer.

Yes. The package is actively maintained, has no known vulnerabilities, and low installation friction. Install it if you are building LangChain applications that need Cohere's models or embeddings. The MIT license poses no restrictions. Verify that your environment can set the COHERE_API_KEY before deploying.

Install

langchain-cohere on PyPI

pip

pip install langchain-cohere

uv

uv add langchain-cohere

poetry

poetry add langchain-cohere

Installing langchain-cohere

Before you install

Low friction installation with a pure Python wheel. The package is actively maintained with a recent release and no known vulnerabilities. Four runtime dependencies (cohere, langchain-core, pydantic, types-pyyaml) are all standard ecosystem packages.

License in practice

MIT license permits commercial and private use with minimal restrictions. You may use, modify, and distribute this package freely provided you retain the license notice.

Quickstart

pip install langchain-cohere

from langchain_cohere import ChatCohere
from langchain_core.messages import HumanMessage

llm = ChatCohere()
messages = [HumanMessage(content="Hello, can you introduce yourself?")]
print(llm.invoke(messages))

Requires a Cohere API key set as the COHERE_API_KEY environment variable; Python 3.10 or later.

Verify before relying

  • Whether Cohere SDK v5+ is automatically installed or must be managed separately in your environment.
  • Performance characteristics and rate limits when used with large document sets or high-volume embedding requests.

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — cohere, langchain-core, pydantic, types-pyyaml
Maintenance actively maintained — 74 days since the last release
Last repo commit
First released
Downloads 960,330/month — #4,635 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: langchain_cohere-0.6.0-py3-none-any.whl

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12

Tags

langchain cohere integrationcohere llm chat modelscohere embeddings langchainrag retriever coherecohere rerank document relevancelangchain ai integrationcohere api wrapper
langchain-integrationllm-api-wrapperembeddings-rag

More Artificial Intelligence packages