원클릭으로
wittsrc-graph
知识图谱遍历:基于抽取的 typed links(cites/evolves_to/contradicts/influenced_by) 执行递归图查询。回答关系型问题,如"Ms-114 和 Ms-152 之间有什么关系"、 "语言游戏概念是如何演变的"。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
知识图谱遍历:基于抽取的 typed links(cites/evolves_to/contradicts/influenced_by) 执行递归图查询。回答关系型问题,如"Ms-114 和 Ms-152 之间有什么关系"、 "语言游戏概念是如何演变的"。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
对 Brain Pages 执行分级实体富化。 Tier 3(单次提及)→ Tier 2(3次提及或跨来源)→ Tier 1(8次提及或核心人物/概念)。 从 SEP/IEP 百科、Gutenberg 简介中提取补充信息。
将 Wittgenstein 语料(WittSrc/Clarino/Gutenberg)导入 Brain Pages。 识别文件类型,按规则路由到 brain/ 目录(works/concepts/people/timelines), 执行 chunking、embedding 和去重。
零 LLM 抽取 Wittgenstein 文本中的实体引用,生成 typed links 构建知识图谱。 通过正则匹配手稿编号、人名、哲学概念,生成 cites/evolves_to/contradicts/influenced_by 关系。
维护 Brain 健康状态:检查孤儿页(无入链)、死链接(目标不存在)、 过期页(90天未更新)、引用审计和标签一致性。
混合搜索:结合向量检索(pgvector)、关键词检索(tsvector)和 Reciprocal Rank Fusion(RRF), 对 Wittgenstein Brain 进行多层检索。支持意图分类、多查询扩展、编译真理提升。
Wittgenstein Brain — 给维特根斯坦 Persona 专用的记忆系统。 将 Wittgenstein 学术语料(WittSrc/Clarino/Gutenberg)转化为可查询、可链接、可追踪的 Brain Pages, 并通过混合搜索 + 知识图谱为蒸馏流水线提供知识检索能力。 使用当用户想要: - 将 Wittgenstein 手稿语料导入 Brain - 查询某个哲学概念在手稿中的演变 - 生成手稿间引用关系图 - 为 Wittgenstein Persona 提供知识检索 - 从语料中提取实体(人名/概念/手稿编号)
| name | wittsrc-graph |
| version | 1.0.0 |
| description | 知识图谱遍历:基于抽取的 typed links(cites/evolves_to/contradicts/influenced_by) 执行递归图查询。回答关系型问题,如"Ms-114 和 Ms-152 之间有什么关系"、 "语言游戏概念是如何演变的"。 |
| triggers | ["图查询","graph query","关系图","手稿.*演变","how.*connect","who.*linked","知识图谱"] |
| tools | ["wittsrc-graph-query"] |
| mutating | false |
基于 typed links 构建的 Wittgenstein Nachlass 知识图谱进行图遍历查询。
{
"nodes": { "[slug]": { "type": "work|concept|person", "period": [start, end], "label": "..." } },
"edges": [
{ "from": "work-ms-114", "to": "work-ts-207", "type": "evolves_to" },
{ "from": "work-ms-152", "to": "concept-private-language", "type": "defines" }
]
}
# 查询某个节点的所有关系
bun run scripts/wittsrc-graph-query.ts work-ms-114
# 只看 evolves_to 关系
bun run scripts/wittsrc-graph-query.ts work-ms-114 --type evolves_to
# 2 度遍历(谁引用了 Ms-114 引用的内容)
bun run scripts/wittsrc-graph-query.ts work-ms-114 --depth 2 --direction both
# 只看入链(谁引用了 Ms-114)
bun run scripts/wittsrc-graph-query.ts work-ms-114 --direction in
# 只看出链(Ms-114 引用了什么)
bun run scripts/wittsrc-graph-query.ts work-ms-114 --direction out
# 查询路径(两个节点之间的路径)
bun run scripts/wittsrc-graph-query.ts work-ms-114 --path-to work-ts-207
# 过滤类型(找所有矛盾关系)
bun run scripts/wittsrc-graph-query.ts --type contradicts --depth 1
// 伪代码:图遍历(避免循环)
function graphQuery(
startSlug: string,
type?: LinkType,
direction: 'in' | 'out' | 'both' = 'both',
depth: number = 3,
maxDepth: number = 10
): GraphResult {
const visited = new Set<string>();
const queue: Array<{ slug: string; depth: number }> = [{ slug: startSlug, depth: 0 }];
const results: Edge[] = [];
while (queue.length > 0) {
const { slug, depth } = queue.shift()!;
if (visited.has(slug) || depth > maxDepth) continue;
visited.add(slug);
const edges = loadEdges(slug, type, direction);
for (const edge of edges) {
results.push(edge);
queue.push({ slug: edge.target, depth: depth + 1 });
}
}
return { nodes: [...visited], edges: results };
}
bun run scripts/wittsrc-graph-query.ts concept-language-game --type evolves_to --depth 3
返回:
concept-language-game (Language Game)
├── defines ──► work-ts-207 (Ts-207, 1929)
│ └── evolves_to ──► work-ts-212 (Ts-212 Big Typescript, 1937)
│ └── evolves_to ──► work-pi (PI, 1953)
└── influenced_by ──► person-russell (Russell, early discussions)
bun run scripts/wittsrc-graph-query.ts --type contradicts --depth 1
返回所有存在 contradicts 边的节点对:
Ms-152 ──contradicts──► PI §243 (private language)
Ms-114 ──contradicts──► Ts-207 (early vs middle)
Ts-212 ──contradicts──► Tractatus (post-publication shift)
bun run scripts/wittsrc-graph-query.ts work-ms-114 --path-to work-pi
返回最短路径:
work-ms-114 (1912-1916)
└── evolves_to ──► work-ts-207 (1929-1931)
└── evolves_to ──► work-ts-212 (1937-1938)
└── evolves_to ──► work-pi (1938-1951)
图查询可以回答:
查询特定概念的提及频率分布(哪些时期讨论最多):
bun run scripts/wittsrc-graph-query.ts concept-private-language --type defines --depth 1 | \
jq '.edges | group_by(.period) | map({period: .[0].period, count: length})'
maxDepth=10,防止 DoSvisited set 防止重复遍历nodes 字典)