LeanKG

•
222
•

Provides AI coding tools with accurate and token-efficient codebase context through a local-first knowledge graph.

LeanKG is a lightweight, local-first knowledge graph designed to drastically improve the efficiency of AI-assisted development. By indexing your codebase, building dependency graphs, and generating documentation, it offers AI coding tools highly targeted context, reducing token consumption by up to 98% compared to scanning entire codebases. It operates entirely on your machine, integrating seamlessly with popular AI tools like Claude, Cursor, OpenCode, and Gemini via an MCP server, ensuring privacy and minimal resource usage.

主な機能

01Delivers 13-42 tokens per query for concise AI context
02Achieves up to 98% token saving for impact analysis
03Indexes multi-language codebases (Go, TypeScript, Python, Rust, Java, Kotlin) using tree-sitter
04Builds local-first dependency graphs with call, import, and test relationships
05Integrates with AI tools like Claude, Cursor, and OpenCode via an MCP server
0632 GitHub stars

ユースケース

01Optimize AI coding tool context to reduce token usage and cost
02Accurately compute the impact radius of code changes
03Visualize codebase dependencies and structure for better understanding