klode
A klode — a rich vein — of grounded, verifiable knowledge, with the machinery to encode it and to supervise work against it. Every claim is anchored to a verbatim source and checked by a fail-closed linter, so the system can't quietly drift or hallucinate: cite, don't recall.
Zero runtime dependencies — Python 3.11+, standard library only.
The two loops
- Loop A — encode expertise (
klode.lib): turn sources into cited, retrievable knowledge. Every card claim carries a verbatim(grep: …)anchor;klode checkfails if any citation stops resolving. - Loop B — supervise work (
klode.gate): submit a draft, score it against criteria loaded from a knowledge base's craft layer, and return Go / Recycle — each cited defect grounded throughklode.lib.verify, so the judge's citations are un-fakeable. The boundary is enforced:klode.gateconsumes only theklode.libpublic API, never its internals.
Install
pip install klode # once published
# or from a source checkout:
pipx install -e . # provides the `klode` and `klode-mcp` commands
Three surfaces over one engine
A knowledge base is a library.toml plus a corpus of cited cards. Point klode at one with -c, or
register several in a manifest and address them by id (--kb <id> / --registry).
CLI — klode:
klode -c path/to/library.toml check # citation-rot linter (exit 1 on any broken citation)
klode -c path/to/library.toml search pacing # retrieval over the cards
klode -c path/to/library.toml consult brevity # read a craft lens
klode -c path/to/library.toml verify brevity "the exact quote" # prove a quote against its source
klode ingest paper.pdf --shelf papers # ingest a source -> clean, grep-ready text
klode kbs # list the KBs in a registry
Add --json to any read verb for machine-readable output (the same structured result the MCP renders).
MCP server — klode-mcp (stdio): exposes the read/verify surface to an agent — list_kbs,
search_sources, consult_dimension, consult_framework, zoom_card, verify_quote, diagnose,
list_lenses. Serves one KB (-c) or many (--registry), and every grounded result names its KB.
Library — import klode.lib: the stable public-API facade — verify, search, consult,
resolve, diagnose, Config. Cheap to import; pulls in no frontends or optional backends.
Ingestion — any format to grep-ready text
klode ingest detects the format by content signature (not the extension) and converges every source
on one clean-text pipeline: PDF, EPUB, DOCX, HTML/XHTML, TXT. EPUB/DOCX/HTML/TXT are pure stdlib;
only PDF's OCR tiers are optional. For table-heavy or scanned PDFs, point $KLODE_DOCLING_URL at a
docling-serve endpoint (the GPU runs server-side —
klode stays dependency-free) and pass --tier docling.
Architecture
One operations registry projects a single core to both surfaces (CLI + MCP), so they can differ in
formatting but never in behaviour. Every grounded result carries structured provenance (which KB,
which source, which policy). See dev-docs/ for the design record and SPEC-operations.md for the
machine-readable operation table.
Status
0.2.2 — beta. The engine (klode.lib) is solid: 490 tests, a stable public-API facade, an AST
layering guard, a content-sniffing multi-format ingester, and an MCP server, all with zero runtime
dependencies. klode.gate (Loop B) is now a fail-closed supervising gate — freshness/review-aware
grounding (verify_evidence), a bounded evidence-context op (verify_context), a fail-closed
verified-context bundle (build_context_bundle), a shared structured anchor contract
(parse_markers/Marker, regex/context/#n), and an enriched, anchor-validated criterion schema
are in place — but the rubric judge is still a stub
(FixtureJudge); a real LLM judge plugs into the Judge protocol. The optional entailment check
(klode check --entail) pulls a small NLI model behind klode[entail] and is advisory, warn-only.
License
MIT — see LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file klode-0.2.2.tar.gz.
File metadata
- Download URL: klode-0.2.2.tar.gz
- Upload date:
- Size: 156.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e5153427562b4f4ff190ba879de5b3c22f061088ea9a3423444cdb7c0692a77
|
|
| MD5 |
4348c3a412b8d35237ebd669c559def0
|
|
| BLAKE2b-256 |
0ffd6c16fe84aa90689a4a7bb58161ce8cffd67c70e769415c3da8ef95003d49
|
Provenance
The following attestation bundles were made for klode-0.2.2.tar.gz:
Publisher:
workflow.yml on xiaolai/klode
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
klode-0.2.2.tar.gz -
Subject digest:
6e5153427562b4f4ff190ba879de5b3c22f061088ea9a3423444cdb7c0692a77 - Sigstore transparency entry: 2338227416
- Sigstore integration time:
-
Permalink:
xiaolai/klode@2fe61fc26b4e43df60c4b55424bc5529fcd6206d -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/xiaolai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@2fe61fc26b4e43df60c4b55424bc5529fcd6206d -
Trigger Event:
push
-
Statement type:
File details
Details for the file klode-0.2.2-py3-none-any.whl.
File metadata
- Download URL: klode-0.2.2-py3-none-any.whl
- Upload date:
- Size: 108.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
729423f464cdd963cb301db1bcef8288692cc9012a2dcea80395413f18ca3373
|
|
| MD5 |
4b82a5d6ebc8a9ee0a3bd445902d734e
|
|
| BLAKE2b-256 |
f0f08aef805f80508ea4643b2b3d017e1672fbb0c841f74dcde5db18e90180f8
|
Provenance
The following attestation bundles were made for klode-0.2.2-py3-none-any.whl:
Publisher:
workflow.yml on xiaolai/klode
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
klode-0.2.2-py3-none-any.whl -
Subject digest:
729423f464cdd963cb301db1bcef8288692cc9012a2dcea80395413f18ca3373 - Sigstore transparency entry: 2338227423
- Sigstore integration time:
-
Permalink:
xiaolai/klode@2fe61fc26b4e43df60c4b55424bc5529fcd6206d -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/xiaolai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@2fe61fc26b4e43df60c4b55424bc5529fcd6206d -
Trigger Event:
push
-
Statement type: