Graph Engineering 标志

Graph Engineering

社区
codejunkie99
graph-engineering

教智能体掌握图工程的两大方面:知识图谱(本体设计、实体/关系/事件抽取、融合、GraphRAG/记忆服务;内容提炼并翻译自东南大学研究生课程《知识图谱》,npubird/KnowledgeGraphCourse,获 4.4K 个 star)和任务图(智能体编排——并行分发、验证器分离、停止规则、人工审核关卡)。用户要求构建知识图谱、从文本中抽取实体/关系、设计本体、去重/合并实体、为智能体添加图记忆或 GraphRAG、以图的形式编排多智能体工作流,或学习图工程时使用。在教学模式下,智能体会逐步讲解各个阶段,提供完整示例并生成可视化图示工件。

概览

发布者codejunkie99
代码仓库graph-engineering
技能名称graph-engineering
星标数
539
复刻数
68
附带文件
5
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 5 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 codejunkie99 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Graph Engineering AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/codejunkie99/graph-engineering/tree/master/graph-engineering
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/codejunkie99/graph-engineering.git /tmp/graph-engineering
mkdir -p .claude/skills
cp -r /tmp/graph-engineering/graph-engineering .claude/skills/graph-engineering
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Graph Engineering,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Graph Engineering。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Graph Engineering 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Graph Engineering

Graph engineering is the discipline of designing the structures agents work through — not the prompts. It has two halves:

  1. Knowledge graphs — what agents remember. Nodes are entities and facts, edges are relationships with time and provenance. This file's 9-stage pipeline covers it, distilled from Southeast University's graduate KG course (https://github.com/npubird/KnowledgeGraphCourse, Prof. Peng Wang), translated to English and adapted for LLM-era agents.
  2. Task graphs — how agents work. Nodes are jobs, edges are execution dependencies: parallel fan-out, separate verifier contexts, the stop rule, the human gate. Read references/task-graphs.md when the request is about orchestrating agents rather than building memory.

Core mental model: a knowledge graph is a product with a schema, not a pile of triples. Quality comes from the pipeline order — model the domain BEFORE extracting, fuse BEFORE storing, evaluate at every stage.

Teaching Mode

When the user wants to LEARN graph engineering (rather than build something), teach it — do not just execute. Rules:

  1. Anchor every stage in the user's own domain: ask for one real project or dataset, then use it as the running example through all stages.
  2. Generate visual artifacts as you teach. Concepts in this discipline are shapes; show them. For each major concept, produce a small diagram the user can keep — mermaid diagrams (flowchart for the pipeline and task graphs, graph LR for example ontologies and subgraphs) or a single self-contained HTML page when interactivity helps. At minimum: the 9-stage pipeline, a 3-type ontology drawn from the user's domain, one extracted subgraph (5-10 nodes) from a real sample, and the diamond pattern with the user's own jobs as nodes.
  3. Teach in the pipeline's order, one stage per exchange, each ending with a small exercise ("write 3 competency questions for your project") before moving on.
  4. Close by assembling what was built during the lesson into a starter ontology.yaml and a drawn task graph for the user's first real build.

The 9-Stage Pipeline

Run stages in order. For small projects stages 4-6 collapse into one extraction pass, but never skip stages 3 (ontology) or 8 (fusion) — they are where real-world graphs fail.

  1. Scope & value test — Confirm a graph beats a simpler structure. A graph pays off when queries are multi-hop ("who worked with X on projects using Y"), when entities recur across documents, or when relationships ARE the data. If lookups are single-hop, use a table and stop.

  2. Knowledge representation choice — Pick how facts are encoded: property graph (Neo4j-style, pragmatic default), RDF triples (interop/standards), or plain typed edges in JSON/SQLite (small scale). Decide now how time and provenance attach to every fact.

  3. Ontology modeling — Define entity types, relation types (with domain/range), and attributes BEFORE extraction. Start minimal: 5-15 entity types, 10-30 relation types. Two rules from the course: every relation gets a precise verb name (ACQUIRED, not RELATED_TO), and if two types are always queried together, merge them. Details and worked examples: references/modeling.md

  4. Entity extraction (NER) — Extract typed entities from sources. Method ladder: exact rules/dictionaries for closed vocabularies → LLM extraction with the ontology in the prompt for open text. Always extract with span + source pointer for provenance.

  5. Relation extraction — Extract typed edges between recognized entities. Constrain the LLM to the ontology's relation list with domain/range checks; reject edges whose endpoints have incompatible types. This one validation step removes most hallucinated structure.

  6. Event extraction — For dynamic domains (news, logs, transactions), extract events as first-class nodes (trigger + typed arguments + time), not just static edges. Extraction methods, prompt patterns, and failure modes for stages 4-6: references/extraction.md

  7. Quality gate — Before fusion, sample and score: entity precision (are extracted entities real and correctly typed?), relation precision (does the source sentence actually assert the edge?). Fix the prompt/rules, not the output, then re-run. Target ≥90% precision on a 50-item sample before proceeding — recall improves with more passes; bad precision poisons the graph permanently.

  8. Knowledge fusion — Merge duplicates within and across sources: same real-world entity, different surface forms ("SEU" = "Southeast University" = "东南大学"). Blocking + matching + merge policy. Skipping this is the #1 cause of useless graphs. Matching strategies: references/fusion-and-llm.md

  9. Serve to LLMs (KG × LLM) — Make the graph useful to agents: GraphRAG retrieval (subgraph → context), graph-as-memory (agent writes facts back through stages 4-8), and LLM-as-reasoner over paths. Patterns and pitfalls: references/fusion-and-llm.md

Working Rules

  • Schema first, always. Extraction without an ontology produces a "graph" that is really a word cloud with arrows. If the user resists schema design, build the minimal 5-type ontology from 3 sample documents and show it for approval.
  • Provenance on every fact. Each node/edge stores source, extracted_at, and confidence. Non-negotiable — fusion (stage 8) and trust both depend on it.
  • Incremental over big-bang. Process a 10-document pilot through all 9 stages before scaling. The pilot exposes ontology gaps at 1% of the cost.
  • LLM extraction is stage machinery, not the pipeline. The LLM slots into stages 4-6; the surrounding schema, validation, and fusion are what make the output a knowledge graph.

Reference Files

  • references/curriculum.md — Full translated curriculum of the source course with per-lecture summaries and links to the original Chinese slide decks. Read when the user wants theory depth, the academic grounding, or the original materials.
  • references/modeling.md — Knowledge representation & ontology engineering (course lectures 2-3). Read during stages 2-3.
  • references/extraction.md — Entity, relation, and event extraction from rules to LLM prompting (lectures 4-7). Read during stages 4-7.
  • references/fusion-and-llm.md — Knowledge fusion and KG × LLM integration (lectures 8-9). Read during stages 8-9.

Credits

Distilled and translated from 东南大学《知识图谱》研究生课程 (Southeast University graduate course on Knowledge Graphs), Prof. Peng Wang — https://github.com/npubird/KnowledgeGraphCourse. All original lecture PDFs are in Chinese; this skill is an independent English distillation adapted for AI-agent workflows.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Graph Engineering AI 技能有什么作用?

教智能体掌握图工程的两大方面:知识图谱(本体设计、实体/关系/事件抽取、融合、GraphRAG/记忆服务;内容提炼并翻译自东南大学研究生课程《知识图谱》,npubird/KnowledgeGraphCourse,获 4.4K 个 star)和任务图(智能体编排——并行分发、验证器分离、停止规则、人工审核关卡)。用户要求构建知识图谱、从文本中抽取实体/关系、设计本体、去重/合并实体、为智能体添加图记忆或 GraphRAG、以图的形式编排多智能体工作流,或学习图工程时使用。在教学模式下,智能体会逐步讲解各个阶段,提供完整示例并生成可视化图示工件。

为什么在 TypingMind 中使用 Graph Engineering?

因为您只需安装一次,就能搭配任何模型使用。Graph Engineering 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Graph Engineering?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/codejunkie99/graph-engineering/tree/master/graph-engineering。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Graph Engineering?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Graph Engineering 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Graph Engineering 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Graph Engineering AI 技能免费吗?

是的。codejunkie99 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