jev-reranker
Retrieval and RAG: uses Jev Noul judgments to assess retrieved documents for relevance and usefulness as answer evidence, then sorts results and optionally filters them using a…
# jev-reranker: Relevance Filtering & Reranking for RAG [](https://github.com/hotchpotch/jev-reranker/actions/workflows/ci.yml) [](https://pypi.org/project/jev-reranker/) [](LICENSE) jev-reranker is a Python library for reranking search results and filtering retrieved documents with TypeSafe.AI's Jev. It provides prompts for both tasks and handles concurrent requests, splitting long candidate lists, and retries. For a walkthrough with examples, read [Introducing jev-reranker: Reranking and Relevance Filtering for RAG](https://huggingface.co/blog/hotchpotch/introducing-jev-reranker). Search results can match a question without helping answer it. Passing every match to an LLM adds input tokens and potentially distracting context. `relevance_rerank()` scores documents for their usefulness as evidence, sorts them, and removes those below a configurable threshold. If nothing passes, your application can try another search or stop before generation. Use it after retrieval and before assembling context for RAG. Use `rerank()` when you want to reorder candidates without filtering by default. Both accept a query string and a list of document strings; scoring runs through the Jev API. The base package needs no local model or GPU. ## Highlights - Relevance filtering scores documents for their contribution to an answer, including partial answers and facts needed for multi-hop reasoning. - A configurable threshold determines which documents to keep. Results are sorted by score; an empty list means no candidate passed the threshold. - Prompts are Python dictionaries. You can change the instructions and criteria to describe what counts as useful evidence in your application. - Long candidate lists are split automatically. Document limits and split budgets can use charac