Takes a list of search results and a query, then re-ranks them using a cross-encoder model for improved precision. Use after a RAG Query or Web Search node to surface the most relevant results at the top.
rerankerStandard vector search and keyword search rank results by similarity scores that are computed independently for each document, without considering the relationship between the query and each result holistically. A cross-encoder reranker solves this by evaluating the query and each candidate result together, producing a more accurate relevance score.
The Reranker node accepts the output of any node that produces an array of results โ such as a RAG Query or Web Search node โ and returns the same results re-ordered by relevance score. You can optionally limit the output to the top N results, which is useful for controlling how much context you pass to a downstream Agent node.
The recommended pattern is: RAG Query โ Reranker โ Agent. The RAG Query retrieves a broad set of candidate chunks; the Reranker promotes the most relevant ones; the Agent receives a tighter, higher-quality context window.
| Field | Status | Description |
|---|---|---|
| Results | Required | Reference to a prior step's array of results, e.g. {{ rag_step.output.results }}. Each item must have a content or text field. |
| Query | Required | The search query used to rank results. Usually the same query passed to the preceding search step. |
| Provider | Required | The AI provider to use for reranking. Must support reranking models (e.g. Cohere, OpenAI). |
| Model | Required | The cross-encoder model identifier, e.g. rerank-english-v3.0. |
| Top K | Optional | Return only the top N results after reranking. Default: 5. Leave blank to return all items. |
The node returns the input results re-ordered by relevance, with a score field added to each item.
| Field | Type | Description |
|---|---|---|
results | array | Re-ranked array of result objects, each with the original fields plus a score property |
results[*].score | number | Relevance score (0โ1, higher is more relevant) |
results[*].content | string | The result text |
count | number | Number of results returned |
RAG โ Reranker โ Agent, ensuring the agent sees the most relevant chunks first.
20 to retrieve a broad candidate set. Use the step key rag_query.{{ rag_query.output.results }}, Query to the same query variable, Provider to Cohere, Model to rerank-english-v3.0, and Top K to 5.{{ reranker_step.output.results }} as the context. The agent now receives only the 5 most relevant chunks.content or text field. If your upstream step uses a different field name, use a Set Variable node to reshape the array first.