Skip to content
jun-omisePublic

About

KAGE - High security user friendly OpenClaw :)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

KAGE Logo

KAGE

Secure Multi-Agent Personal AI Assistant

4 AI agents working together. One seamless experience.

Self-hosted. Multi-provider. Desktop app. Remote control via LINE / WhatsApp / Messenger.

GitHub release License: MIT Node.js Platform

Download ยท Getting Started ยท Features ยท Developer Setup ยท Architecture ยท API Reference


โฌ‡๏ธ Download / ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰

No terminal required โ€” download, install, start chatting.

ใ‚ฟใƒผใƒŸใƒŠใƒซไธ่ฆ โ€” ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ใ—ใฆใ™ใไฝฟใˆใพใ™ใ€‚

Platform Download Size
๐ŸŽ macOS KAGE-macOS.dmg ~120 MB
๐ŸชŸ Windows KAGE-Windows-Setup.exe ~90 MB

๐Ÿ’ก Alternatively, visit the Releases page to see all versions.


๐Ÿš€ Getting Started / ใฏใ˜ใ‚ใ‹ใŸ

Step 1 โ€” Install / ใ‚คใƒณใ‚นใƒˆใƒผใƒซ

macOS: Open the .dmg โ†’ drag KAGE to your Applications folder โ†’ double-click to launch.

Windows: Run the .exe installer โ†’ follow the prompts โ†’ KAGE launches automatically.

Step 2 โ€” Enter your API Key / APIใ‚ญใƒผใ‚’ๅ…ฅๅŠ›

On first launch, the Setup Wizard appears. Paste your AI provider API key:

Provider Get your key
Anthropic (recommended) console.anthropic.com
OpenAI platform.openai.com
Google AI aistudio.google.com

Set a password for KAGE, then click Complete Setup.

Step 3 โ€” Start Chatting / ใƒใƒฃใƒƒใƒˆ้–‹ๅง‹ ๐ŸŽ‰

That's it! Type a message and KAGE's 4-agent pipeline handles the rest:

You: "Organize my project files and create a summary report"

  Sentinel  โ†’ security check
  Planner   โ†’ break into subtasks
  Executor  โ†’ run tools (filesystem, search, code...)
  Reviewer  โ†’ verify results & quality
  โœ… Done    โ†’ files organized + summary delivered

โœจ Features / ๆฉŸ่ƒฝ

๐Ÿ”’ Security-First Architecture

KAGE's Sentinel agent runs before and after every task:

  • Input validation โ€” blocks dangerous commands before execution
  • PII detection โ€” auto-masks credit card numbers, SSNs, phone numbers
  • Plan review โ€” validates execution plans for safety
  • Output sanitization โ€” ensures no sensitive data leaks
  • Loop detection โ€” prevents infinite agent loops
  • Cost enforcement โ€” hard limits on per-task / daily / monthly API costs

๐Ÿค– MCP Auto-Discovery (50+ Tools)

KAGE automatically detects which tools are needed from your message and connects them:

You: "Search GitHub for React component libraries"
  โ†’ Auto-connects github + brave_search servers
  โ†’ Searches, analyzes, summarizes
Category Examples
Development GitHub, GitLab, Docker, Kubernetes, Git
Productivity Slack, Notion, Google Drive, Todoist
Data PostgreSQL, MySQL, MongoDB, Redis
Search Brave Search, Google Search
Cloud AWS, GCP, Azure, Vercel
Communication Gmail, Discord, Telegram

๐Ÿ’ฐ Smart Cost Optimization

Automatically routes each agent to the cheapest suitable model โ€” up to 90% cost reduction:

Agent Role Model Tier
Sentinel Security check Fast (cheapest)
Planner Task planning Scales with complexity
Executor Tool execution Your chosen model
Reviewer Quality check Fast (cheapest)

Real token tracking with per-agent cost breakdown. No more estimated costs.

๐Ÿง  Multi-Provider AI (8 Providers, 35+ Models)

