Local-first, with byte-level provenance on every edge. Deterministic by default — the same corpus always yields a byte-identical graph you can audit and re-verify. Explore it in an interactive graph studio, derive new relations with link prediction & Datalog rules, and layer opt-in LLM extraction, grounded answer synthesis, and semantic search on top — always quarantined so model output never poses as ground truth.
pip install textgraph-kg
Each edge carries a re-verifiable
[doc:byte-span] citation — re-hash it against the source and it still matches.
A pure layer stack —
ingest → structure → encoder IE → resolution → claims → analytics → retrieval —
that never calls a model. Same corpus, byte-identical graph, gated in CI.
Two opt-in touchpoints only:
--llm-extract reads chunks and adds relations the deterministic pass missed;
--llm summarizes finished communities. Both run before/after the core,
stay GENERATED-tagged and byte-cited, and vanish when off.
WHY/DECISION/ADR markers become a queryable causal chain; export a W3C PROV-O audit trail.
Contradictory single-truth claims are surfaced for review, resolved only on an explicit, non-destructive policy.
Optional GQL, vision retrieval, access control, and Graph-of-Thoughts reasoning — each an opt-in module.
Every layer is a pure function of the one below it plus a pinned config hash — the property that makes the graph reproducible and incremental. The LLM appears at exactly two opt-in, quarantined touchpoints; turn them off and the build is byte-identical.
STRUCTURAL).EXTRACTED).--llm-extract) — the LLM reads each chunk and returns
{subject, predicate, object} triples; each endpoint merges onto an existing
entity by name (no duplicate nodes) or mints a new one, and every edge is
GENERATED-tagged and cited to the chunk's byte span. Prompt-cached, budget-capped, deterministic given a fixed model.--co-occurrence) — links entities co-mentioned in a chunk so a relation-sparse corpus still forms a connected, clustered graph (STRUCTURAL, cited).textgraph build ./case-files --llm-extract --co-occurrence -o case-out && textgraph console case-out