Plugin ID: kg-forge
Package: obsidian-kg-forge
Author: Jimmi (Jimmycarroll2021)
License: MIT
Turn your Obsidian vault into a best-in-class knowledge graph workspace. KG Forge extracts typed subject-predicate-object triples from your notes, enforces provenance on every fact, and gives you graph-powered tools such as GraphRAG prompts, schema validation, and competency-question tracking — all local-first and offline.
KG Forge is a standalone community plugin with zero external plugin dependencies. It reads the same markdown conventions used by tools like Breadcrumbs and Dataview, but does not require them to be installed.
- Extracts triples from YAML frontmatter, Breadcrumbs-style
## Connectionsfields, and wikilinks. - Types every node using folder → fileClass mappings (
algorithms/=algorithm,books/=book,concepts/=concept,papers/=paper). - Attaches provenance to every triple: source, confidence, timestamp, and lineage.
- Validates the vault schema: missing fileClass, malformed
source_ids, missing provenance, broken source links. - Builds GraphRAG prompts from a k-hop subgraph of typed triples, serialized as bullet facts with a “say so if facts don’t support” guard.
- Exports your graph as Neo4j Cypher
MERGEstatements or as Dataview query templates. - Tracks Competency Questions and checks whether the current schema can answer them.
- Clone or copy this repository into your vault’s
.obsidian/plugins/kg-forge/folder. - Install dependencies:
npm install
- Build the plugin:
npm run build
- In Obsidian, go to Settings → Community plugins → Installed plugins, enable KG Forge, and reload if prompted.
- Open Settings → Community plugins → Browse.
- Search for KG Forge.
- Install and enable.
- Open Settings → KG Forge.
- Confirm the folder → fileClass mappings match your vault (defaults:
algorithms,books,concepts,papers). - Set the path to your source map (default:
papers/index.md). - Open any note and run KG Forge: Extract triples from current note.
- Open the Knowledge Forge Graph view from the left ribbon or command palette to browse typed edges.
- Run KG Forge: Build GraphRAG prompt to copy a grounded prompt to your clipboard.
KG Forge is local-first and does not send data to remote services. The plugin does request the following capabilities:
- Vault enumeration: Commands such as Validate vault schema, Export triples as Cypher, and Build GraphRAG prompt iterate over all markdown files in your vault to extract triples and build the graph. No file contents leave your device.
- Vault read/write: The plugin reads note contents via Obsidian's API and writes cache, report, and export files to the configured cache folder (default
.kg-forge). - Clipboard access: The Build GraphRAG prompt command copies the generated prompt to your system clipboard when you click Copy to clipboard.
No telemetry, analytics, or network requests are performed by the plugin.
| Command | What it does |
|---|---|
| KG Forge: Extract triples from current note | Parses the active note into triples and caches them. Shows a notice with the count. |
| KG Forge: Validate vault schema | Scans the vault for schema violations and opens a report. |
| KG Forge: Build GraphRAG prompt | Opens a modal to pick an anchor note and hop count, then copies the prompt. |
| KG Forge: Export triples as Cypher | Exports the current vault triples to a .cypher file (node-then-edge MERGE). |
| KG Forge: Generate Dataview query templates | Creates a note with Dataview query templates matching the master map. |
| KG Forge: Open Competency Questions | Opens the CQ view to add, edit, and validate questions. |
| KG Forge: Open Knowledge Graph | Opens the typed triple explorer / graph view. |
The plugin understands the Breadcrumbs edge vocabulary used in the research vault:
| Predicate | Directionality | Meaning |
|---|---|---|
rdf:type / type |
— | fileClass typing from folder mapping |
source |
outgoing | derived from |
requires ↔ enables |
inverse pair | prerequisite relationship |
related_to |
symmetric | general association |
up ↔ down |
inverse pair | hierarchy |
same |
symmetric | peer equivalence |
next ↔ prev |
inverse pair | sequence |
links_to |
directed | linked by mention |
source_id |
outgoing | maps SRC-XXX to paper path |
- Knowledge Forge Graph (
ItemView) — browse triples as typed edges, filter by predicate, and inspect provenance. - GraphRAG Panel — configure anchor + hops, preview the serialized subgraph, and copy the prompt.
- Competency Questions — manage CQs and see which ones the current schema can answer.
- Obsidian:
1.13.0and later. - Runtime: fully local; no network calls are required.
- Integrations: designed to work alongside Dataview, Datacore, Metadata Menu, Juggl, Breadcrumbs, and Infranodus.
- D3 / Canvas-based interactive force graph.
- Infer missing triples with simple rule-based reasoning.
- SHACL-style shape constraints.
- SPARQL-like query builder.
- Sync with external triple stores (Neo4j, RDFLib).
- LLM-assisted extraction and CQ generation (opt-in, local models only).
See DEVELOPMENT.md for build instructions and contribution guidelines.
For bugs or feature requests, open an issue with:
- Obsidian version
- Plugin version
- Steps to reproduce
- A sample note (if possible)