KG-SSOT

io.github.marciocar由 GitHub 帳號 marciocar 發布v4.45.0更新於 Nov 7, 2026

Company-brain knowledge graphs: confirmed claims cite sources, and decisions get revisited

概覽

AI 產生的概覽

本機 MCP 伺服器,管理純文字企業知識圖譜:已確認的論斷必須註明來源,決策會被追蹤並定期複核。

可以做什麼
  • 依契約驗證圖譜,只寫入通過驗證的內容
  • 讀取、列出節點並檢視圖譜儲存的歷史
  • 跨語料查詢節點與邊,並解析邊另一端的標籤
  • 查詢決策、其取代的內容、支撐依據以及哪些需要複核
  • 提供契約說明、最小可通過範例和常見錯誤碼的修正方式
  • 解析領域詞彙術語
適用情境
適用於團隊或代理群體把結論、決策及其出處保存在受版本控制的檔案中,並希望助理在不遺失來源和複核日期的前提下寫入、驗證和查詢這些內容。適合已用 .kg.yaml 圖譜承載知識的儲存庫,而非文件分塊檢索情境。
執行需求
以本機 stdio 程序執行,透過 kg-mcp --root 指向圖譜目錄啟動;可從 PyPI 安裝(需 Python 3.12 或更新版本、PyYAML 與 jsonschema),用 uvx 或 pip 安裝,也可作為 Claude Desktop 的一鍵 .mcpb 擴充功能。未宣告驗證、環境變數或請求標頭。可選的相似度搜尋需安裝 vector 附加元件。
安裝前請注意
寫入類工具會把圖譜存到磁碟、git 儲存庫或版本化儲存,助理可能改動目標根目錄中的檔案。此伺服器保證論斷說明來源與驗證時間,但不保證內容為真。可選的語意搜尋使用本機嵌入模型。唯讀工具帶有標註,其他工具可能需要確認。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 KG-SSOT,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

KG-SSOT

The trust layer for a company brain: knowledge graphs in plain text where a confirmed claim must cite its source, a decision records what it replaced and what it rests on, and a decision comes back for review when a source it pinned changes.

English | Português (Brasil)

[License: Apache-2.0] [Contract: v4 · release 4.45.0] [Conformance: 512/512] [Python 3.12+] [PyPI] [npm] [GHCR] [MCP Registry]

Documentation · Adopt it · The contract · Conformance suite · Changelog · For AI agents

[KG-SSOT in 50 seconds: a claim held up by a test that runs, a refactor that deletes the test, the graph flagging the missing source, and the decision to revisit moving to the top of the backlog]

The contract in 40 seconds: a claim without a source is refused, then fixed, queried and gated.


Why

A company brain is usually built by piling documents into RAG or GraphRAG. That keeps the data, but not the decisions: who decided what, on which source, and whether that source still holds. Teams, of people or of agents, pile up conclusions such as "the retry is idempotent" or "we decided on three attempts", and on the way they lose three things: the source, the date it was last verified and what depends on it. When the person who decided leaves, the reasoning leaves too.

KG-SSOT treats this as a format problem, not a discipline problem. Knowledge lives in a .kg.yaml graph, versioned next to the code, and a formal contract decides in CI what fails:

  • a confirmed or production node without provenance fails (a claim with no recoverable source is declared unverifiable instead);
  • a source that is only a placeholder (unknown, n/a, tbd) fails;
  • an edge that points nowhere fails, and so does a node with no edges;
  • a verification stamp with nothing to check against, a decision with no origin and a production claim backed only by testimony raise warnings.

What it does for a company brain

You need to know...KG-SSOT gives you
Where a claim came fromA provenance on every confirmed claim: the file, the line or the node, and, if you pin it, a hash that kg_trace.py check verifies
Why a decision was made, and what it replacedkg_query --decision ID: the whole SUPERSEDES line, what supports it and the status of each support
Which decisions to look at againkg_query --revisit: the ones past their review cadence, contested, or whose approved document or pinned source changed
What is on each owner's platekg_query --open --where owner=X --sort attention
How many open decisions each graph holds, or any count by fieldkg_query --type decision --open --group-by file
Which nodes are most supported, and by how many distinct sourceskg_query --edges --where edge_type=SUPPORTS --group-by to.file --group-by to.id --count-distinct from.id
Which decisions have no internal SUPPORTS edge in their own graphkg_query --type decision --where degree.in.SUPPORTS=0; a SUPPORTS from another graph is not counted, so complete it with kg_query --edges --where edge_type=SUPPORTS --where scope=external
What is past its re-verification date, on any kind of nodekg_query --due, the most overdue first
Who cites this node in other repositories, before you delete itkg_refs cited-by repo:ID --repo name=folder ..., with what was and was not read
What an e-mail, chat or wiki event said, and who sent itAn evidence node with the CloudEvents 1.0.2 names in x_event, pinned to the accepted inbox document (recipe)

