Kai
Semantic infrastructure for code change.
Kai understands what code means — functions, dependencies, behavior impact — not just which lines changed. This semantic graph powers precise CI, context-aware IDEs, and verifiable AI coding agents.
Install
# curl
curl -sSL https://get.kailayer.com | sh
# Homebrew
brew install kailayerhq/kai/kai
Quick Start
kai init
kai capture
kai diff # semantic change impact
kai ci plan # minimal test selection
For full command reference, see docs/cli-reference.md.
MCP Server
Kai ships an MCP server that gives AI coding assistants access to call graphs, dependency maps, impact analysis, and test coverage.
# Claude Code
claude mcp add kai -- kai mcp serve
# Or without installing kai (npx downloads it automatically)
claude mcp add kai -- npx -y kai-mcp
No setup required — the server lazily initializes the semantic graph on first use.
Also available on the MCP Registry as io.github.kailayerhq/kai.
See docs/mcp.md for Cursor setup, tool reference, and troubleshooting.
What Kai Builds
For every commit, Kai constructs a queryable semantic model:
| Layer | What It Captures |
|---|---|
| Functions & methods | Signatures, bodies, call graphs |
| Dependencies | Module relationships, data flow |
| Behavior changes | What actually changed in meaning, not just text |
This graph is immutable, verifiable, and designed for machine reasoning.
Use Cases
Selective CI
Kai determines which tests actually need to run based on behavioral impact, not file diffs. Result: 80% CI time reduction for early users.
AI Code Context
11 MCP tools give AI assistants structured access to your codebase's dependency graph, call graph, impact analysis, and test coverage.
Verified AI Agents
Agent proposes edit → Kai validates impact → agent executes with proof, not generation with hope.
Architecture
Kai is open-core: CLI and semantic engine are Apache 2.0. Kai Cloud adds hosted infrastructure and team features.
See What's Open Source vs. Kai Cloud.
Roadmap
| Phase | Status | Milestone |
|---|---|---|
| Semantic graph (5 languages, 71 change types) | Production | 2.8M commits analyzed |
| CI optimization | Shipping | 3 design partners, daily usage |
| MCP server for AI assistants | Shipped | 11 tools, npm + brew + registry |
| IDE extension | Building | VS Code integration |
| Verified agent loop | Planned | Autonomous editing with proof |
License
See LICENSE.