Provider Models
Anthropic Claude Opus 4.6, Sonnet 4.6, Haiku 4.5
OpenAI GPT-5, GPT-4.1, o3, o4-mini
Google Gemini 3.1 Pro, 2.5 Flash
Groq Llama 4, DeepSeek R1
xAI Grok 4.20
Alibaba Qwen 3, Qwen Max
Moonshot Kimi K2
OpenRouter 100+ models

๐Ÿ“ฑ Remote Control via Messaging

Run KAGE on your PC at home, control it from your phone:

You (LINE): authenticate my-passphrase
KAGE: โœ… Authenticated.

You (WhatsApp): check my project build status
KAGE: Build passed. 142 tests green. Deploy ready.

Supported: LINE, WhatsApp, Facebook Messenger โ€” same full 4-agent pipeline.

๐Ÿ“‹ Task Templates

Save frequently-used instructions as reusable templates with {{variables}}:

Template: "{{folder}}ๅ†…ใฎใƒ•ใ‚กใ‚คใƒซใ‚’{{format}}ๅฝขๅผใงๆ•ด็†ใ—ใฆ"
โ†’ Fill in: folder=~/Desktop, format=ๆ—ฅไป˜ๅˆฅ
โ†’ One-click execution

๐ŸŒ Bilingual (English + ๆ—ฅๆœฌ่ชž)

Full UI and agent responses in both English and Japanese.


๐Ÿ”„ Auto-Update / ่‡ชๅ‹•ใ‚ขใƒƒใƒ—ใƒ‡ใƒผใƒˆ

KAGE checks for updates automatically on launch. When a new version is available:

  1. A dialog asks: "v{x.y.z} is available. Download?"
  2. The update downloads in the background
  3. When ready: "Restart to install?"
  4. KAGE restarts and you're on the latest version

No manual re-download needed. Updates are delivered through GitHub Releases.


๐Ÿ—๏ธ Architecture / ใ‚ขใƒผใ‚ญใƒ†ใ‚ฏใƒใƒฃ

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                       KAGE Architecture                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  Electron   โ”‚    โ”‚           Express Server                โ”‚  โ”‚
โ”‚  โ”‚  Desktop    โ”‚    โ”‚                                        โ”‚  โ”‚
โ”‚  โ”‚  App        โ”‚    โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚  โ”‚
โ”‚  โ”‚  (.dmg/exe) โ”‚    โ”‚  โ”‚        Orchestrator              โ”‚   โ”‚  โ”‚
โ”‚  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค    โ”‚  โ”‚                                  โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  React UI  โ”‚โ—„โ”€โ”€โ–บโ”‚  โ”‚  ModelRouter โ†’ Complexity Check  โ”‚   โ”‚  โ”‚
โ”‚  โ”‚            โ”‚SSE โ”‚  โ”‚  TokenTracker โ†’ Real Cost        โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  Chat      โ”‚    โ”‚  โ”‚                                  โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  Monitor   โ”‚    โ”‚  โ”‚  Sentinel โ†’ Planner              โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  Tools     โ”‚    โ”‚  โ”‚      โ†“         โ†“                 โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  Templates โ”‚    โ”‚  โ”‚  AutoMCP โ†’ Executor (ร—N)         โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  Settings  โ”‚    โ”‚  โ”‚      โ†“         โ†“                 โ”‚   โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚  โ”‚  Reviewer โ†’ Response             โ”‚   โ”‚  โ”‚
โ”‚                    โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚                                        โ”‚  โ”‚
โ”‚  โ”‚  LINE      โ”‚    โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚  โ”‚
โ”‚  โ”‚  WhatsApp  โ”‚โ—„โ”€โ”€โ–บโ”‚  โ”‚  SQLite   โ”‚  โ”‚  MCP Servers     โ”‚  โ”‚  โ”‚
โ”‚  โ”‚  Messenger โ”‚    โ”‚  โ”‚  DB       โ”‚  โ”‚  (50+ auto-inst) โ”‚  โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚  โ”‚
โ”‚                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Tech Stack

