jev-rerank
Python library that scores each RAG passage with a Jev Score question in one batched call, then sorts and filters by threshold.
Overview
jev-rerank by cmaintz is a small Python library for RAG relevance filtering and reranking. Every candidate passage becomes a Score question over a shared state of query and passages, answered in one batched call; each passage gets a relevance level on an ordered rubric plus a confidence, results are sorted, filtered with min_score and truncated with top_n, and large sets are chunked to stay within Jev's context limit.
The provider uses only the standard library, and short examples show how to wrap it as a LlamaIndex postprocessor, with first-class LlamaIndex and LangChain adapters on the roadmap. The README's honest limitations: it is a cheap first pass rather than a cross-encoder (it describes Jev as about 68% accurate), best used as a prefilter before an expensive reranker or where cost and latency dominate; it is text only; and it needs a Jev key. Version 0.1 passes lint, type checks, tests and dependency audit.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Score | How relevant is this passage to the query (ordered rubric 0..N)? | — |
How it works
- Put query and passages into a shared state
- Add one Score question per passage
- Send in batches under the context cap
- Sort by score, filter by min_score and take top_n
Strengths
- Zero-dependency provider
- Cheap prefilter before costly rerankers
- Easy to wrap for LlamaIndex or LangChain
Caveats
- Lower ranking quality than dedicated cross-encoders per the README
- Text only
- Framework adapters still on the roadmap
Getting started
from jev_rerank import rerank, TypeSafeProvider; rerank(query, passages, TypeSafeProvider(api_key=...), top_n=5, min_score=2.0)At a glance
- Type
- Project
- Status
- beta
- Language
- Python
- Runtime
- Library
- Has code
- yes
- Has tests
- yes
- License
- MIT
Use cases and integrations
How curated lists describe it
Jev-powered relevance filtering and reranking for RAG.
wh000wh000/awesome-jev-live
Frequently asked questions
What does Jev decide?
A relevance level for each passage on an ordered rubric.
Should it replace a cross-encoder?
The README positions it as a cheap first pass; dedicated cross-encoders still win on quality.
Does it work with LlamaIndex?
Yes, with a few lines of wrapper code; official adapters are planned.
Related projects
- Jev Search★ 534
Plain-language web search where a decision model like Jev picks query, sources and time range, then ranks Search1API results.
AppproductionTypeScript MCP server over Apple developer docs and WWDC transcripts that uses hybrid search, then Jev relevance scores to rank results.
MCP serverproductionTypeScriptLocal long-term memory for coding agents with an optional Jev reranker that orders recalled memories.
ProjectproductionTypeScriptVolcengine's context database for agents, with a Jev rerank client that scores candidate documents with jev-latest as relevance.
LibraryproductionPython- jev-rerank★ 17
Jev as a calibrated reranker: query plus up to 30 documents in one call, one relevance Noul per document, benchmarked on BEIR.
ProjectbetaPython Deterministic code-graph context for coding agents on Postgres, AGE and pgvector, with optional Jev or local re-selection of symbols.
MCP serverbetaPython