app icon
rankgpt
0.3.0

LLM-based RankGPT reranker supporting OpenAI, Google Gemini, and Anthropic for reordering retrieved documents by query relevance.

ki3dn/rankgpt312 installs

RankGPT Dify Plugin

LLM-based RankGPT reranker plugin for Dify, supporting OpenAI, Google Gemini, and Anthropic.

Author: ki3nd
Type: model
Github Repo: https://github.com/ki3nd/rankgpt-dify-plugin
Github Issues: issues

Overview

This plugin adds a to Dify and uses an LLM to reorder retrieved documents by query relevance.

Features

  • Supports OpenAI, Google Gemini, and Anthropic providers
  • RankGPT-style permutation reranking
  • Sliding-window reranking for longer document lists
  • Rank-based pseudo-score output ()

Configure In Dify

When configuring the provider in Dify:

FieldDescription
, , or
e.g. , , or
OpenAI API key (OpenAI only)
Optional, for OpenAI-compatible endpoints (OpenAI only)
Google AI Studio API key (Gemini only)
Anthropic API key (Anthropic only)
Sliding window size (default )
Sliding step size (default )
Max words per passage before truncation (default )

How Reranking Works

  1. The plugin builds a RankGPT-style prompt with the query and indexed passages.
  2. The LLM returns a ranking order (e.g. ).
  3. The plugin parses the order, removes duplicates and invalid indices, and applies a safe fallback for missing ones.
  4. Results are returned to Dify as .

Notes

  • LLM-based reranking — latency and cost depend on model choice and document count.
  • For large document sets, tune and to avoid oversized prompts.
  • applies to a rank-based pseudo-score, not a true relevance probability.
CATEGORY
Model
VERSION
0.3.0
ki3dn·04/22/2026 06:09 AM
REQUIREMENTS
LLM invocation
Maximum memory
256MB