KYREX

A high-integrity, local-first terminal AI agent engineered for autonomous software engineering and systems administration.

Not a wrapper. A control plane.

Core Pillars

Built on one principle: the model should be powerful, but the environment should be safe.

🛡️

Hardened Safety

AST gating rejects broken code before it touches disk. Diff gating requires explicit approval for every change. Dangerous commands are hard-blocked.

🌳

Tree Mode

Branch your conversation context like Git. Fork experiments, checkout previous states, undo mistakes. Every path saved as portable JSON.

📊

Flight Recorder

Thread-safe auditing maps exactly why the model executed specific tools. Persistent reasoning logs anchored to each interaction.

Dual Modes

Toggle between Plan (read-only advisory) and Execute (autonomous code writing). Context compaction at 80% token threshold.

🔌

MCP Support

Built-in hooks for Model Context Protocol. Pull in external tools, infrastructure tracking, or search APIs.

🎯

Circuit Breaker

After 3 consecutive tool failures, Kyrex aborts to prevent infinite reasoning loops. Maximum 10 nested tool-call rounds.

Supported Providers

Bring your own API key. Works with any OpenAI-compatible endpoint.

🟢

OpenAI

GPT-4o, GPT-4, o1, o3-mini

🟣

Anthropic

Claude 3.5 Sonnet, Claude 3 Opus

🔵

Custom

Any OpenAI-compatible API

Diff Gate

No changes land silently. Every file modification is staged and requires explicit human approval.

def calculate_total(items):
total = 0
- for item in items:
- total += item.price
+ total = sum(item.price for item in items)
return total * tax_rate

Kyrex opens a unified diff preview. You see exactly what changes before they're applied.

Trust Mode

For high-confidence workflows. Auto-accept edits after a brief review window.

1

Edit Proposed

Kyrex suggests a change

2

2.5s Window

Review the diff

3

Auto-Accept

Change applied

Enable in VS Code settings: kyrex.trustMode: true

Bring Your Own Key

Your API keys, your models, your infrastructure. No vendor lock-in.

✓ Full Control

Use your own API keys directly. No middleman, no markup, no data collection.

✓ Any Model

Switch between GPT-4o, Claude, or any OpenAI-compatible endpoint on the fly.

✓ Local First

Runs entirely on your machine. Sessions stored locally as portable JSON.

✓ Custom Endpoints

Point to Azure OpenAI, local LLMs, or any compatible API with custom base URLs.

Get Started

One command. Linux/WSL.

curl -fsSL https://raw.githubusercontent.com/kp84-hub/kyrex/main/install.sh | bash

Or install manually:

# Clone and install
git clone https://github.com/kp84-hub/kyrex.git
cd kyrex
pip install -e kyrex_engine/
go build -o kx .
sudo cp kx /usr/local/bin/kx

# Configure and launch
kx --setup
kx

Requirements: Go 1.21+, Python 3.11+

Get VS Code Extension →