Our index is a pure decision model based method with 0 LLM and optional embedding intervention.
Quick start · Measured results · Algorithm · Parallel processing · Retrieval · Contributing
Reliable decisions with a purely statistical prior. Jev scores whether paragraphs share a topic; an explicit Bayesian prior and a probability-drop rule determine where to cut. This makes document blocking a combination of learned decisions and transparent statistical rules, with no generative LLM calls during indexing and no required embedding model.
Headings and contents supply the upper structure without model calls. Jev then selects representative sentences directly from each topic block and paragraph using parallel outside-in search. The resulting content tree supports retrieval-augmented generation (RAG): an LLM proposes the content it needs, Jev searches from the root to sentence leaves, and the reader opens the selected source passages. The contribution is how topic blocks are formed; the tree is how those blocks are organized for retrieval.
The configurable retrieval adapter defaults to EEJ: embedding-based splitting and central sentences, followed by Jev tree search, pairwise ranking and shared-context evidence selection. This avoids Jev calls during indexing while retaining the improved retrieval stages. Choose JJJ for the full decision-model indexing method. Configuration and effort controls →
“0 LLM” means no generative LLM calls during indexing. Jev is a learned decision model; the query-time LLM is separate. The project name expresses the aim of source-grounded retrieval, not a guarantee of error-free decisions or answers.
The retained retrieval structure is Jev traversal + pairwise ranking + shared-context selection. Its measured JJJ configuration reaches 91.45% evidence Recall@5, and JJJ + independent direct embeddings reaches 92.44%, on the same 640 historical QASPER questions with aligned evidence. All 728 questions from 224 papers have predictions; every output contains whole source paragraphs.
| System | Evidence Recall@5 | 95% document-cluster interval |
|---|---|---|
| JJJ — shared context | 91.45% | 89.31–93.48% |
| JJJ + independent direct embeddings — shared context | 92.44% | 90.28–94.43% |
| Full Jev — traversal + pairwise ranking | 90.80% | 88.77–92.76% |
| Hybrid — traversal + pairwise ranking | 91.51% | 89.55–93.41% |
| Gemini Embedding 2, direct paragraphs | 80.78% | 77.91–83.60% |
| Direct Gemini + Jev v4 reranking | 86.87% | 84.54–89.17% |
Full Jev progresses from 87.56% → 90.80% → 91.45%, and hybrid from 89.51% → 91.51% → 92.44%: v4, improved traversal with pairwise ranking, then shared-context selection. Unchanged baselines reuse their saved predictions. Full comparison, complete evidence recovery and paired tests →
The earlier controlled v4 comparison measured EEJ at 87.87% versus JJJ at 87.56% with the same final reranker. EEJ is now the practical deployment default; EEJ with the later shared-context improvements has not yet been measured. The JJJ scores above are preserved under an explicit measured configuration.
Jev selects five paragraphs while considering a shared packet of promising targets and local source context. All five positions can change. The original question governs evidence selection; useful corroboration is retained. There is no Bayesian ranking prior or weighted candidate-position score. Standard configuration · Standard retrieval entrypoint
These historical questions have been inspected; the results are not untouched confirmation or proof of frontier superiority. The small shared-context gains over pairwise ranking are not statistically established. The report includes paired intervals and regressions.
The historical eight-way v4 experiment found higher recall for Jev tree search in all four matched splitting/central-sentence configurations. Its average matched search effect was +4.09 percentage points [95% CI: +1.26, +6.98]; one conditional comparison passed the prespecified 12-test Holm correction. Its final selector differs from the current standard.
Earlier v3 validation, blocking comparisons and tree evaluations remain available.
Python 3.10+. Install the complete runtime locally:
git clone https://github.com/Sheltercosmo/0halluciation-drift-indexing.git
cd 0halluciation-drift-indexing
python -m venv .venv
# macOS/Linux: source .venv/bin/activate
# Windows PowerShell: .\.venv\Scripts\Activate.ps1
python -m pip install .For fully local models, install and start Ollama v0.35.0 or newer, then:
ollama pull embeddinggemma
ollama pull nimble
zero-index init -o local.json
zero-index index examples/structured.md --config local.json -o document.index.json
zero-index search document.index.json "What are the visitor opening times?" --config local.jsonThis runs EEJ and returns whole evidence paragraphs with source offsets. Edit local.json to change search effort, thresholds, model names and endpoints. Add --hybrid to search to include independent direct embedding retrieval. An application or LLM can supply additional search needs with repeatable --need arguments. The local decision endpoint uses scoring models such as Nimble; see Ollama's decision setup.
Mix local and API providers independently: Ollama, compatible embedding APIs, Sentence Transformers, hosted Jev, compatible decision servers, or your own Python model/SDK callbacks. The installed package exposes RetrievalAdapter.from_models(...); the base HTTP runtime has no third-party dependencies. Local/API setup and Python examples → · All retrieval controls →
For a no-model installation check, the earlier lexical demo is still available:
zero-index build examples/structured.md -o output/lexical-tree.json
zero-index find output/lexical-tree.json "visitor opening and closing times"The index is built from the document's existing structure and exact source text. The steps below describe JJJ, where topic blocking uses Jev decisions and an explicit statistical prior. The default EEJ adapter substitutes an adjacent-embedding-distance quantile for splitting and embedding centroid scores for central sentences; headings, source paragraphs and the improved Jev retrieval stages stay intact.
- Separate titles and contents. Parse headings, heading levels and contents links without Jev or an LLM. Headings form the upper tree and act as hard boundaries. Recognized contents entries become navigation links to those headings.
- Create paragraph blocks. Split content on paragraph boundaries within each heading. Preserve original text, source offsets and line references; keep fenced code intact.
- Compare against one anchor. Start with
p0and ask Jev whetherp0-p1,p0-p2,p0-p3, and subsequent pairs belong to the same topic. Keep the anchor fixed until a boundary is found, avoiding all-pairs paragraph comparisons. Batch the next ready comparison from independent heading runs together. - Apply the statistical prior and cut at a drop. Adjust each same-topic probability using the configured Bayesian prior. Cut before a paragraph when its adjusted probability is low and falls sharply from the preceding comparison. Start the next topic block at that paragraph and make it the new anchor. Save the scores, prior, probability drop and cut decision for inspection.
- Plan outside-in candidates and score them together. Visit each paragraph's first and last sentence, then its second and second-last sentence, continuing toward the middle. Each candidate is judged against its paragraph and the whole topic block. These judgments do not depend on earlier scores, so combine work across search depths and topic blocks, filling bounded Jev batches. Representatives are copied source sentences; ties retain outside-in priority regardless of response order.
- Assemble the content tree. Attach topic blocks below their headings, paragraphs below topic blocks, and sentences below paragraphs. Store each paragraph and topic block's representative sentence alongside its full source content and provenance.
Document
├── Contents → links to existing headings
└── Heading (nested headings retain their source hierarchy)
└── Topic block + central source sentence
└── Paragraph + central source sentence
└── Source sentences with exact offsets
At retrieval time, an LLM proposes the content it needs. The new search_tree() path descends from the root through headings, topic blocks and paragraphs to sentence leaves, using representatives to route the search. The reader receives the selected source passages. The hybrid adds an independent direct embedding search across all chunks and combines both outputs under one reading budget. The earlier leaf-first retrieve() API remains available. See the new retrieval APIs →
Full sentence search is the default. --sentence-budget 2 restricts each target to two candidates; --sentence-budget 0 searches all. Any finite search can miss a better candidate. The pilot’s budget-two agreement was 23/36 versus 31/36 with full search.
You can also set --sentence-stop-threshold 0.90 to stop a paragraph or topic section after an outside-in wave finds a sufficiently strong candidate. Other targets continue in parallel, and the index records evaluated candidates and its stopping reason. This option is disabled by default. The sample hyperparameter search covers early stopping, branch acceptance and a lower-is-better split-separation score normalized by its parent reference; no best threshold has been established yet.
The default topic prior is 0.7, cutoff 0.5, drop 0.2, and assumed reference prior 0.5. These are explicit experimental choices, not empirically calibrated probabilities. Read the equations and boundary policy →
Expose independent work, fill requests, and overlap network waits. The optimized method batches one ready anchor comparison from each independent heading run, combines representative judgments across outside-in waves and topic blocks, and dispatches multiple HTTP batches concurrently. Retrieval reranking uses the same dispatcher.
| Layer | Optimization | Preserved constraint |
|---|---|---|
| Topic boundaries | Independent heading runs share each comparison round | A cut must resolve before choosing that run's next anchor |
| Representatives | Combine independent candidates across depths, paragraphs and sections | Same candidate budgets, full contexts and outside-in tie order |
| HTTP requests | Keep up to --max-concurrency batches in flight; refill on completion |
Shared call limit, size limits and complete-response validation |
| Tree assembly | Restore source order after scoring | Stable node IDs, exact spans and citations for fixed scores |
python -m zero_index build examples/structured.md --scorer jev --provider typesafe --batch-size 64 --max-concurrency 4 --max-calls 100 -o output/parallel-tree.json
python -m zero_index find output/parallel-tree.json "visitor opening and closing times" --reranker jev --provider typesafe --max-concurrency 4 --max-calls 20--batch-size limits questions per request; --max-concurrency limits simultaneous HTTP requests. Concurrency defaults to 1; the commands above explicitly enable 4. The planner coalesces work even at concurrency 1. These are application settings, not provider capacity guarantees.
An offline benchmark with a simulated 40 ms request delay reduced requests from 88 to 11 and median elapsed time from 3.592 s to 0.213 s with four concurrent requests (16.9× in this simulation). All variants answered the same 536 decision questions and produced exactly the same tree and boundary traces under fixed scores. This measures scheduling, not live Jev speed, token cost or accuracy. Remote scores can change with request composition.
Read the dependency model, controls, limits and benchmark → · Raw synthetic results
from pathlib import Path
from zero_index import JevScorer, build_index, retrieve
jev = JevScorer(provider="typesafe", max_calls=100)
index = build_index(
Path("document.md").read_text(encoding="utf-8"),
source_name="document.md",
scorer=jev,
)
# Your application supplies the query-time LLM callback.
# It returns one action: find, read, up, or finish.
def choose(state):
return your_llm_tool_call(state)
result = retrieve(index, "What evidence answers my question?", choose, reranker=jev)The callback proposes an evidence need with find. A scoped BM25-style pass supplies candidate sentences; Jev reranks them using parallel relevance decisions. The callback then uses read for a selected leaf, up for its paragraph and ancestors, and finish for evidence it actually read. Returned citations include source name, node ID, exact offsets, line numbers and source hash.
Candidate, call, step and reading budgets are explicit. Set candidate_limit=None in Python or --candidates 0 in the CLI to rerank all leaves in scope. A finite lexical shortlist can lose paraphrases before Jev sees them. The application supplies the LLM and final answer generator. See the callback contract →
python -m unittest discover -s tests -v
# Offline replay verifies the archived source hashes and reproduces metrics.
python -m evals.run --replay evals/results/pilot-v1-live --output output/my-replay
# A new bounded live evaluation; requires TYPESAFE_API_KEY.
python -m evals.run --output output/my-new-live-runThe archive includes the exact runtime snapshot, source corpus, gold labels, request bodies, returned probabilities, usage, timing and failed launch. It contains no credentials. Each new live run uses a fresh output directory and is capped at 220 HTTP attempts and 2,000 decision questions. Protocol → · Results → · Raw audit →
| Topic | Where to read |
|---|---|
| Bayesian cuts and outside-in waves | Algorithm |
| Concurrent requests, independent heading runs and benchmark | Parallel processing |
| Headings, contents and research precedents | Structural design |
| LLM proposals, root-to-leaf search and independent dense retrieval | Tree system |
| Existing leaf-first reranking and upward reads | Retrieval |
| Component controls and whole-system comparisons | Evaluation protocol |
| Similarities and differences with PageIndex | Comparison |
| Mascot and generation provenance | Meet Folio |
| GitHub description, topics and cover | Repository metadata |
| Public-data retrieval check | SciFact micro-pilot |
| Larger benchmarks, fair controls and complete dataset manifests | Research-based evaluation |
Is it the same as PageIndex? It shares hierarchical, embedding-free LLM retrieval. The specific indexing recipe differs: fixed-anchor Jev comparisons, prior-adjusted cuts, and extractive representatives evaluated in parallel waves. PageIndex Flash already derives structure from PDF layout before model-assisted summaries/refinement, so structural parsing without an LLM alone is not a sufficient distinction. See the primary description and the comparison above. No performance advantage over PageIndex has been measured here.
Embeddings remain optional through EmbeddingScorer(embed, model_name="your-model"); no embedding model or vector database is bundled. Markdown parsing and sentence splitting are deliberately small. PDF/DOCX layout recovery and OCR belong upstream. Fixed anchors can over-split subtopics or miss gradual drift; source extraction cannot guarantee correct retrieval or faithful generated answers.
Topic blocking with Jev decisions and Bayesian statistical priors, with embeddings optional.
