mykg
Ships with mykg: myKG automatically generates a confidence-scored knowledge graph from a set of mixed documents — Markdown, plain text, PDF, Word, PowerPoint, Excel, HTML, and images — grounded in…
Claude Code
$ claude mcp add mykg -- uv --directory /path/to/your/project run mykg mcp-serve
Codex
$ codex mcp add mykg -- uv --directory /path/to/your/project run mykg mcp-serve
Cursor
{ "mcpServers": { "mykg": { "command": "uv", "args": [ "--directory", "/path/to/your/project", "run", "mykg", "mcp-serve" ] } } }
Add it to mcp.json.
Gemini CLI
{ "mcpServers": { "mykg": { "command": "uv", "args": [ "--directory", "/path/to/your/project", "run", "mykg", "mcp-serve" ] } } }
Add it to settings.json.
GitHub Copilot
$ copilot mcp add mykg -- uv --directory /path/to/your/project run mykg mcp-serve
OpenCode
{ "mcp": { "mykg": { "type": "local", "command": [ "uv", "--directory", "/path/to/your/project", "run", "mykg", "mcp-serve" ] } } }
Add it to opencode.json.
Windsurf
{ "mcpServers": { "mykg": { "command": "uv", "args": [ "--directory", "/path/to/your/project", "run", "mykg", "mcp-serve" ] } } }
Add it to mcp_config.json.
From the README
What can you do with mykg?
Schema-guided knowledge graph generation
the extracted graph is always grounded in a formal RDFS/OWL schema: concept types, property names, domain/range constraints, and the is-a hierarchy are explicit and inspectable before any entity is…
AI coding assistant friendly
designed for smooth use alongside AI coding assistants such as Claude Code; Use the Claude Code Skill to run extractions, inspect outputs, and iterate on your knowledge graph without leaving your…
Second brain for AI coding assistants
the Obsidian vault output turns your extracted knowledge graph into a directory of wikilinked Markdown notes that any AI coding assistant can read as project context; point Claude Code, Cursor, or…
MCP server for desktop AI apps
run mykg mcp-serve to expose your knowledge graph via the Model Context Protocol; integrates with Claude Desktop, Cherry Studio, and any MCP-compatible client — 16 query tools let LLMs search…
Incremental updates
append new files to an existing session, extracting only what changed.
Resumable pipeline
every stage persists intermediate state; re-enter at any step after a crash or edit
Session isolation
each run is fully self-contained; inputs, intermediate state, outputs, and logs co-located
Cross-session merge
combine two independently-produced graphs into one unified knowledge graph
Security report
Not enough data
Known flaws
Not published
Signed build
Not published
Maintained
Oct 23, 2026
Last push
Licence
MIT
Runs as
Local process
On your machine
Deprecated
Not published
Signals from public registries, not an audit. Checked Nov 12, 2026.
mykg README
myKG — The Knowledge Graph Engine
myKG automatically generates a confidence-scored knowledge graph from a set of mixed documents — Markdown, plain text, PDF, Word, PowerPoint, Excel, HTML, and images — grounded in an induced RDFS/OWL ontology.

Updates
-
v0.4.10 — Schema drift detection and pruning:
mykg detect-schema-driftreports concepts and properties the graph no longer uses, andmykg prune-schemaremoves them (with--preview, an editable plan file, and a backup). See Schema Drift & Pruning. -
v0.4.9 — The
nodes.jsonl,edges.jsonlandknowledge_graph.ttlexports now stream to disk record by record instead of building the whole file in memory first, so peak memory stays flat as the graph grows. -
v0.4.8 —
mykg_search_nodesandmykg_query_graph's seed selection now use BM25 instead of a linear substring scan, ~2,800x faster at 100K nodes (0.5ms vs. 1.4s per query) and no longer degrading to minutes per query as the graph grows.
Contents
- Features
- Quick Start
- Command line
- Articles & Tutorials
- Configuration
- Extract Pipeline
- Running
- Sessions
- Pipeline Steps
- Outputs
- MCP (Model Context Protocol) Server
- Using mykg with Claude Code
- Agent mode (Claude Code skill)
- claude-cli profile
- Advanced Options
- Re-running from a Specific Step
- Orphan-Connection Pass
- Human Review Gate
- Locked Base Schema
- SKOS Thesaurus
- Website / Repo Fetching
- Standalone Document Conversion
- Append Mode
- Incremental Schema Growth
- Merging Sessions
- Walkthrough Report
- Schema Drift & Pruning
- Obsidian Vault Export
- Neo4j Load CSV Export
- Troubleshooting
- Roadmap
- Development
- Testing
- Healthiness check
- Design
- License
Features
MyKG builds trustworthy knowledge graphs through a self-evolving ontology that continuously adapts, maintains consistency, and assigns confidence scores to knowledge, keeping information grounded and reliable as it grows.
Ontology-Guided Extraction
-
Schema-guided knowledge graph generation — the extracted graph is always grounded in a formal RDFS/OWL schema: concept types, property names, domain/range constraints, and the is-a hierarchy are explicit and inspectable before any entity is extracted
-
AI coding assistant friendly — designed for smooth use alongside AI coding assistants such as Claude Code; Use the Claude Code Skill to run extractions, inspect outputs, and iterate on your knowledge graph without leaving your coding environment; see Using mykg with Claude Code
-
Second brain for AI coding assistants — the Obsidian vault output turns your extracted knowledge graph into a directory of wikilinked Markdown notes that any AI coding assistant can read as project context; point Claude Code, Cursor, or Copilot at
output/obsidian_vault/and ask questions, trace relationships, and get answers grounded in your own documents -
MCP server for desktop AI apps — run
mykg mcp-serveto expose your knowledge graph via the Model Context Protocol; integrates with Claude Desktop, Cherry Studio, and any MCP-compatible client — 16 query tools let LLMs search entities, explore relationships, find paths, traverse the graph, and read wiki notes directly from your extracted knowledge; see MCP Server -
Incremental updates — append new files to an existing session, extracting only what changed. Optionally grow the schema from new documents while preserving existing concepts and properties
-
Resumable pipeline — every stage persists intermediate state; re-enter at any step after a crash or edit
-
Session isolation — each run is fully self-contained; inputs, intermediate state, outputs, and logs co-located
-
Cross-session merge — combine two independently-produced graphs into one unified knowledge graph
-
Bring your own ontology — supply a
--base-schemaTTL file (RDFS or OWL) to lock in classes and properties from an existing formal ontology; the LLM expands it with domain-specific concepts but will not rename, remove, or contradict your authoritative vocabulary. Please note that this mechanism is controlled by the LLM, and may not be strictly enforced. Add--freeze-schemato skip LLM schema induction entirely and extract from the documents strictly against your ontology verbatim — no surprise types, no invented properties -
SKOS thesaurus support — pass
--thesaurusto load a SKOS vocabulary;skos:exactMatchterms are collapsed silently,skos:closeMatchterms trigger a warning — giving the schema merger richer synonym awareness than string matching alone -
Verifiable TTL ontology — after Pass 1, the induced schema is exported as a valid RDFS/OWL Turtle file (
intermediate/schema.ttl) that can be opened directly in ontology editors such as Protégé. The TTL is validated by rdflib (syntax + semantic checks: domain/range refer to declared classes, no conflicting ranges) before any extraction begins -
Human-in-the-loop ontology design — pause after schema induction with
--review, edit the schema, and resume extraction. Editschema.jsondirectly or refineschema.ttlin Protégé and feed it back with--freeze-schema