Business, technical, compliance and design knowledge can live in the same format, in your repository. It plugs in as a Python package or an MCP server, with a JavaScript validator on npm, and the CI gate is one of its uses, not the point. The pins are checked when kg_query or kg_trace.py runs with --root.

Get started in 60 seconds

bash
pip install kg-ssot
# the conformance suite against the reference reader, from the installed packagekg-conformance | tail -2
# one valid graph and one that failskg-validate valid.kg.yaml broken.kg.yaml

Or straight from the repository, with hash-checked dependencies:

bash
git clone https://github.com/marciocar/kg-ssot && cd kg-ssotpython3 -m venv .venv && .venv/bin/pip install --require-hashes -r tools/requirements.txt.venv/bin/python3 -I tools/kg_validate.py \  spec/conformance/fixtures/latest/form/minimal/valid-minimal.kg.yaml \  spec/conformance/fixtures/latest/form/minimal/bad-node-missing-label.kg.yaml
text
PASS spec/conformance/fixtures/latest/form/minimal/valid-minimal.kg.yamlFAIL spec/conformance/fixtures/latest/form/minimal/bad-node-missing-label.kg.yaml  MUST   form.required.node.label ×1· 2 files; 1 pass the MUST; 0 with a SHOULD warning (kg-contract-v4.schema.json + kg-contract-v4.should.schema.json)

The tools print in English by default and in Brazilian Portuguese when your locale is pt_BR (or KG_SSOT_LANG=pt-BR). Codes, exit codes and JSON keys never change with the language; only the human text does.

Install

ChannelCommandWhat you get
PyPIpip install kg-ssotThe commands kg-validate, kg-conformance, kg-gate, kg-store, kg-query, kg-diff, kg-vocab, kg-criterion, kg-audit, kg-trace, kg-refs, kg-vector, kg-mcp and kg-prov-export, with the contract and the suite inside; pip install "kg-ssot[vector]" adds the search by similarity
npmnpm install kg-ssotThe JavaScript reader with a precompiled validator, which also runs in React Native and Expo
Claude Desktopthe .mcpb file from the latest releaseThe MCP server as a one-click extension
MCP Registryio.github.marciocar/kg-ssotThe same server for any MCP client
Containerdocker pull ghcr.io/marciocar/kg-ssotThe MCP server as a service next to a client without Python, such as LibreChat
Your repositorykg_vendor.py update --tag kg-ssot-v4.45.0The release vendored by tag, with a sha256 stamp, and the gate in your CI (manual, chapter 6)

A node, inside

yaml
- id: C_RETRY_SAFE  node_type: claim  plane: PROD  status: confirmed  impact: 4  confidence: 0.8  label: The payment retry is idempotent.  verified_at: "2026-10-01"  verified_against: tests/payment_retry_test.py  provenance:    source: tests/payment_retry_test.py    locator: test_retry_is_idempotent    method: "measurement: integration test in CI"

The label is the claim, short. The provenance says where it came from and how: one of five method classes, measurement, reading, judges, derived or testimony. The stamp says when it was verified and against what. Since contract v4.16 these English names are the canonical form; the Portuguese medição, leitura, juízes, derivado and testemunho are still accepted as aliases, with no warning.

Use it from an AI agent

The reference MCP server gives a model the contract and a store: it validates a graph, writes only what passes, reads, lists, queries with every edge resolved to the label on the other end, and shows history. Read-only tools are annotated as such, so a client can skip confirmation for them.

bash
kg-mcp --root ./graphs          # stdio, for Claude Desktop, Claude Code and other MCP clients

kg_schema_help returns the current contract, a minimal passing example and the fixes for the most common codes, so a model can write a passing graph on the first try. llms.txt indexes the documentation for agents, and llms-full.txt has all of it in one file.

The agent skill. skills/kg-ssot/ is an Agent Skills skill that teaches a coding agent to write, fix, validate and query graphs with these tools, in .kg.yaml and .kg.json. In a pre-registered test, an agent with the skill reached the same result with 45% of the output tokens and 54% of the tool calls.

bash
npx skills add marciocar/kg-ssot -s kg-ssot     # Claude Code, Codex and other clients that read Agent Skills

