Stop burning tokens. Start coding lean.

The knowledge graphto save tokens

Index your codebase once. LeanKG queries only what AI needs with targeted subgraph retrieval. Works with Claude, Cursor, OpenCode, Gemini, Codex, and more.

F1 Wincontext quality navigationA/B TEST
F1 Wincontext quality impact analysisA/B TEST
57K+elements/sec insert100K NODE TEST
418K+elements/sec retrieveLOAD TEST
345-461xcache speedupCOLD TO WARM
100%local executionNO CLOUD
12languages supportedGO TS PY RS
F1 Wincontext quality navigationA/B TEST
F1 Wincontext quality impact analysisA/B TEST
57K+elements/sec insert100K NODE TEST
418K+elements/sec retrieveLOAD TEST
345-461xcache speedupCOLD TO WARM
100%local executionNO CLOUD
12languages supportedGO TS PY RS
Capabilities

Index once.
Query smarter.

01

Fast Code Indexing

Parse and index your entire codebase with tree-sitter and AST parsing. Extract functions, classes, imports, and call relationships automatically. Supports 12 languages: Go, TypeScript, Python, Rust, Java, Kotlin, Bash, Ruby, PHP, Perl, R, and Elixir.

02

MCP Server Integration

Expose your knowledge graph via MCP (Model Context Protocol). Connect seamlessly with Claude, Cursor, OpenCode, Gemini, Kilo, Codex, and Google Antigravity. AI tools query your graph instead of scanning the whole codebase.

03

Auto-Trigger Sessions

Session hooks inject LeanKG context into every AI tool session automatically. PreToolUse hooks route search intents to LeanKG tools. Token-optimized context without manual prompting.

AB
04

Impact Radius Analysis

Compute blast radius before making changes. Build call graphs with IMPORTS, CALLS, and TESTED_BY edges. Understand exactly what your changes will affect.

05

WebGL Graph Visualization

Visualize your codebase's dependency graph with force-directed layout, WebGL rendering, and community clustering. Filter by element type, zoom, pan, and click nodes for details.

AB
06

Obsidian Sync

Push LeanKG data to Obsidian notes and pull annotation edits back. Watch vault for changes and auto-sync. Keep your knowledge graph and notes in sync.

07

Local-First Architecture

Everything runs on your machine. Privacy-first, no cloud required. SQLite storage keeps your code private and secure. Zero external database connections.

Process

Three simple steps.
Targeted context. Not full scans.

~/leankg
● leanv0.15
1# Initialize LeanKG
2leankg init
3
4# Index your codebase
5leankg index ./src
6
7# Auto-index on changes
8leankg watch ./src
9
10# Status check
11leankg status
Ready
57K+ elements/sec
Integrations

Works with your
favorite AI tools.

Official MCP integration. Supported by Claude, Cursor, OpenCode, and more.

Claude Code
AI Tool
OpenCode AI
AI Tool
Cursor IDE
AI Tool
Gemini CLI
AI Tool
Kilo Code
AI Tool
Google Antigravity
AI Tool
Codex
AI Tool
Obsidian
Notes
Tree-Sitter
Parser
CozoDB
Database
MCP Protocol
Standard
SQLite
Storage
GitHub
Repository
Claude Code
AI Tool
OpenCode AI
AI Tool
Cursor IDE
AI Tool
Gemini CLI
AI Tool
Kilo Code
AI Tool
Google Antigravity
AI Tool
Codex
AI Tool
Obsidian
Notes
Tree-Sitter
Parser
CozoDB
Database
MCP Protocol
Standard
SQLite
Storage
GitHub
Repository
GitHub
Repository
SQLite
Storage
MCP Protocol
Standard
CozoDB
Database
Tree-Sitter
Parser
Obsidian
Notes
Codex
AI Tool
Google Antigravity
AI Tool
Kilo Code
AI Tool
Gemini CLI
AI Tool
Cursor IDE
AI Tool
OpenCode AI
AI Tool
Claude Code
AI Tool
GitHub
Repository
SQLite
Storage
MCP Protocol
Standard
CozoDB
Database
Tree-Sitter
Parser
Obsidian
Notes
Codex
AI Tool
Google Antigravity
AI Tool
Kilo Code
AI Tool
Gemini CLI
AI Tool
Cursor IDE
AI Tool
OpenCode AI
AI Tool
Claude Code
AI Tool

One-line install for any AI tool:

curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- opencode
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- cursor
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- claude
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- gemini
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- kilo
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- antigravity
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- update