Input
-
Mixed-format corpora — point
mykg extract-graphat any directory; supported extensions are converted to Markdown automatically before ingest:Format Extensions Backend Markdown .mdpassthrough (consumed as-is) Plain text .txtrenamed to .mdin-processPDF, Word, PowerPoint, Excel, images .pdf .docx .doc .pptx .xlsx .png .jpg .jpegMinerU in an ephemeral uv-managed Python 3.12 venv — nothing is installed into your active environmentHTML .html .htmmarkdownifyin-process; anchors and image tags strippedWebsites, GitHub repos any URL Crawlee in an ephemeral uvvenv — produces anmykg_web_fetch/folderAnything outside the allowlist (e.g.
.svg,.css,.phpassets next to an HTML bundle) is logged and skipped, never silently dropped. The allowlist is configurable viapreprocess.extensionsinmykg_config.yaml.Incremental conversion — unchanged source files are skipped on re-run. Adding one PDF to a corpus and re-running only re-converts that PDF. Force a full re-conversion with
mykg extract-graph --from-step preprocess.
Graph & Output
- Provider-agnostic — works with Anthropic (Claude), OpenAI (GPT), Google Gemini, Ollama (local), OpenRouter, or the
claudeCLI - Five output families — JSONL for Neo4j/NetworkX/RAG, Turtle RDF for OWL toolchains, NetworkX multi-format for graph analysis, Obsidian vault for linked personal knowledge management, and an optional Neo4j LOAD CSV bundle (plain-header CSVs + paste-and-run Cypher script for Neo4j Browser /
cypher-shell) - Obsidian vault — second brain for AI coding assistants — every extracted entity becomes a wikilinked Markdown note in
output/obsidian_vault/; open it in Obsidian to navigate the graph with backlinks and Graph View, or point your AI coding assistant (Claude Code, Cursor, Copilot) at the vault folder so it can answer questions, trace relationships, and reason over your knowledge base in natural language - Interactive HTML graph — node/edge filtering, search, hover popups; opens directly in a browser
- Confidence scoring — every extracted attribute, node, and edge carries a
0.0–1.0confidence score
Quick Start
Requires Python 3.11+ (developed on macOS; automated CI runs the test suite on Ubuntu and Windows), and one of: an Anthropic/OpenAI/Gemini/OpenRouter API key, Ollama running locally, or the claude CLI.
Install from PyPI
Install mykg, then run the interactive setup wizard — it asks for your provider, model, and API key and writes mykg_config.yaml and .env.mykg in one step.
pip install mykg
mykg init
Then extract a knowledge graph from your notes:
mykg extract-graph my_notes/
Open mykg_sessions/<timestamp>/output/knowledge_graph.html in your browser to explore the result.
Install from source
Install uv, clone the repo, sync dependencies, run the setup wizard, then extract.
git clone https://github.com/SenolIsci/mykg && cd mykg
uv sync && uv run mykg init --force
Then extract a knowledge graph from your notes:
uv run mykg extract-graph my_notes/
For Ollama (local inference, no API key needed), pull a model and select the ollama-local profile when mykg init prompts you.
ollama pull llama3.3
mykg init
mykg extract-graph my_notes/
Command line
All Commands
| Command | Purpose |
|---|
More MCP servers from other plugins.
agentmemory
MCPShips with agentmemory: #1 Persistent memory for AI coding agents based on real-world benchmarks
skill-seekers
MCPShips with skill-seekers: 🧠 The data layer for AI systems. Skill Seekers turns documentation sites, GitHub repos, PDFs, videos,…
Questions about mykg.
- Which coding agents can use mykg?
- mykg works in any agent that reads an MCP config file: Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf. Each agent reads it from its own file; this page names the file for each one.
- How do I add mykg to Claude Code?
- Run this in your terminal: claude mcp add mykg -- uv --directory /path/to/your/project run mykg mcp-serve

