knoten
每个想法都是一个 Git 仓库中的 Markdown 文件,标记为 alive(活跃)、dead(已废弃)或 retracted(已撤回)。如果某个想法已废弃,节点会记录原因、使其复活的条件以及可复现的代码。
工作原理
图谱是一个文件夹。节点是一个 Markdown 文件:机器读取元数据,人类阅读正文,代码用于复现。
---
id: hyp-self-consistency
type: hypothesis
status: dead
cause: weak_baseline
links:
- {rel: kn:killedByGate, to: method-compute-matched-baseline}
repro:
script: experiments/self_consistency.py
model: Qwen3-8B-Instruct
data: GSM8K test, 1319 questions
cmd: python experiments/self_consistency.py --n 5 --temp 0.7
results:
acc_greedy: 0.741
acc_self_consistency: 0.792
acc_compute_matched_baseline: 0.788
tokens_per_question: 1420
n_independent: 1319
---
# Self-consistency (sample 5, majority vote) beats greedy decoding
## Verdict: DEAD
Sampling 5 chains and taking the majority scored 79.2% vs 74.1% greedy. +5.1 points.
It looked like a free win.
## Why it died
It is not free. It costs **5x the tokens**, and given the same budget a longer-CoT
baseline reaches **78.8%**. The entire gain was compute, not method.
```python
# reproduce the kill:
python experiments/self_consistency.py --n 5 --compare compute_matched
```
## What would reopen this
A task where the majority-vote *aggregation* does real work, i.e. where the gain
survives a compute-matched baseline. Plausible for code execution or theorem proving.
GSM8K is not that task.三个月后,当有人再次提出自洽性方案时:
$ knoten query "self-consistency"
[✗ DEAD] hyp-self-consistency
killed by : method-compute-matched-baseline
reopen if : A task where the majority-vote aggregation does real work, i.e.
where the gain survives a compute-matched baseline…Related MCP server: hive-memory
使用方法
pip install -e . # the CLI is the agent surface; add ".[mcp]" only for shell-less clients
knoten init my-topic # a new graph (it's a folder)
# deciding what to do
knoten frontier # what should I work on next?
knoten index # the whole graph, one line per node
knoten index --tag decoding # ...narrowed to one corner of it
knoten index --since 2026-08-01 # ...or to what moved this month
knoten query <term> # has this been tried, by keyword?
knoten show <node> # edges, results, attachments
knoten gates # what must a claim survive here?
# recording what happened
knoten new hypothesis hyp-idea # scaffold a node with whatever the rules demand
knoten commit <node> --frontmatter <f> --body <f> # file a claim, gate-checked before it touches disk
knoten update <node> --status dead --append <f> # move a node through its lifecycle, append to it
knoten attach <node> <file>... # attach a script, plot or notebook
knoten detach <node> <file>
# keeping it honest
knoten validate # enforce this graph's own rules
knoten hook # make `git commit` refuse a broken graph
knoten path A B # how did we get from A to B?上述所有读取命令也支持 --json 参数;默认输出正文,因为阅读成本更低(参见下文"面向编码代理"),--json 适用于脚本和嵌套数据。
每个图谱在 graph.yaml 中声明自己的规则。knoten 对你的领域一无所知,它只强制执行你指定的规则。示例图谱要求每个声明报告 tokens_per_question 并基于至少 30 个独立问题;不同主题会有完全不同的要求。
rules:
- id: underpowered
when_type: hypothesis
require_result_min: {n_independent: 30}
message: A result on fewer than 30 independent questions is noise, not evidence.
- id: deaths-must-name-a-cause
when_status: dead
require_field_one_of:
cause: [no_signal, cost_hurdle, weak_baseline, underpowered, crowding_decay]
message: A cause of death you cannot filter on is a story, not an index.最后这一点正是让死胡同变得可复用的关键。一旦原因从一句话变成一个字段,六个月后你真正要问的问题就变成了一个查询:
knoten index --where cause=weak_baseline # we have a stronger baseline now — what reopens?你的图谱也声明自己的词汇表,并且同样强制执行:
node_types: [hypothesis, experiment, finding, method, source]
statuses: [open, alive, dead, retracted, superseded, active]
tags: [decoding, reasoning, prompting, evaluation, gate]type: hypthesis 是拼写错误,不是新类型。status: ded 比错误更糟糕——它会悄无声息地将该声明从所有查询中排除,而这正是本工具要防止的那种静默腐烂。两者现在都是违规行为。tags: [decodng] 也是如此:标签是你对大型图谱进行筛选的维度,因此拼写错误的标签会使节点留在图谱中,却无法在任何视图中显示。如果不声明 tags:,标签功能保持自由——核心不发明任何词汇,只强制执行你声明的词汇。
knoten 无法识别的规则键或配置键会触发硬错误,而非忽略。不执行任何操作的配置只是装饰,不执行任何操作的规则比没有规则更糟糕,因为你会以为自己受到了保护。
knoten new 读取这些规则并预先填充它们要求的所有内容——脚手架中没有 knoten 的意见,只有你的图谱的意见。值故意设为 TODO,这样 new + validate 就变成了一个检查清单,而不是猜谜游戏:
$ knoten new hypothesis hyp-my-idea --status dead
+ nodes/hyp-my-idea.md (hypothesis, dead)
pre-filled what THIS graph's rules require:
## Why it died, ## What would reopen this, tokens_per_question, n_independent本工具要防止的失败是由摩擦引起的,因此写入路径是摩擦最严重的地方。写正文,而不是写那些只有被拒绝过才能发现的样板文件。
关卡是一个 Git 钩子
knoten hook # after `git init`git commit 现在会运行 knoten validate,并拒绝违反自身规则的图谱:
$ git commit -m "self-consistency is a win"
✗ hyp-self-consistency
[live-claims-must-cite-their-gates] An unchallenged claim is not a finding, it is a hope.
1 violation(s) — commit REJECTED只有在你记得询问时才会触发的规则,正是让上一次尝试腐烂的规则。把它放在你无法绕过的地方。(git commit --no-verify 可以绕过——但你应该有理由。)
附加代码和图表
节点不仅仅是一个声明。它还包含重新运行所需的一切。
knoten attach hyp-self-consistency experiments/self_consistency.py accuracy_vs_budget.png文件被复制到 attachments/<node-id>/ 目录下,在元数据中列出,图片则嵌入节点正文,以便在 GitHub 上渲染:
attachments/hyp-self-consistency/
self_consistency.py the script that KILLED it
accuracy_vs_budget.png the plot that shows why然后 knoten validate 会在节点列出不存在的附件时报错。无法复现的声明就是有缺陷的节点。
knoten show hyp-self-consistency # edges, results, attachments
knoten detach hyp-self-consistency accuracy_vs_budget.png接下来做什么?
一个只能回答"这个试过吗?"的图谱只是一个文件柜。frontier 是唯一能回答"接下来做什么?"的界面:
$ knoten frontier
OPEN — started, never settled
hyp-batch-schedule Does the LR schedule interact with batch size?
REOPENABLE — died, but said what would bring them back
hyp-self-consistency Self-consistency (sample 5, majority vote) beats greedy
reopen if : A task where the majority-vote aggregation is doing real work…
UNTESTED GATES — no claim has been through them
method-holdout-period Gate: hold out the last 20%一个带有待定条件的死胡同比一个新想法更便宜的实验,因为设计已经写好了。这就是 ## What would reopen this 的作用:如果没有地方展示它,要利用它就意味着重新阅读图谱中的每一篇事后分析。
knoten 不会判断条件是否满足。那是一个判断,属于研究本身。它只是把待定条件放在你无法忽视的地方。
"这个试过吗?"——以及"类似的东西?"
两个不同的问题。query 通过关键词回答第一个问题,按每个节点的匹配程度排序——部分匹配也会显示,所以用节点从未使用过的词语表述的问题仍然能找到它:
$ knoten query "has anyone tried self-consistency?"
[✗ DEAD] hyp-self-consistency
killed by : method-compute-matched-baseline
reopen if : A task where the majority-vote aggregation does real work…但关键词搜索无法回答第二个问题。一个与已废弃节点措辞不同的想法不会匹配,而自信地认为"未发现先前工作"正是本工具要防止的那种代价高昂的失败。因此 index 打印整个图谱,每行一个节点,让读者自行判断:
$ knoten index --tag decoding
hyp-self-consistency ✗ DEAD [decoding,reasoning] Self-consistency (sample 5, majority vote) beats greedy decoding这足够便宜,可以完整阅读——整个图谱,而不是猜测哪部分相关。对于代理来说,这比宽泛的 query 更便宜,因为一行是一个声明而不是整个节点:在一个 500 节点的图谱上,宽泛查询返回约 83k 个 token,同一图谱的索引约 9k 个 token,一个标签就能缩小到约 2.5k 个 token。
声明必须经受的考验
一个声明只有在引用了它经受过的关卡时才能标记为 alive。在提交时满足关卡的代理已经花费了计算资源进行实验,但结果却无法归档。gates 将规范放在工作之前:
$ knoten gates
method-compute-matched-baseline (killed 1, survived by 1)
Gate: compute-matched baseline
the rule : Any method that spends more inference compute must be compared against a
baseline given the same budget — not against greedy decoding at 1x.右侧的记录是免费的——反向链接已经存在——而且它是更有趣的一半。一个从未杀死任何东西也从未验证任何东西的关卡从未被应用过,这要么是无用的检查,要么是没人运行的检查。
两个读者,一个文件
人类浏览正文,了解故事:尝试了什么,什么杀死了它,还有什么仍然开放。没有数据库,没有 UI,只有你可以在任何编辑器或 GitHub 上阅读的 Markdown。
代理遍历元数据:类型化边(kn:killedByGate、kn:survivedGate)、结构化 results、包含确切脚本/模型/数据/命令的 repro 块,以及任何附加脚本和图表的路径,它们可以直接读取和重新运行。代理回答"这个试过吗?"和"如何复现?"时无需阅读任何正文。
同一个文件服务于两者。这就是整个设计。
面向编码代理
SKILL.md 位于仓库根目录,是代理学习 knoten 的方式——将 Claude Code 或任何其他有 shell 的工具指向它。循环就是 CLI 本身,它跨会话积累关于某个主题的知识,而不是每次都从零开始:
knoten frontier # 1. what should I work on next?
knoten index --tag decoding # 2. anything LIKE this been tried?
knoten query "self-consistency" # ...or by keyword, if it has a name
knoten show hyp-self-consistency # 3. the full node, post-mortem included
knoten gates # 4. what must the result survive?
knoten commit hyp-idea --frontmatter fm.yaml --body body.md # 5. file it, pass or fail
knoten update hyp-idea --status dead --append postmortem.md # ...or close one opened earlier
knoten attach hyp-idea script.py plot.png # 6. and the code that proves it
knoten path A B # how did we get from A to B?输出默认为正文——阅读它。上述所有读取命令都支持 --json,用于脚本和嵌套数据,但它的阅读成本高于节省的成本:同一个 55 节点图谱,列式正文约 1,185 个 token,而 JSON 约 2,551 个 token(21 vs 46 token/节点——2.2 倍)。可以使用 --json,但不要默认使用它。
--frontmatter、--body 和 --append 各接受一个文件路径或 -(标准输入)。knoten update 也接受 --result key=value(可重复,记录结果)和 --link rel=to(可重复,添加边——例如声明刚刚经受过的关卡):
knoten update hyp-idea --status alive --link kn:survivedGate=method-compute-matched-baselineknoten update 追加内容、移动状态,并设置废弃声明应命名的字段:
knoten update hyp-self-consistency --status dead \
--append post-mortem.md --field cause=weak_baseline--field 设置任何顶级键,包括已记录的键。--result 仍然拒绝更改节点已携带的数字——向声明追加内容是生命周期,而重写已发布的结果正是撤回的用途。
限制编辑的是图谱自身的规则,而不是字段名列表:修改后的节点会在内存中解析和检查,如果失败则永远不会写入磁盘。validate 也拒绝与文件名不一致的元数据 id:——文件名就是 id,所以声称其他内容的节点在自相矛盾,而每个查询仍然会解析它。
退出码是信号:0 表示成功,1 表示拒绝或违反规则。拒绝是特性——阅读消息,修复节点,重新运行。
需要一周的实验不会在启动它的会话中完成。因此代理可以将假设打开为 open(knoten index --status open 显示已开始但未完成的内容),稍后回来关闭它。knoten update 追加内容并移动状态;它不能重写正文或更改已记录的结果,并且它运行与 knoten commit 相同的关卡——所以声明仍然不能在没有引用它经受过的内容的情况下变为 alive。对声明的更正仍然是一个新节点。Git 保存了前后对比。
代理在运行实验前读取图谱,在实验完成后写回结果,包括实验失败时。 一个记录了死亡原因的死假设是图谱中最有价值的节点,也是否则会丢失的节点。它还会写回证据:knoten attach 将运行的脚本和制作的图表放入节点——无法复现的声明是六个月后没人信任的声明。
它还会在代理即将提交相同问题两次时告知代理。运行数周的循环会重新提出已经解决过的想法,措辞不同,使用新的 id——所以 knoten commit 报告新节点与已解决的声明相似之处,并拒绝记录一个闪亮结果但未引用它经受过的测试的声明:
{"status": "COMMITTED",
"similar": [{"id": "hyp-self-consistency", "verdict": "DEAD",
"why_it_died": "The gain was compute, not method…"}],
"warning": "This resembles 1 settled claim. If it is the same question, supersede or
retract that node rather than leaving two answers in the graph."}{"status": "REJECTED",
"violations": [{"rule": "live-claims-must-cite-their-gates",
"message": "An unchallenged claim is not a finding, it is a hope."}]}ops.py 包含每个读取操作(index、query、frontier、gates、show、validate、path)背后的单一实现,作为返回字典的普通函数。CLI 将该字典渲染为正文或使用 --json 转储;commit 和 update 也是共享函数。只有一个需要保持正确的行为,而不是两个可能偏离的行为。
没有 shell 的客户端(MCP)
并非每个代理都有 Bash。对于连接到 MCP 服务器而非编码代理的聊天 UI,图谱仍然可访问——只是代价比 CLI 更高:MCP 在每个会话中加载约 2,340 个 token 的工具模式和指令,无论代理是否接触图谱(1,928 个模式 + 412 个指令),而 knoten --help 约 304 个 token,且仅在询问时加载。如果客户端可以运行 CLI,请使用 CLI 和上面的 SKILL.md。
pip install -e ".[mcp]" # needs mcp 2.x{"mcpServers": {"knoten": {
"command": "knoten-mcp",
"env": {"KNOTEN_GRAPH": "/path/to/llm-research"}
}}}knoten_frontier() ← 1. what should I work on next?
knoten_index(tags=["decoding"]) ← 2. has anything LIKE this been tried?
knoten_query("self-consistency") ← ...or by keyword, if it has a name
knoten_get("hyp-self-consistency") ← 3. the full node, post-mortem included
knoten_gates() ← 4. what must the result survive?
knoten_commit(node) ← 5. file it, pass or fail
knoten_update(node, status="dead", append=…) ← ...or close one opened earlier
knoten_attach(node, [script, plot]) ← 6. and the code that proves it
knoten_path(a, b) ← how did we get from A to B?
knoten_validate() ← run the graph's own rules服务器在连接时将该顺序作为 instructions 交给客户端,因此代理只需一次就知道循环如何组合,而不是从十个工具描述中猜测。这里的每个工具都是对 ops / commit / update 函数的薄封装——相同的关卡、相同的拒绝、上面显示的相同 JSON,只是序列化为工具结果而不是打印为正文。
为什么要费心
你不再重复已经运行过但忘记的实验。 死胡同带着死亡原因和重新运行的命令回来。
而且跨会话的工作仍然会被关闭。 代理打开一个假设,运行一周实验,并在返回时在同一节点上记录结论——所以还有什么仍然开放? 保持真实答案,而不是充满已解决但从未归档的问题。
而且你不再那么容易自欺欺人: 声明只有在引用它经受过的测试时才能标记为 alive,所以一个看起来不错但从未被检查的结果不能悄无声息地变成发现。
而且有缺陷的节点是响亮的失败,而不是安静的失败。 不可读的元数据、未知的边关系(kn:killdByGate——少了一个字母)、不存在的规则键:都是错误。一个静默丢弃无法解析内容的图谱在腐烂时仍报告自己健康。
而且后来被撤回的声明会说明这一点。 query 从两侧展示撤回信息,所以询问"这个试过吗?"关于后来被撤回的声明的代理会被告知它已被撤回——而不仅仅是声明的内容:
[✓ ALIVE] hyp-few-shot-format
survived : method-compute-matched-baseline
RETRACTED by : ret-oops参见 examples/llm-research/ 获取完整的图谱示例,以及 SPEC.md 了解设计。
MIT 许可证。一个运行时依赖:PyYAML。MCP 回退方案额外需要 mcp SDK(2.x——如果你从旧版 knoten 升级,运行 pip install -U 'knoten[mcp]')。没有框架,没有数据库,没有构建步骤:几个小模块,你可以一口气读完。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
FlicenseNot gradedqualityDmaintenanceProvides persistent long-term memory for AI coding agents by storing entities, relations, and observations across different sessions. It enables users to manage and query structured knowledge like coding preferences, project patterns, and technical solutions via a graph-based storage system.1- AlicenseNot gradedqualityCmaintenanceProvides AI coding agents with persistent, graph-connected memory across projects, enabling cross-project context retrieval via synaptic connections and hybrid search.186MIT
- AlicenseNot gradedqualityDmaintenanceEnables persistent memory for AI coding agents, allowing them to remember people, decisions, and context across sessions through a knowledge graph and automated briefings.15MIT
- AlicenseNot gradedqualityBmaintenanceEnables persistent, graph-based memory for AI agents, allowing them to store, traverse, and recall relationships between facts, decisions, and context across sessions for efficient reasoning and reduced token usage.MIT
Related MCP Connectors
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Persistent memory and knowledge graphs for AI agents. Hybrid search, context checkpoints, and more.
Shared debugging memory for AI coding agents
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/BY571/knoten'
If you have feedback or need assistance with the MCP directory API, please join our Discord server