Rerank
Category: RAG
Node id: rerank
Reranks retrieved results using cross-encoder, BM25, semantic, or hybrid methods
What it does
- Cross-encoder reranking for high-accuracy relevance scoring
- BM25 term-frequency-based reranking
- Semantic similarity reranking
- Hybrid reranking combining multiple methods
- Original rank tracking and comparison
- Configurable top-K result limiting
Use cases
- Improving RAG retrieval quality by reranking initial results
- Combining dense and sparse retrieval signals for hybrid search
- Filtering and reordering search results by query relevance
Runtime
- Performance tier:
fast
Input ports
| Name | Type | Required | Description |
|---|---|---|---|
query | text | Yes | Query text for reranking relevance |
results | json | Yes | Array of results to rerank |
Output ports
| Name | Type | Required | Description |
|---|---|---|---|
result | json | No | Main result containing reranked results array, count, method, and total_reranked |
success | boolean | No | Whether the operation succeeded |
Settings
Basic
| Setting | Name | Type | Required | Default | Allowed values | Description |
|---|---|---|---|---|---|---|
| Method | method | enum | No | cross-encoder | cross-encoder, bm25, semantic, hybrid | Reranking method |
| Top K | top_k | number | No | 10 | min 0; max 100 | Maximum results to return after reranking |
Errors
| Code | Description |
|---|---|
QUERY_REQUIRED | No query text was provided for reranking |
RESULTS_REQUIRED | No results array was provided to rerank |
INVALID_METHOD | Method must be cross-encoder, bm25, semantic, or hybrid |
RERANKING_FAILED | Reranking process encountered an error |
Runtime notes
- Each result object includes both the original score and the new rerank_score for comparison
- Results are sorted by rerank_score descending; new_rank is 1-indexed
- top_k=0 disables limiting and returns all reranked results
- Wire the results input from a retrieve node's result.results array
See Build any workflow for how to put nodes together and Ports, types and data flow for how port types connect.
¿Algo no está claro? Envíe sus comentarios sobre la documentación por correo electrónico..