Use BM25 + Jev when
Your documents contain exact product names, identifiers, technical terms, or overlapping query language. It is fast, inspectable, and avoids an embedding index.
Practical Jev RAG tutorial
Use a fast local retriever to find a bounded candidate set, let Jev judge which passages support the question, then ask a separate answer model to write only from the retained evidence. The default path needs no embeddings and no vector database.
Direct answer
Jev fits between retrieval and generation. SQLite FTS5/BM25 retrieves up to 30 candidate passages from local files. Jev receives the question and those candidates, returns calibrated evidence scores, and the application sorts them. MiniMax then streams a cited answer from up to ten retained passages.
The local index stays on your machine, but selected passage text is sent to the configured Jev provider and answer model. This is local-first, not fully offline.
0 · Try local retrieval without a key
This Python 3.9+ demo uses only the repository's public docs/ folder and a separate SQLite database. It does not scan your personal Documents folder, require package installation, or make a model request. SQLite FTS5 must be available.
git clone https://github.com/aifabrice/jev-rag.git
cd jev-rag
python3 local_kb.py --documents ./docs --db .knowledge/quickstart.db index
python3 local_kb.py --documents ./docs --db .knowledge/quickstart.db search 'retrieval' --no-jev
Expect ranked passages, source paths, and retrieval timing. This is the BM25-only baseline, not Jev reranking or a generated answer. Keep both folder and database arguments on every command. Once this works, continue with provider setup for the full pipeline.
1 · Install and configure
Clone the repository, create an isolated Python environment, install the package, and copy the example environment file. Keep .env out of version control.
git clone https://github.com/aifabrice/jev-rag.git
cd jev-rag
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
cp .env.example .env
Configure the provider credentials described in the README. The default answer path uses OpenRouter; Jev can run through the configured TypeSafe or OpenRouter route.
2 · Index local files
Point the CLI at a document folder. Markdown, text, HTML, JSON, CSV, YAML, DOCX, and PDF files are supported. The index is a local SQLite database.
jev-rag \
--documents /absolute/path/to/documents \
--db .knowledge/documents.db \
index --rebuild
Short files can stay whole. Large files should normally use the default heading-aware passage splitting so retrieval, reranking, and citations operate on focused evidence. Use --chunking none only when whole-file records match your corpus and evaluation.
3 · Retrieve, rerank, answer
jev-rag \
--documents /absolute/path/to/documents \
--db .knowledge/documents.db \
serve
Open http://127.0.0.1:8765. The default mode runs local BM25 retrieval, batches up to ten candidates per Jev request, keeps the evidence order in application code, and streams the final cited answer.
You can also compare the stages from the CLI:
# Local lexical baseline; no Jev request
jev-rag --documents /absolute/path/to/documents --db .knowledge/documents.db search 'your question' --no-jev
# Default BM25 candidate retrieval followed by Jev
jev-rag --documents /absolute/path/to/documents --db .knowledge/documents.db search 'your question'
# Machine-readable evidence and timing
jev-rag --documents /absolute/path/to/documents --db .knowledge/documents.db search 'your question' --json
4 · Know what Jev can and cannot fix
Your documents contain exact product names, identifiers, technical terms, or overlapping query language. It is fast, inspectable, and avoids an embedding index.
The query needs several alternate lexical searches but you still do not want a document embedding index. The planner proposes searches; code executes and fuses them locally.
Synonyms and paraphrases cause BM25 to miss the right evidence. Embedding candidates widen recall before the same Jev reranking stage.
Measured result
| Pipeline | nDCG@10 | What changed |
|---|---|---|
| BM25 top 30 | 0.305654 | Local lexical baseline |
| BM25 top 30 + Jev | 0.353235 | Same candidates, Jev reranking |
| Agentic lexical + Jev | 0.430969 | Wider lexical recall, then Jev |
| Hybrid top 50 + Jev | 0.444327 | Lexical + semantic recall, then Jev |
These are project-run results on the complete BEIR NFCorpus test split: 3,633 documents and 323 queries. They are not an official MTEB submission. Reproduce the commands and test your own corpus before choosing a pipeline.
Evaluation checklist
Continue with evidence
Use the benchmark explorer to compare retrieval paths, the use-case guide to choose a corpus shape, or the FAQ to verify privacy and vector-database boundaries before you connect a provider.
Explore the BM25 + Jev benchmark → · Review local knowledge-search use cases → · Read the evidence-backed FAQ →