Skip to main content

KG-SSOT

The trust layer for a company brain: a knowledge graph where a confirmed claim says where it came from and can say when it was verified, and where a decision comes back for review when a source it pinned changes.

This package ships the formal KG-SSOT contract and the tools that enforce it:

  • the reference reader, which checks a .kg.yaml or .kg.json graph against the contract at two levels: MUST, which fails, and SHOULD, which warns;
  • the conformance suite, as plain data, that every reader must pass;
  • the per-graph gate for CI, with a ratchet: existing debt stays named and can't get worse;
  • the store, which only writes what passes the contract;
  • the reference MCP server, which gives a model the contract and the store over stdio or local HTTP;
  • the domain vocabulary, with the source and verification date of each synonym, exported to SKOS-XL and Apache Ossie;
  • the provenance exporter to PROV-O in JSON-LD.

The contract, the suite, and the verdict schema ship inside the package. The reader depends on no agent harness. It needs Python 3.12 or later, PyYAML, and jsonschema.

Install

pip install kg-ssot

To run the commands without installing them into your environment, use pipx install kg-ssot or uvx --from kg-ssot kg-validate.

The search by meaning (kg-query --semantic and kg-vector) is optional: pip install "kg-ssot[vector]" adds onnxruntime, tokenizers, and numpy, and kg-vector fetch downloads the model, pinned by sha256.

Quickstart

Check your graphs against the current contract:

kg-validate graph.kg.yaml other.kg.json
PASS graph.kg.yaml
FAIL other.kg.json
  MUST   form.range.node.impact ×1 · integrity.orphan-node ×1
· 2 files; 1 pass the MUST; 0 with a SHOULD warning (kg-contract-v4.schema.json + kg-contract-v4.should.schema.json)

The exit code is 0 when every file passes the MUST, 1 when any file fails, and 2 on broken input. Two useful modes:

  • kg-validate --where shows the node or edge of each occurrence and, for a MUST occurrence that has a canonical fix, the fix right below it;
  • kg-validate --format json returns the structured verdict (code, path, line, message, and hint) in the versioned kg-ssot.verdict/1 format.

Run the bundled conformance suite against the reference reader:

kg-conformance | tail -2
latest: 512/512 (gates the rc)
optional: 10/24 (report only)

Only latest/ sets the exit code. The optional/ cases are reported and never change it.

Commands

Command What it does
kg-validate Checks .kg.yaml and .kg.json graphs against the current contract
kg-conformance Runs the bundled conformance suite against the reference reader
kg-gate Per-graph gate for CI: records a baseline (--update) and fails if anything gets worse
kg-store A store on disk, in git, or versioned, that only writes what passes the contract
kg-mcp (and the kg-ssot alias) Reference MCP server (stdio, or --http on loopback) with the tools kg_validate, kg_write, kg_get, kg_list, kg_query, kg_terms, kg_history, kg_delete, and kg_schema_help
kg-query Queries and projects a corpus of graphs, with edges resolved to their labels
kg-diff Diff by id between two graphs or between git revisions
kg-vocab The domain vocabulary (the x_term profile): lists the terms and what is due, resolves a text to its term, and exports to SKOS-XL and Apache Ossie
kg-criterion The pre-registered criterion: prints the sha256 of a criterion version and checks each version against its text or file, and each citation of another graph
kg-audit The audit package by question: one row per questionnaire item, with the answer, the verdict, the dated evidence, the gaps, and the owner, in CSV, XLSX, or JSON
kg-trace The trace that does not resolve: each node's trace: anchor against the files of the repository, with what is not judged counted apart
kg-vector The model and the index of kg-query --semantic, the search by similarity; needs pip install "kg-ssot[vector]"
kg-prov-export Exports each node's provenance as prov:Entity and prov:Derivation in JSON-LD

As a library, the modules live under kg_ssot: kg_ssot.kg_validate, kg_ssot.kg_store, kg_ssot.kg_mcp, and the rest.

MCP server

kg-mcp --root ./graphs --init
uvx kg-ssot --root ./graphs --init   # the same server, no install: kg-ssot is an alias for kg-mcp

The server speaks MCP over stdio. With --http PORT, it serves HTTP on loopback (127.0.0.1) by default, with no TLS. To listen beyond loopback, you need --allow-remote plus a shared secret (--secret-env), and you still put a proxy that handles TLS in front of it.

Package or vendor

Use the package to run the reader as a library, a command, or an MCP server. For the gate in a repository's CI, the recommended channel is still vendoring by tag: kg_vendor.py brings the release into your repository and verifies the sha256 of every file. That way, the contract that judges your graph shows up in your diff. The adoption guide covers both paths.

Documentation

License

Apache-2.0. See LICENSE and NOTICE.

Documentação em português: README.pt-BR.

Metadata

Release files for kg-ssot 4.41.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kg-ssot 4.41.0
File Size Uploaded Provenance Actions
kg_ssot-4.41.0.tar.gz 354.9 kB With provenance Details for kg_ssot-4.41.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kg-ssot 4.41.0
File Interpreter ABI Platform Actions
kg_ssot-4.41.0-py3-none-any.whl Python 3 none any Details for kg_ssot-4.41.0-py3-none-any.whl

Total release size: 1.0 MB

Release files / kg_ssot-4.41.0.tar.gz

Download URL kg_ssot-4.41.0.tar.gz
Size 354.9 kB
Tags Source
SHA-256 checksum
How to use checksums
56b9bc901f71d6f5b1bb331cfa93e128576d05c52b184fd0f5a408fba4862ab3
BLAKE2b-256 checksum
How to use checksums
73f2f44f388da0af17ffdb8a7ec8cf53f557dd49a6b890497f99c8cc22075c0d
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 Nov 4, 2026.

Transparency log

Release files / kg_ssot-4.41.0-py3-none-any.whl

Download URL kg_ssot-4.41.0-py3-none-any.whl
Size 689.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7461fa1f210313c677f651b77af7244d531c7ae9c9c475d3d51e81373a3a46f4
BLAKE2b-256 checksum
How to use checksums
2114633ea218676690e2b4b3f474372e6a343e3f4b512c281f1e23bf7a5c6a37
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 Nov 4, 2026.

Transparency log

Security for kg-ssot 4.41.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kg_ssot-4.41.0.tar.gz

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 Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

4.41.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page