# Reranker Node

### Overview

The Reranker Node optimizes document retrieval by reordering a set of documents based on their relevance to a specific query. It uses specialized reranking models to improve the accuracy and relevance of search results by considering semantic similarity and contextual information.

Usage cost: 1 credit

### Configuration

#### Settings

1. **Model Selection**
   * Reranker Model\*: Select the reranking model to use
   * Top K: Number of documents to return after reranking (default: 3)
   * Query\*: The search query used to rerank documents
   * Documents\*: List of documents to be reranked

#### Output Ports

* `reranked_documents` (Document\[]): Array of reranked documents ordered by relevance

### Best Practices

1. **Document Preparation**
   * Keep document segments concise and focused
   * Ensure documents contain meaningful content
   * Remove duplicate or near-duplicate content
2. **Query Optimization**
   * Use specific, targeted queries
   * Include key terms and concepts
   * Consider query expansion when needed
   * Use consistent query formatting
3. **Performance Tuning**
   * Adjust Top K based on use case requirements
   * Consider document batch size
4. **Integration Tips**
   * Place after retrieval nodes
   * Connect to document transformation nodes when needed


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.waterflai.ai/studio/studio-builders/flow-components-nodes/reranker-node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
