Skip to main content

reranker-voyageai

Added in 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 Services

This module is enabled by default on the WCS.

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.24.10
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'
...
note

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

ParameterRequiredDefaultPurpose
modelNorerank-lite-1The model to use.
baseURLNohttps://api.voyageai.com/v1Sets 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

Usage

Query-time parameters

You can supply parameters at query time by adding it to the HTTP header.

HTTP HeaderValuePurposeNote
"X-VoyageAI-Api-Key""YOUR-VOYAGEAI-API-KEY"Voyage AI API key
"X-VoyageAI-BaseURL""YOUR-VOYAGEAI-BASE-URL"Voyage AI base URLUse the protocol domain format: https://your.domain.com.

If specified, this will have precedence over the class-level setting.

Queries

Questions and feedback

If you have any questions or feedback, let us know in our user forum.