In Claude Code, it also comes as a plugin: /plugin marketplace add marciocar/kg-ssot, then /plugin install kg-ssot@kg-ssot.

How it works

mermaid
flowchart LR  subgraph product["Product (one tag kg-ssot-vX.Y.Z)"]    C["Contract<br/>JSON Schema MUST + SHOULD<br/>+ integrity rules"]    S["Conformance suite<br/>512 cases as plain data"]    R["Reference reader<br/>kg_validate.py"]    S -- "every reader passes" --> R    C --> R  end  subgraph adopter["Adopter repository"]    V["vendor/kg-ssot<br/>+ sha256 stamp"]    G["kg_gate.py in CI<br/>per-graph ratchet"]    K["the team's .kg.yaml"]    V --> G    K --> G  end  product -- "kg_vendor.py update --tag" --> V  G -- "nothing gets worse:<br/>a new graph passes,<br/>debt only shrinks" --> PR["PR approved"]
  1. The contract is JSON Schema 2020-12 at two levels: MUST fails, SHOULD warns. The rules a schema cannot express (unique ids, existing edge ends, orphan nodes) are part of it.
  2. The suite is the compatibility proof: each case is a real YAML file with the expected verdict and codes, and a reader passes only if it emits exactly the same codes.
  3. The kit brings the contract to a repository by tag, with a stamp that fails local edits, and runs the per-graph ratchet in CI: what already failed becomes named debt, a new graph has to pass, and the debt only shrinks.

Features

Two-level contractMUST fails, SHOULD warns, with a ramp: what warns in one version can fail in the next, and the adopter sees it coming
Structured provenancesource, locator and method, with five evidence classes and the source locality (repo, web, host, pessoa, privado)
Verification stampverified_at and verified_against, with a warning for a stamp with no target and for a verification dated before the fact
Edges between graphsexternal_edges, with the far end checked against the corpus
Stable codesEvery violation has a code such as form.required.node.provenance, and --where names the node
Structured verdictkg_validate.py --format json returns the verdict with code, document path, line, message and fix hint, in a versioned format (spec/verdict.schema.json) for tools and MCP servers
Two formats, one model.kg.yaml to write and review in a diff, and .kg.json for runtime use (an app, a server), read by a JSON parser under the contract's JSON profile (RFC 8259, I-JSON, up to 128 levels, unique keys)
Gated storekg_store.py writes .kg.yaml or .kg.json to disk, a git repository or a versioned store, only after the contract passes, with external edges checked in the store and optimistic locking for concurrent writers
Reference MCP serverkg_mcp.py serves the contract and the store over MCP (stdio, or HTTP behind a proxy with per-identity areas), with tool annotations
Query and diffkg_query.py selects nodes across a whole corpus and projects every edge with the label on the other end, paginated (kg-ssot.query/1); kg_diff.py compares revisions by id, field by field, reading git without a checkout (kg-ssot.diff/1)
Domain vocabularyThe x_term profile gives each synonym its source, document version and verification date; kg_vocab.py resolves a text to its term, lists what is due, and exports to SKOS-XL and Apache Ossie (kg-ssot.vocab/1); the MCP server serves it as kg_terms. Since 4.23 a short code gets a readable name in its scheme (notation and scheme), and kg_vocab.py lint checks the codes in prose, with a ratchet
Pre-registered criterionx_criterion gives each version of a yardstick a node and a sha256, and x_measured_under ties a result to the version it was measured under; changing the yardstick after seeing the data shows up as a post-hoc warning, and kg_criterion.py checks the sha256 against the text or the file (kg-ssot.criterion/1)
The trace that resolveskg_trace.py check --root . checks each node's trace: anchor against the files of the repository (integrity.trace-target-missing, kg-ssot.trace/1), and counts apart what it does not judge
Citations across repositorieskg_refs.py answers who cites a node before you delete it, and what changed in what you cite, over a declared list of local clones. A query, not an alarm: a change never alters the exit code, and an empty answer from a partial scan says so (kg-ssot.refs/1). It finds a wrong citation, not a missing one
Search by meaningkg_query.py --text <term> --semantic "<question>" finds the node when the question uses other words, fusing the text search and a local multilingual embedding model by RRF; optional (kg-ssot[vector]), pinned by sha256, and outside every verdict
Audit package by questionkg_audit.py exports one row per questionnaire item (the x_questionnaire profile), with the question, the answer, the verdict, the required and the given evidence with its date and due date, the evidence requests (role: evidence_request and evidence_requirement), the contradictions, the owner, and the gaps it computes, in CSV, XLSX (no dependency), or JSON (kg-ssot.audit/1)
Data-only suite512 cases with their own metaschema, in the style of the JSON-Schema-Test-Suite
Per-graph ratchetAdopt without a big-bang migration: inherited debt stays named and only shrinks
Vendor by tagNo copy-paste, no shared code: one sha256 stamp per file
Profile-driven migratorkg_migrate.py proposes the provenance the contract asks for, from rules the adopter declares, shows the plan first and writes with node-by-node invariance
PROV-O bridgekg_prov_export.py exports each node's provenance as prov:Entity and prov:Derivation in JSON-LD, for the W3C PROV ecosystem; --edges adds the edges, with cito:supports, cito:refutes and dcterms:replaces where a standard term exists
No platformPython 3.12 or later, PyYAML and jsonschema, installed with checked hashes (--require-hashes). No server, editor or assistant required

