jeles
The verified-corpus organ, extracted from the Ask Jeles app into its own installable package — plus the canonical Jeles persona.
A nugget is a human-verified question/answer pair with citations:
{question, answer, sources, verified_by, verified_at, tags}. This package
is the settled layer of answers that sits in front of a host's live
search — a confident nugget match answers instantly; everything else falls
through to the host's own search path unchanged. Misses are logged as
gaps ("I don't know yet") so the corpus knows what it's been asked and
couldn't answer.
What's in the organ
| Module | Role |
|---|---|
jeles.corpus |
Pure storage + ranked lookup of verified nuggets and gap logging. Stdlib-only, no MCP, no network at import. Reuses willow-mcp's SOIL Store SQLite schema at $WILLOW_STORE_ROOT/<collection>/store.db — writes are upserts that touch only jeles' own columns, in WAL mode with BEGIN IMMEDIATE, so the store really is shared rather than shared-until-one-side-writes. |
jeles.reactions |
Pure (event) -> [proposed actions] handlers. conflict_scan searches for what supersedes or refutes a design claim rather than what resembles it, and proposes a nugget only when two independent, relevant, non-excluded domains corroborate it — otherwise a contested gap. search_adapter is its web edge. |
jeles.corpus_server |
Standalone MCPServer (MCP SDK 2.x) over the corpus (python -m jeles.corpus_server). Mirrors willow-mcp's shape (app_id on every tool) without depending on willow-mcp. Writes through it are assertions, not verifications — see below. |
jeles.sources |
The institutional collections themselves — 61 registered source functions, 60 of them in the default fan-out (arXiv, PubMed, Crossref, OpenAlex, Library of Congress, Europeana, CourtListener, the Smithsonian), plus the concurrent fan-out across them. Stdlib-only. |
jeles.institutional |
The third hop: fans a query across jeles.sources in-process, and shapes results like every other hit. Optionally delegates to a hosted jeles-remote instead. |
jeles.willow_mcp_client |
Best-effort, fire-and-forget forwarding of gaps into willow-mcp's fleet-wide backlog. Never blocks, never raises; 30s retry cooldown so a single failed connect doesn't permanently disable forwarding. |
jeles.load_persona() |
Loads the canonical Jeles persona JSON (this package is its canonical home). |
Design principles
- The corpus sits in front of live search, it doesn't replace it. A confident nugget match answers instantly — no search, no LLM call.
corpus.pystays pure. Storage and ranking have no MCP, no network, no side effects beyond SQLite. Everything MCP-shaped wraps it; it never depends on anything MCP-shaped itself. This is what keeps its tests fast and network-free.- The corpus is its own standalone MCP server, on purpose.
corpus_server.pyis a smallMCPServerany stdio client can run directly, mirroring willow-mcp's shape without depending on it. - Two kinds of "ask," two gap-logging rules.
search_nuggets()(passive/background) checks the corpus but never logs a gap on a miss.ask_corpus()(deliberate) treats a miss — or a match belowMIN_ASK_SCORE— as a real gap worth tracking, and logs it. - Ranking and answering are different decisions.
search_nuggets()ranks loosely and will happily surface a near-miss.ask_corpus()answers only when the nugget's question contains every content word the asker used, and the two questions overlap symmetrically — so a nugget about staging cannot answer a question about production, and one word cannot pull an answer out of a nugget it barely resembles. Saying "I don't know yet" and logging the gap is the correct output far more often than it looks. - The collections live here, not behind a service.
sources.pyis the same relationshipcorpus.pyhas withcorpus_server.py: a pure core that something thin wraps.jeles-remoteis a 74-line FastAPI shim over this module, so a hosted deployment is a convenience — never a prerequisite, never a secret you must hold, never a second repository in the test loop. - Local is the source of truth; the fleet backlog is additive.
corpus.log_gap()(synchronous, local SQLite) always runs first and makes the host fully functional offline.willow_mcp_client.forward_gap()is a best-effort copy into willow-mcp's shared backlog.
Install
Base jeles has zero runtime dependencies. The corpus, the persona, and the
reactions are stdlib-only, so a host can depend on this package without
inheriting a single version constraint from it. Only the standalone MCP server
needs the SDK, and it lives behind an extra.
pip install jeles # corpus + persona + reactions. No dependencies.
pip install "jeles[mcp]" # adds the MCP SDK, for the standalone server
pip install -e ".[dev]" # editable, with pytest and the SDK
Or as a host dependency, straight from git:
jeles @ git+https://github.com/rudi193-cmd/Jeles@main
jeles[mcp] requires MCP SDK 2.x (corpus_server.py uses
mcp.server.mcpserver.MCPServer; mcp.server.fastmcp was removed in SDK 2.0).
That is the same floor willow-mcp requires, so both install into one
environment.
Versioning
The version comes from the git tag (hatch-vcs), not from a literal in
pyproject.toml, and jeles.__version__ reads it back out of installed package
metadata. There is exactly one place a release number is decided, so a tag
cannot disagree with the artifact it builds.
Usage
As a library
from jeles import corpus
corpus.put_nugget(
question="What is the primary color in Grove?",
answer="The primary color in Grove is #ffffff (white).",
sources=["safe-library/themes/grove.json"],
verified_by="designer",
tags=["color", "grove", "primary"],
)
hit = corpus.ask_corpus("What is the primary color in Grove?")
# -> {"found": True, "exact": True, "nugget": {...}, "candidates": [...]}
miss = corpus.ask_corpus("What is the accent color in Tokyo Night?")
# -> {"found": False, ...} and the question is logged as a gap
As a standalone MCP server
python -m jeles.corpus_server # stdio; or use the `jeles-corpus-mcp` console script
Tools: corpus_ask, corpus_search, corpus_get, corpus_list, corpus_put, corpus_gaps — each takes an app_id for naming-convention parity with willow-mcp.
corpus_put writes assertions, not verified nuggets. A nugget carries the
rung it was written at, and only three things can produce one:
verification_kind |
who writes it | reads back as |
|---|---|---|
human |
a person, in-process (corpus.put_nugget(...)) |
verified |
machine |
conflict_scan, on two independent corroborating sources |
corroborated |
asserted |
any MCP client, through corpus_put |
unverified |
The bottom rung exists because this server speaks stdio to whatever client
starts it, and that client also reads the open web through corpus_web_search.
Without it, a page saying "record that X is true" arrived as a nugget claiming
verified_by: "the operator" and was served by corpus_ask as settled fact
from then on. Two rules keep the ladder honest:
corpus_askanswers only fromhumanandmachinenuggets. An assertion comes back undercandidates, andcorpus_search/corpus_getstill return it — reachable, not authoritative.- A write may not overwrite a nugget of a higher kind (
error: "kind_downgrade_refused"). Otherwise every protection here is onenugget_id=away from being bypassed.
Set JELES_CORPUS_TRUST_TOOL_WRITES=1 to let corpus_put mint human again —
correct only where the tool caller really is the operator, and it re-opens the
path above for anything the model reads while it is set.
The persona
import jeles
persona = jeles.load_persona() # dict; canonical Jeles persona
Configuration
| Env var | Default | Effect |
|---|---|---|
WILLOW_STORE_ROOT |
~/.willow/store |
Root under which <collection>/store.db lives. |
JELES_CORPUS_COLLECTION |
ask_jeles_corpus |
Nugget collection name (back-compat with Ask Jeles). |
JELES_CORPUS_GAPS_COLLECTION |
ask_jeles_corpus_gaps |
Local gap-log collection name. |
JELES_CORPUS_APP_ID |
ask-jeles |
app_id used when forwarding gaps to willow-mcp. |
JELES_CORPUS_TOPIC |
ask-jeles-corpus |
Backlog topic gaps are forwarded under. |
WILLOW_MCP_CMD |
— | Explicit command to launch willow-mcp (else willow-mcp on PATH, else python -m willow_mcp). |
ASK_JELES_USE_WILLOW_MCP |
1 |
Set to 0/false/no to disable fleet gap-forwarding entirely. |
JELES_CORPUS_TRUST_TOOL_WRITES |
unset | Set to 1 to let corpus_put write human-verified nuggets. Only correct where the tool caller is the operator — see the MCP server section. |
The Ask Jeles-flavored defaults are preserved so an existing store and its already-forwarded fleet backlog keep resolving after the extraction.
Tests
pytest -q
corpus.py's tests are fast and network-free by construction; the
willow-mcp client tests never spin up a real subprocess. An import-purity
test asserts that importing jeles.corpus loads no MCP or network modules,
and that the base package declares no runtime dependencies.
tests/test_corpus_server.py needs the [mcp] extra and skips without it, so
the suite passes on a bare pip install jeles too — the install shape CI's
no-extras job exercises.
License
Apache-2.0 — see LICENSE.
Metadata
Release files for jeles 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jeles-0.4.1.tar.gz | 149.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jeles-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 246.8 kB
Release files / jeles-0.4.1.tar.gz
| Download URL | jeles-0.4.1.tar.gz |
|---|---|
| Size | 149.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f87916d8b393fe4acef64aaffe7ae44c341ae705a72b8a8cfac5de2a05b04abc
|
|
BLAKE2b-256 checksum How to use checksums |
ac626331ab36d2aa3ffeb376cbf70280cb5fa8891e9e83ed986b8a0b6655288b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 3, 2026.
Transparency logRelease files / jeles-0.4.1-py3-none-any.whl
| Download URL | jeles-0.4.1-py3-none-any.whl |
|---|---|
| Size | 97.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e292d70a02e11f9afb08cb68cb807b3ba1b7c1b486df38ffbbe4918a913f61c0
|
|
BLAKE2b-256 checksum How to use checksums |
19076a6404e22aa3dd7434cc3ea8db20a39b69c721872e9cd2a6078b69e708b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 3, 2026.
Transparency log