edgextract (Rust)
Closed-decision knowledge graph extraction. The Python package remains the reference; this crate is the same machine in Rust.
# CLI:
Browser WASM (npm, not crates.io): npm i @raphaelmansuy/edgextract. Demo: GitHub Pages · Hugging Face Space.
First principles
You declare the question and the legal answers first. Spans come from names the ontology lists, markdown cues, or an optional GLiNER proposer. GLiNER only proposes character spans; the decision model still assigns ontology types. Domain and range prune illegal pairs in code. A missing key, a choice not in the map, or a transport error produces no invented triple. Thresholds live in GateConfig (fitted starts false). Evidence is the source sentence. Work is per sentence. There is one client, one validator, and one gate.
See specs/0001-implementation/01-first-principles.md.
Build and test
From the repository root:
Or cargo test from the workspace root. Tests start a local HTTP server and POST to /v1/systemone. They do not need Ollama or GLiNER weights.
GLiNER2.5 (Candle) is behind --features spans. That build downloads nothing during cargo test unless you run the ignored live test, which loads a local checkpoint.
A live SystemOne probe (Ollama 0.35+ with a decision model):
CLI
Default extract uses gazetteer, markdown, and pronoun proposers. Add GLiNER spans with a spans-enabled binary:
--encoder-model is a local checkpoint directory, or a Fastino repo id whose files already live in $XDG_CACHE_HOME/gliner-rs/<name> (or ~/.cache/gliner-rs/<name>). The library does not type from GLiNER labels.
CoNLL04-style span scoring (gazetteer + encoder, whole document as one sentence, encoder cutoff 0.30):
Each /v1/systemone POST is one model step. The extractor packs closed questions until an estimated prompt stays under --max-prompt-tokens (default 2000, under tev1's 2050). --max-questions is a second cap. A host 400 about context length splits the batch and retries; other transport errors stay fail-closed. The cache key includes edgextract.decision.2026-10-06. Each question quotes the only sentence it may use. A listed name is accepted only when the surface matches that spelling. A kept triple is checked in code: legal ontology label, two different names, and a source sentence. eval scores a golden directory with deterministic precision and recall.
extract writes EdgeQuake-shaped JSON. HTML reports stay in the Python package.
WebAssembly
The core crate builds for wasm32-unknown-unknown once the native feature (HTTP client, SQLite cache, CLI, local fake server) is off:
Two things change in the browser, and both are swapped in at the edge: the decision cache lives in memory (DecisionCache::in_memory), and the model is a JavaScript function you pass to Engine.extract (the demo makes a synchronous POST /v1/systemone from a Web Worker). Set discover_names in the request to also propose capitalized runs the ontology does not list (candidates::ShapeProposer); each is still decided by the model. standin::rule_handler is a rule-based test double used by Rust tests, and edgextract serve-standin serves it over HTTP with CORS for the demo's end-to-end tests. It is not a decision model and the browser API does not accept it.
See web/README.md for the demo.