What KG-SSOT is not

If you need......use something elseWhat KG-SSOT gives you
A query language over a large graphA graph databaseA file format and a contract, with no server
Semantic web interoperabilityRDF, OWL, SHACLA small, closed YAML vocabulary that reads well in a diff, and a PROV-O export
Enterprise search over documentsA search platformNo connectors or index: only the graph the team writes
Retrieval over document chunks (RAG, GraphRAG)A vector store or a GraphRAG toolThe claims those documents make, the decisions taken on them, and what to revisit
A guarantee that a claim is trueHuman review, testsThe guarantee that it says where it came from and when it was verified

Status

  • Current: contract v4, release kg-ssot-v4.45.0. The reference reader passes 512 of 512 cases in latest/.
  • In use: three adopters run the gate in CI, one of them in production.
  • Next: v5 will fail a method outside the <class>: <detail> form, which only warns today.
  • Open: the semantic layer (freshness, contradiction, domain completeness) lives in optional/, and the reference reader does not implement it: it passes only the 10 valid cases there.

Documentation

ManualConcepts, format, contract, tools, recipes and troubleshooting
ADOPTING.mdThe complete adoption guide, with every edge case
The contractContract v4: the two levels, the codes and what changes between versions
spec/conformance/The suite format, the codes and how to measure a reader in another language
CHANGELOG.mdEvery release, newest first
llms.txt · llms-full.txtFor AI agents: the index with links, and the whole documentation in one file

Contributing

A contract change starts with a conformance case: the .kg.yaml that shows the behavior and the expected verdict. Releases are tags kg-ssot-vX.Y.Z of the development repository, where every pull request that touches spec/ or tools/ runs the suite and the kit tests in CI. The release mirror holds only what each tag ships, one commit per tag, and does not take pull requests: a proposal or a bug goes in as an issue, ideally with the case that shows it. A reader in another language is welcome: chapter 7 of the manual explains how to measure it.

License

The product (what the release ships, listed in spec/release.json: the contract, the suite, the .kg.yaml cases, the kit in tools/, ADOPTING.md, this README and the manual) is Apache-2.0: LICENSE, with the scope in NOTICE.

KG-SSOT was born inside the Onion framework, which now adopts it by tag like any other adopter. The product does not depend on it.

來源:README.md,提交 86945e2

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

28
  1. v4.45.0最新Nov 7, 2026
  2. v4.44.0Nov 6, 2026
  3. v4.43.0Nov 5, 2026
  4. v4.42.0Nov 4, 2026
  5. v4.41.0Nov 4, 2026
  6. v4.40.2Nov 3, 2026
  7. v4.40.1Oct 30, 2026
  8. v4.40.0Oct 30, 2026
  9. v4.39.1Oct 29, 2026
  10. v4.30.0Oct 26, 2026
  11. v4.29.1Oct 26, 2026
  12. v4.26.0Oct 25, 2026
  13. v4.25.0Oct 24, 2026
  14. v4.22.0Oct 23, 2026
  15. v4.21.0Oct 23, 2026
  16. v4.20.0Oct 23, 2026
  17. v4.19.1Oct 22, 2026
  18. v4.18.0Oct 22, 2026
  19. v4.17.2Oct 22, 2026
  20. v4.17.0Oct 21, 2026
  21. v4.16.0Oct 21, 2026
  22. v4.15.0Oct 21, 2026
  23. v4.13.1Oct 21, 2026
  24. v4.12.0Oct 20, 2026
  25. v4.11.0Oct 20, 2026
  26. v4.10.0Oct 20, 2026
  27. v4.9.1Oct 18, 2026
  28. v4.9.0Oct 18, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分