Overview
This will help you getting started with the Watsonx document compressor. For detailed documentation of all Watsonx document compressor features and configurations head to the API reference.Integration details
| Class | Package | PY support | Downloads | Version |
|---|---|---|---|---|
WatsonxRerank | @langchain/community | ✅ |
Setup
To access IBM WatsonxAI models you’ll need to create an IBM watsonx.ai account, get an API key or any other type of credentials, and install the@langchain/community integration package.
Credentials
Head to IBM Cloud to sign up to IBM watsonx.ai and generate an API key or provide any other authentication form as presented below.IAM authentication
Bearer token authentication
IBM watsonx.ai software authentication
IAM authentication
Bearer token authentication
IBM watsonx.ai software authentication
Installation
This document compressor lives in the@langchain/community package:
Instantiation
Now we can instantiate our compressor:Usage
First, set up a basic RAG ingest pipeline with embeddings, a text splitter and a vector store. We’ll use this to and rerank some documents regarding the selected query:API reference
For detailed documentation of all Watsonx document compressor features and configurations head to the API reference.Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.