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:
How Reranking Works
- The plugin builds a RankGPT-style prompt with the query and indexed passages.
- The LLM returns a ranking order (e.g. ).
- The plugin parses the order, removes duplicates and invalid indices, and applies a safe fallback for missing ones.
- 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.