Contextual AI icon

Contextual AI

Access Contextual AI tools for agents, parsing, querying, and reranking.

Reranker → Rerank documents

AI-generated

Summary

Rerank documents against a query using Contextual AI.

Inputs

  • query (required) — The query to rerank documents against.
  • documents (required) — Comma-separated list of document texts to rerank.
  • instruction — Optional instruction for the reranker.
  • model — Rerank model to use. Options: ctxl-rerank-v2-instruct-multilingual, ctxl-rerank-v2-instruct-multilingual-mini, ctxl-rerank-v1-instruct.
  • topN — Number of top-ranked results to return. Leave 0 to return all results.
  • metadata — Comma-separated metadata strings. Must match the number of documents if provided.
  • authentication — Authentication method to use. Defaults to API Key.

Output shape

object

Returns the raw API response from the Contextual AI reranking endpoint containing ranked document results. Includes pairedItem mapping for n8n item tracking.

Discussion