Reranker VoyageAI
AI-generatedSummary
Supplies a VoyageAI reranker sub-node (AiReranker output) that downstream AI nodes, such as a vector store retriever, use to reorder retrieved documents by relevance to a query and keep the top K.
Inputs
- Model — VoyageAI rerank model: rerank-2.5 (default), rerank-2.5-lite, rerank-2, or rerank-2-lite. All have 32K context.
- Top K — Maximum number of documents returned after reranking (1–1000, default 3).
- Options > Truncate — Whether to truncate texts that exceed the model's context length (default true). If false, oversized inputs raise an error.
- Credentials (voyageAiApi) (required) — VoyageAI API key. An optional custom URL overrides the default https://api.voyageai.com/v1 base. HTTP(S) proxy environment variables are respected.
Output shape
A LangChain document compressor (reranker) object, not item data. When a connected node calls it with documents and a query, it returns the top K documents ordered by relevance. Each keeps its original pageContent, id and metadata, plus metadata.relevanceScore.
The node has no inputs and only connects to a node that accepts a Reranker input. The source says the AiReranker connection type doesn't currently work for community nodes, so it may not function until n8n lifts that restriction. Each rerank call is logged on the node's input and output panels. Errors are wrapped as NodeOperationError. Only document text is sent to VoyageAI. Returned documents are not requested from the API.
Examples
Example 1: Improve RAG answer quality by reranking vector store results before they reach an AI agent.
Model rerank-2.5, Top K 5, Truncate on. Connect to the Reranker input of a vector store retriever.
Example 2: Lower-latency reranking over long documents, failing loudly if any are too long.
Model rerank-2.5-lite, Top K 3, Options > Truncate set to false.