Rerank Documents

jina.rerank
ActionAI & modelsconnection required

Calls the Jina AI API with the connection's credentials.

Score a list of documents against a query with a Jina reranker and return them ordered by relevance.

Connection

Required
Yes — the node will not save without one
Auth type
Bearer token
Providers
Jina AI
Secret shape
the API key, or {"api_key": "…"}
Config it needs
base_url, default_embedding_model, default_reranker_model
Resolved by
config.connection_id, else node.connection_id

Configuration

7 fields, 2 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.

FieldTypeRequiredDefaultConstraintsExample
query
The query the documents are ranked against.
stringYes——how do I rotate an API key
documents
Documents to rank: strings, or objects such as {"text": "…"} and {"image": "https://…"} for the multimodal reranker.
arrayYes——["rotate your key in the dashboard","unrelated text"]
model
Reranker model, for example jina-reranker-v3.5 or jina-reranker-v2-base-multilingual. Falls back to the connection's default.
stringNo——jina-reranker-v3.5
top_n
Return only this many of the best-scoring documents.
numberNo—≥ 1—
return_documents
Include each document's text in the results, not just its index and score.
booleanNo———
max_doc_length
Tokens to keep per document, on the jina-reranker-v3 family.
numberNo—1–8192—
return_embeddings
Also return each document's embedding, on the jina-reranker-v3 family.
booleanNo———

Example configuration

Every value below is the contract’s own example or default — nothing invented.

{
  "documents": [
    "rotate your key in the dashboard",
    "unrelated text"
  ],
  "model": "jina-reranker-v3.5",
  "query": "how do I rotate an API key"
}

Output

One shape.

result

FieldTypeExample
model
The reranker that scored the documents.
string—
results
Documents ordered by relevance, best first.
array—
results[].index
The document's position in the input.
number—
results[].relevance_score
Relevance score; higher is better.
number—
results[].document
The document, when return_documents was on.
any—
count
How many results came back.
number—
top_index
Input index of the best-scoring document.
number—
top_score
Relevance score of that best document.
number—
usage
Token usage Jina billed for this call.
object—
{
  "count": 0,
  "model": "",
  "results": [
    {
      "document": null,
      "index": 0,
      "relevance_score": 0
    }
  ],
  "top_index": 0,
  "top_score": 0,
  "usage": {}
}

See Rerank Documents run in a workflow.

In a technical demo we add the Jina AI connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.