Layer Technology Purpose
Desktop Electron + electron-updater Native macOS / Windows app with auto-update
Frontend React 18 + Vite + Tailwind CSS Fast, responsive dark UI
Backend Node.js + Express API server & orchestration
Database SQLite (better-sqlite3) Zero-config persistent storage
AI Anthropic SDK + MCP SDK Multi-model & tool integration
Cost Engine ModelRouter + TokenTracker Smart routing & real cost tracking
Auth bcryptjs + JWT Secure authentication
Realtime Server-Sent Events (SSE) Live agent status streaming
i18n Custom hooks English + Japanese

๐Ÿ‘ฉโ€๐Ÿ’ป Developer Setup / ้–‹็™บ่€…ๅ‘ใ‘

Click to expand / ใ‚ฏใƒชใƒƒใ‚ฏใ—ใฆๅฑ•้–‹

Prerequisites

Requirement Version
Node.js 18+
npm 9+
API Key Anthropic, OpenAI, Google, or any supported provider

Installation

# 1. Clone the repository
git clone https://github.com/jun-omise/KAGE.git
cd KAGE

# 2. Install dependencies
npm install

# 3. Configure environment
cp .env.example .env

Edit .env:

ANTHROPIC_API_KEY=sk-ant-...your-key...
JWT_SECRET=any-random-string-here
PORT=3456
# 4. Start development server
npm run dev

Open http://localhost:5173 โ€” the Setup Wizard will guide you through the rest.

Commands

# Development
npm run dev              # Start client + server (recommended)
npm run server           # Express server only (port 3456)
npm run client           # Vite dev server only (port 5173)
npm run build            # Production build (client)

# Desktop App Build
npm run electron:dev         # Run Electron in dev mode
npm run electron:build:mac   # Build macOS .dmg
npm run electron:build:win   # Build Windows .exe

Environment Variables

Variable Required Default Description
ANTHROPIC_API_KEY Yes* โ€” Anthropic API key
JWT_SECRET Yes โ€” Secret for JWT signing
PORT No 3456 Server port

*At least one AI provider key is required. Additional keys can be configured through the Settings UI.

Project Structure

KAGE/
โ”œโ”€โ”€ electron/                      # Desktop app (Electron)
โ”‚   โ”œโ”€โ”€ main.js                    # Main process + auto-updater
โ”‚   โ”œโ”€โ”€ preload.js                 # Preload script
โ”‚   โ””โ”€โ”€ builder.config.js          # Build config (dmg/exe)
โ”‚
โ”œโ”€โ”€ client/                        # Frontend (React + Vite)
โ”‚   โ””โ”€โ”€ src/
โ”‚       โ”œโ”€โ”€ components/
โ”‚       โ”‚   โ”œโ”€โ”€ ChatPanel.jsx      # Chat interface
โ”‚       โ”‚   โ”œโ”€โ”€ AgentMonitor.jsx   # Agent status (Cards / Timeline)
โ”‚       โ”‚   โ”œโ”€โ”€ ProgressIndicator.jsx  # Pipeline progress bar
โ”‚       โ”‚   โ”œโ”€โ”€ TemplateEditor.jsx     # Template variable editor
โ”‚       โ”‚   โ”œโ”€โ”€ ToolManager.jsx    # 50+ MCP server catalog
โ”‚       โ”‚   โ””โ”€โ”€ ...
โ”‚       โ”œโ”€โ”€ hooks/
โ”‚       โ”‚   โ”œโ”€โ”€ useTemplates.js    # Template CRUD
โ”‚       โ”‚   โ””โ”€โ”€ useSSE.js          # Real-time events + MCP auto-connect
โ”‚       โ””โ”€โ”€ i18n/                  # en.json, ja.json
โ”‚
โ”œโ”€โ”€ server/                        # Backend (Express)
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”‚   โ”œโ”€โ”€ orchestrator.js        # 4-agent pipeline + auto MCP
โ”‚   โ”‚   โ”œโ”€โ”€ ai-client.js           # Multi-provider AI client
โ”‚   โ”‚   โ”œโ”€โ”€ model-router.js        # Complexity-based model routing
โ”‚   โ”‚   โ”œโ”€โ”€ model-registry.js      # 35+ model catalog & pricing
โ”‚   โ”‚   โ”œโ”€โ”€ token-tracker.js       # Real token counting
โ”‚   โ”‚   โ””โ”€โ”€ agents/                # Sentinel, Planner, Executor, Reviewer
โ”‚   โ”œโ”€โ”€ mcp/
โ”‚   โ”‚   โ”œโ”€โ”€ client.js              # MCP connection manager
โ”‚   โ”‚   โ”œโ”€โ”€ auto-resolver.js       # Auto-detect & auto-connect MCP
โ”‚   โ”‚   โ””โ”€โ”€ builtin-servers.js     # 50+ server definitions
โ”‚   โ”œโ”€โ”€ security/                  # PII, cost, audit, loop detection
โ”‚   โ”œโ”€โ”€ notifications/             # Webhook, LINE, WhatsApp, Messenger
โ”‚   โ””โ”€โ”€ routes/                    # API route modules
โ”‚
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ README.md

