Reranker Ollama icon

Reranker Ollama

Use Ollama Reranker to reorder documents after retrieval from a vector store by relevance to the given query.

Reranker Ollama

AI-generated

Summary

Rerank documents by relevance to a query using a specified Ollama reranker model, returning the top N most relevant documents.

Inputs

  • Model Name or ID (required) — Select the Ollama model to use for reranking documents. Choose from the list of available models or specify a model ID via an expression.
  • Top N — Set the maximum number of documents to return after reranking. Defaults to 3 if not specified.

Output shape

a list of documents with added metadata including a relevanceScore representing their relevance to the input query

The output documents array is sorted by decreasing relevanceScore. If fewer documents are provided than Top N, all are returned. Each document's metadata includes a relevanceScore set to 1 (relevant) or 0 (not relevant) based on the model's assessment.

Discussion