A decision-aware knowledge-graph system built on LightRAG. It extends triples (h, r, t)
into contextual quadruples (h, r, t, rc) — attaching the decision record (who, why, when, under which
policy) to every edge — and adds CGR3 reasoning, a business rules engine, a typed ontology, web ingestion, and a
governed action layer.
The idea in narrative form, and the complete technical reference.
Why decisions — not just facts — belong in the graph. A developer's tour of contextual quadruples and the CGR3 reasoning loop, with diagrams.
The full reference: architecture, the quadruple, ingestion, querying & CGR3, the REST API, MCP, storage, and multi-tenancy — self-contained, illustrated.
How it all works together: the graph as the single source of truth, the four derived vector indices, every write and read path, and the governance layers — with diagrams.
Why the AI should be limited more than a developer, not less: LLM as an ontology-bounded rule generator, kept out of the decision loop, gated by a human — with clinical protocols as the worked proof.
The regulatory & business case: the CDS exemption, the audit trail as a liability shield, why the barriers that buried Arden and Drools are lower now — and where it still might fail.
Governance, ingestion, and execution — each with its own illustrated walkthrough.
A pre-emit gate over every decision. A DSL with semantic sim() matching, PASS / FLAG / REJECT
outcomes, and a plain-English policy author.
Object types, link types, and typed properties that every extraction is validated — and coerced — against. Open- or closed-world, with an NL schema author.
Point it at any site. A polite crawler, pluggable platform connectors, and LLM-guided acquisition — with the source URL carried through as provenance.
Executable operations bound to object types. Invoke → rules gate → audit edge, with SSRF-guarded handlers — turning a graph you reason from into one you operate from.
The whole stack, aimed at a concrete problem. AI-driven software development is the first.
The build log and the long-form reference docs. Markdown files open on GitHub.
The full gap analysis, architecture decisions, and build log behind the rules engine, ontology, and web ingester — including the decision-matching and gate-flow diagrams.
The complete design rationale and formal treatment of contextual quadruples and CGR3.
USE_CONTEXT_GRAPH=true, start lightrag-server (port 9621), and open the WebUI — the
Rules and Ontology tabs manage governance, POST /scrape pulls a website into the graph,
and POST /actions/invoke runs governed operations. Full setup lives in the
README.