Releasing a New Version

KAGE uses GitHub Actions for automated builds. To release:

# 1. Bump version in package.json
npm version patch   # or minor / major

# 2. Push the tag
git push origin main --tags

GitHub Actions will automatically:

  • Build macOS .dmg and Windows .exe
  • Create a GitHub Release
  • Upload installers as release assets
  • Generate latest-mac.yml / latest.yml for auto-updater

๐Ÿ“ก API Reference

Click to expand / ใ‚ฏใƒชใƒƒใ‚ฏใ—ใฆๅฑ•้–‹

Core

Method Endpoint Description
POST /api/chat Send message โ†’ triggers 4-agent pipeline
GET /api/stream/:id SSE stream for real-time agent updates
GET /api/conversations List conversations
POST /api/approval Approve / reject agent actions

Models & Routing

Method Endpoint Description
GET /api/models List all 35+ models by provider
GET /api/models/routing Get model routing config
POST /api/models/routing/preview Preview routing for a message
PUT /api/models/active Switch active model

Tools & MCP

Method Endpoint Description
GET /api/tools/builtin List 50+ available MCP servers
POST /api/tools/connect Connect an MCP server
POST /api/suggestions/mcp Get smart MCP suggestions

Tasks & Templates

Method Endpoint Description
GET /api/tasks?is_template=true List templates
POST /api/tasks Create task/template
POST /api/tasks/:id/run Execute with variable substitution

SSE Events

Event Payload
pipeline:progress { phase, stepIndex, totalSteps, elapsed_ms }
pipeline:routing { complexity, mainModel, routing }
agent:detail { agent, currentAction, model, toolName }
mcp:auto_connecting { serverId, serverName }
mcp:auto_connected { serverId, tools[] }

โ“ Troubleshooting / ใƒˆใƒฉใƒ–ใƒซใ‚ทใƒฅใƒผใƒ†ใ‚ฃใƒณใ‚ฐ

Issue Solution
macOS: "App is damaged" / ้–‹ใ‘ใพใ›ใ‚“ Run: xattr -cr /Applications/KAGE.app
Windows: SmartScreen warning Click More info โ†’ Run anyway
Port 3456 in use Change PORT in .env or Settings UI
"API key not set" Add key in the Setup Wizard or Settings page
MCP server won't connect Check: npx -y @modelcontextprotocol/server-filesystem /tmp
npm install fails (dev) macOS: xcode-select --install / Windows: install Build Tools
Electron build fails (dev) Run npm run build first, then npm run electron:build:mac

๐Ÿค Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes
  4. Push and open a Pull Request

๐Ÿ“„ License

MIT License โ€” see LICENSE for details.


About

KAGE - High security user friendly OpenClaw :)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages