一键导入
wiki-graph-index
Extract Obsidian-style relationships (wikilinks, tags, aliases) into a structured AI-friendly SQLite graph database.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Extract Obsidian-style relationships (wikilinks, tags, aliases) into a structured AI-friendly SQLite graph database.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Compile raw sources into detailed, Obsidian-compatible, interlinked Markdown pages under wiki/ references/ and concepts/.
Deduplicates concepts, splits overly broad concepts, and synthesizes multi-source concept definitions by dynamically searching and analyzing all papers that reference them.
Ingest new academic papers or PDFs into the raw/ folder of your active topic wiki using the local OCR model configured in config.yaml.
Ingest new academic papers, notes, or web articles into the raw/ folder of your active topic wiki.
Initialize a new topic workspace folder with standard raw/, wiki/, inbox/, and output/ directories.
Statically check and repair double-bracket linkages and frontmatter within your compiled wiki directory.
基于 SOC 职业分类
| name | wiki_graph_index |
| description | Extract Obsidian-style relationships (wikilinks, tags, aliases) into a structured AI-friendly SQLite graph database. |
| commands | {"graph":"Extract a SQLite knowledge graph from the wiki."} |
Resolving script paths (read first): Commands below invoke scripts as
<BIN>/X.py(and a few as<SKILLS>/...). Resolve these to absolute paths once before running anything:
<SKILL_DIR>= the directory thisSKILL.mdlives in.<SKILLS>= theskills/folder containing this skill =<SKILL_DIR>/..<BIN>= thebin/folder beside it =<SKILL_DIR>/../../binDo not hardcode a fixed prefix like
.agents/binor../bin: shell relative paths resolve against the current working directory (usually the topic root), not this skill's location. Once resolved,<BIN>is typically.agents/binwhen invoked from the hub root, or.claude/binfrom inside a topic directory.
This skill extracts the Markdown-based knowledge graph (comprised of [[wikilinks]], tags, and aliases) into a structured SQLite database (output/graph.db) that an AI agent can easily query using standard SQL.
When the user asks to extract, index, or query the knowledge graph of their wiki:
Run the deterministic python script to extract the graph from the markdown files:
python <BIN>/llm-wiki.py graph <TOPIC_DIR>
This will parse all markdown files under wiki/ (ignoring _index.md), extract frontmatter (tags, aliases) and body links, and rebuild the SQLite database located at output/graph.db.
Once built, you (the AI) can query output/graph.db using Python's sqlite3 module to traverse the graph and answer the user's questions.
The database schema is as follows:
nodes(id, path, title, type, category, summary, created, updated)
id: The file path without extension (e.g., 'concepts/concept_name') or a tag (e.g., 'tag:machine-learning').edges(source_id, target_id, type)
type can be 'wikilink' (between files) or 'has_tag' (from file to tag node).tags(node_id, tag)aliases(node_id, alias)Use python <BIN>/query-graph.py "<SQL>" --db <TOPIC_DIR>/output/graph.db to query the knowledge graph. Do not use direct sqlite3 command line execution.
Example:
python <BIN>/query-graph.py "SELECT source_id FROM edges WHERE target_id = 'Transformer';" --db <TOPIC_DIR>/output/graph.db
Or via a temporary Python script if you need complex graph traversal.
Present the findings of your graph queries to the user.