
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
概览
本地 MCP 服务器,管理纯文本企业知识图谱:已确认的论断必须注明来源,决策会被追踪并定期复核。
- 可以做什么
- 按契约校验图谱,只写入通过校验的内容
- 读取、列出节点并查看图谱存储的历史
- 跨语料查询节点与边,并解析边另一端的标签
- 查询决策、其取代的内容、支撑依据以及哪些需要复核
- 提供契约说明、最小可通过示例和常见错误码的修复方法
- 解析领域词表术语
- 适用场景
- 适用于团队或智能体群体把结论、决策及其出处保存在受版本控制的文件中,并希望助手在不丢失来源和复核日期的前提下写入、校验和查询这些内容。适合已用 .kg.yaml 图谱承载知识的仓库,而非文档分块检索场景。
- 运行要求
- 以本地 stdio 进程运行,通过 kg-mcp --root 指向图谱目录启动;可从 PyPI 安装(需 Python 3.12 或更高版本、PyYAML 与 jsonschema),用 uvx 或 pip 安装,也可作为 Claude Desktop 的一键 .mcpb 扩展。未声明认证、环境变量或请求头。可选的相似度搜索需安装 vector 附加组件。
安装
在 SourceWeft 中
- 打开 控制台中的 KG-SSOT,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
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
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
confirmedor production node without provenance fails (a claim with no recoverable source is declaredunverifiableinstead); - 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
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
Or straight from the repository, with hash-checked dependencies:
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
A node, inside
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.
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.
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
- 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.
- 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.
- 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
What KG-SSOT is not
Status
- Current: contract v4, release
kg-ssot-v4.45.0. The reference reader passes 512 of 512 cases inlatest/. - In use: three adopters run the gate in CI, one of them in production.
- Next: v5 will fail a
methodoutside 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
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版本历史
28- v4.45.0最新Nov 7, 2026
- v4.44.0Nov 6, 2026
- v4.43.0Nov 5, 2026
- v4.42.0Nov 4, 2026
- v4.41.0Nov 4, 2026
- v4.40.2Nov 3, 2026
- v4.40.1Oct 30, 2026
- v4.40.0Oct 30, 2026
- v4.39.1Oct 29, 2026
- v4.30.0Oct 26, 2026
- v4.29.1Oct 26, 2026
- v4.26.0Oct 25, 2026
- v4.25.0Oct 24, 2026
- v4.22.0Oct 23, 2026
- v4.21.0Oct 23, 2026
- v4.20.0Oct 23, 2026
- v4.19.1Oct 22, 2026
- v4.18.0Oct 22, 2026
- v4.17.2Oct 22, 2026
- v4.17.0Oct 21, 2026
- v4.16.0Oct 21, 2026
- v4.15.0Oct 21, 2026
- v4.13.1Oct 21, 2026
- v4.12.0Oct 20, 2026
- v4.11.0Oct 20, 2026
- v4.10.0Oct 20, 2026
- v4.9.1Oct 18, 2026
- v4.9.0Oct 18, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分