reranker-voyageai
v1.24.7
Introduction
- The
reranker-voyage
module enables reranking search results using a Voyage AI reranker API. - This module uses a third-party API and may incur costs. Make sure to check the pricing page before applying reranking to large amounts of data.
- You will need a Voyage AI API key. You can request one here.
How to enable
Weaviate Cloud
This module is enabled by default in WCD.
Weaviate open source
Add reranker-voyageai
to the ENABLE_MODULES
environment variable.
Below is an example Docker Compose file, which will spin up Weaviate with the reranker-voyageai
module (as well as text2vec-voyageai
).
---
version: '3.4'
services:
weaviate:
command:
- --host
- 0.0.0.0
- --port
- '8080'
- --scheme
- http
image: cr.weaviate.io/semitechnologies/weaviate:1.25.9
restart: on-failure:0
ports:
- 8080:8080
- 50051:50051
environment:
QUERY_DEFAULTS_LIMIT: 20
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
PERSISTENCE_DATA_PATH: "./data"
DEFAULT_VECTORIZER_MODULE: text2vec-voyageai
ENABLE_MODULES: text2vec-voyageai,reranker-voyageai
VOYAGEAI_APIKEY: sk-foobar # Setting this parameter is optional, you can also provide the API key at query time.
CLUSTER_HOSTNAME: 'node1'
...
- You can also use the Weaviate configuration tool to create a Weaviate setup with this module.
- The
VOYAGE_APIKEY
environment variable is optional and the client can instead provide the key at insert/query time as an HTTP header (see the 'usage' section for instructions)
Schema configuration
The reranker-voyageai
module can be configured for any collection in the schema. You can also specify options such as the model
to use.
Parameters
Parameter | Required | Default | Purpose |
---|---|---|---|
model | No | rerank-lite-1 | The model to use. |
baseURL | No | https://api.voyageai.com/v1 | Sets a proxy or other URL instead of the default URL. Use a the protocol domain format: https://your.domain.com . |
This example configures the Document
collection to use the reranker-voyageai
module, with the rerank-lite-1
model, and to return the documents in the response.
{
"classes": [
{
"class": "Document",
...,
"moduleConfig": {
"reranker-voyageai": {
"model": "rerank-lite-1",
},
}
}
]
}
Reranker selection
If there is only one reranker
module enabled, you don't need to do anything. The reranker
module will be used by default.
Where multiple reranker
modules are enabled, you must specify the reranker module to be used for each collection. You can do this by adding the desired reranker in the moduleConfig
section of the schema, even without any further settings.
Set reranker for a collection
{
"classes": [
{
"class": "Document",
...,
"moduleConfig": {
"reranker-voyageai": {}, // This will configure the 'Document' collection to use the 'reranker-voyageai' module
}
}
]
}
Model selection
The reranker-voyageai
module supports the following models:
rerank-lite-1
rerank-1
Usage
Query-time parameters
You can supply parameters at query time by adding it to the HTTP header.
HTTP Header | Value | Purpose | Note |
---|---|---|---|
"X-VoyageAI-Api-Key" | "YOUR-VOYAGEAI-API-KEY" | Voyage AI API key | |
"X-VoyageAI-BaseURL" | "YOUR-VOYAGEAI-BASE-URL" | Voyage AI base URL | Use the protocol domain format: https://your.domain.com . If specified, this will have precedence over the class-level setting. |
Queries
- Using this module will enable the
rerank
GraphQL _additional property. - For usage examples, see the Howto: Search - Reranking page.
Questions and feedback
If you have any questions or feedback, let us know in the user forum.