kg — local knowledge graph CLI
Beta — This software is in active development. APIs may change.
A fast CLI for managing JSON knowledge graphs with native MCP server support. Built for LLM chat workflows: plain text by default, --json for machines.
Features
- Graph operations — create, query, merge, diff, backup
- Search — full-text and BM25 ranking
- MCP server — first-class tool integration for AI assistants
- TUI browser — interactive graph exploration
- Quality analysis — find missing descriptions, facts, edge gaps
- Import — CSV, JSON, Markdown/YAML frontmatter
Install
Quick (curl)
|
From crates.io
From source
Or build manually: cargo build --release
Quick start
See kg --help for all commands.
MCP Server
The primary way to integrate with LLMs:
Config for OpenCode/Claude Desktop:
Tools: node find/get/add/modify/remove, edge add/remove, stats, check, audit, quality, export-html, feedback, and a shell-like kg tool for multi-command scripts.
See docs/mcp.md for full docs.
Documentation
Detailed guides in docs/:
docs/sprint-plan.md— roadmapdocs/kql.md— KQL query languagedocs/import-csv.md— CSV importdocs/import-markdown.md— Markdown importdocs/mcp.md— MCP server referencedocs/decision-backend.md— backend selection