Overview
This guide will help you integrate and use the Mixedbread AI reranking API. The reranking API allows you to reorder a list of documents based on a given query, improving the relevance of search results or any ranked list.Installation
To get started, install the@langchain/mixedbread-ai package:
Authentication
Obtain your API key by signing up at Mixedbread AI. You can then set theMXBAI_API_KEY environment variable to your Mixedbread AI API key or pass it directly as the apiKey option when constructing the class.
Using Reranking
TheMixedbreadAIReranker class provides access to the reranking API. Here’s how to use it:
- Import the Class: First, import the
MixedbreadAIRerankerclass from the package.
- Instantiate the Class: Create an instance of
MixedbreadAIRerankerwith your API key.
- Rerank Documents: Use the
rerankDocumentsmethod to reorder documents based on a query.
Additional Resources
For more information, refer to the Reranking API documentation.Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.