Skip to content
masterclass Buddy

Integrations · Class

CohereRerank

CohereRerank uses Cohere's rerank API to order documents for a query. It can also return only the highest-ranked documents as LangChain Document objects.

Last updated

Since
v0.1

Syntax

new CohereRerank({ apiKey, model, topN })
await cohereRerank.rerank(docs, query, { topN })
await cohereRerank.compressDocuments(docs, query)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • CohereClient
  • Document
  • BaseDocumentCompressor
  • compressDocuments
  • rerank
  • relevanceScore

Source: Cohere rerank integration - Docs by LangChain. Checked 2026-11-03.