D
dsh-ontology
v0.1.0 · 1 天前发布
A typed, inference-capable ontology (TBox + ABox) plugin for DeepSeek Harness — durable domain knowledge the agent can define, assert against, and query under schema constraints.
README
dsh-ontology
English | 中文
给 DeepSeek Harness 的本体论插件:一层带类型约束、可推理、跨会话持久的领域知识——由 Agent 自己声明词汇、按约束写入事实、再查询回来。
大多数 Agent 记忆本质是一袋字符串:写进去是散文,读出来还是散文,没有任何机制告诉它——刚记下的这条,和上周记的那条是矛盾的。这个插件给 Agent 的是一套它必须遵守的词汇:你先声明世界上有哪些类别、它们之间可以有什么关系,之后每一条断言都要先过这套模型的检查才能落盘;而能从已有事实推出来的事实,不必重复记录,查询时自动导出。
ontology_define 声明类与带类型的关系 (TBox,本体层)
ontology_assert 记录实体与事实 (ABox,写入前校验)
ontology_query 查询、遍历、推理
ontology_retract 删除,带依赖保护
为什么要 TBox,而不是一个笔记文件
| | 散文式记忆 | dsh-ontology |
|---|---|---|
| 结构 | 自由文本 | 类、带类型的关系、实体、三元组 |
| 错误输入 | 静默存下 | 拒绝,并指出违反了哪条约束 |
| 隐含事实 | 手工重述,逐渐漂移 | 由 transitive / symmetric / inverseOf 在读取时导出 |
| 撤回 | 孤儿文本留在原地 | 事实随实体级联删除;导出的事实随前提消失 |
| 读回来 | grep 然后碰运气 | 按类查(含子类)、三元组模式匹配、邻域展开、最短路径 |
约
版本兼容矩阵
| DSH 版本 | 状态 | 说明 |
|---|---|---|
dsh@0.1.0-rc.6 | ✅ 兼容 | cordis patch ✅ |
dsh@0.1.0 | ✅ 兼容 | 标准 patch ✅ |
dsh@0.2.0 | ⚠️ 待验证 | 待实测(API 可能在变) |
dsh@0.3.0+ | ❓ 未知 | 尚未发布 |
💡 兼容矩阵每周末自动跑实测,欢迎 PR 修正
元数据
- License
- MIT
- npm
- dsh-ontology
- Repo
- git+https://github.com/tancheng33/dsh-ontology.git
- Engines
{"node":"^22.19.0 || >=24.0.0"}- Weekly DL
- 0
- Monthly DL
- 0
- dsh.bundle
{"bundle":{"patch":"./cordis.patch.yml"}}