← All nodes
Transforms a_rerank

Rerank

Cross-encoder rerank of candidates against a query.

What does it do?

Reorders a search results list to put the most relevant items first.

How does it work?

Takes results from a Knowledge Base search and uses a specialized model to score how well each one answers the user's question.

Why use it?

Improves AI response quality. Ensures the assistant reads the right document first and doesn't get distracted by irrelevant results.

Inputs

nametype
text string
hits array

Outputs

nametype
results array
count number
model string

Branches

Fixed branches

  • out — Output

Configuration

query_field string required default: "text"
candidates_field string required default: "hits"
top_k integer required default: 5
score_threshold number optional
memory_key string optional
fallback_on_error boolean required default: true

Default configuration

{
  "query_field": "text",
  "candidates_field": "hits",
  "top_k": 5,
  "fallback_on_error": true
}

Emitted events

This node does not publish events on the pubsub channel.