RAII 202650% Matched AI Funding ($125k–$5M) at 0%Guide
TECHNICAL ARCHITECTURE & SYSTEMS WALKTHROUGH

Kairos Sovereign Dev Appliance & Multi-Model VS Code Extension

Written for Developers, Founders, and Curious Beginners • 100% Technical Architecture • Zero Marketing Jargon

1. The Big Picture: Why Are We Doing This?

To understand this system, you first have to understand the hidden flaw in today's AI coding tools.

The Current Landscape

Right now, if you want an AI that edits your code inside an editor, you generally have two choices:

  1. Proprietary IDE Forks (Cursor, Windsurf, Google Antigravity): Companies take Microsoft's open-source code for VS Code (called Code-OSS), modify its internal C++ and TypeScript engine, and recompile it into their own desktop app.
    • Model Lock-in: You are locked into whatever models they provide. For example, Antigravity is locked to Google Gemini. You cannot run GPT-6, Claude Opus, or private offline models.
    • Maintenance Hell: Every month, Microsoft pushes thousands of updates to standard VS Code. Maintaining a fork means you spend half your life resolving merge conflicts.
    • High SaaS Tax & Privacy Leakage: Companies charge $20 to $40 per user every month, and your proprietary code passes through their multi-tenant cloud servers.
  2. Simple Chat Extensions (Copilot Chat, generic plugins): They sit in a little sidebar, but they cannot plan complex multi-file projects, they don't have persistent long-term memory of your architecture, and they cannot supervise background terminal tasks.

The Kairos Solution: The "Brain" vs. The "Remote Control"

Instead of building a whole new IDE from scratch, we decouple the system into two focused pieces:

1. THE REMOTE CONTROL
A standard VS Code Extension (.vsix). It shows the chat sidebar, plan approval buttons, and green/red diff highlights in your editor. It does ZERO heavy AI math.
2. THE BRAIN
The Kairos Core daemon running on port :8000. It holds your LanceDB memory vault, routes between GPT-6 / Claude / Ollama, and safely checks your code.

Connected by a simple local WebSocket wire (ws://localhost:8000), you can keep using regular VS Code, switch between any frontier model you want, and never pay a monthly per-seat fee.

2. What Exactly Is the "Sovereign Dev Appliance"?

The word "Appliance" sounds like a toaster or microwave. In enterprise computer science, an Appliance simply means:

"A dedicated computer or pre-packaged virtual machine that is engineered to do exactly one job out of the box, with zero complicated setup."
FORMAT A: PHYSICAL HARDWARE NODE

The "Little Black Box"

A compact, quiet mini-PC or workstation sitting on a shelf in your office. It runs bare-metal Linux with the Kairos service, NVMe vector storage, and an optional GPU (NVIDIA RTX 5080) for running offline models. Your entire team connects their laptops to it over your office WiFi.

FORMAT B: PRIVATE CLOUD VPC

The Docker Container

The exact same system packaged into a Docker container. An IT department deploys it into their private AWS, Azure, or Google Cloud network. It functions as a secure internal company engine that only employee laptops can access.

3. What Happens When You Type a Prompt? (Step-by-Step)

Suppose you are in VS Code working on a web app. You open the Kairos sidebar, and you type:

Sidebar Prompt Input
>"Add an authentication middleware in TypeScript that checks JWT tokens and enforces an admin role."

1The VS Code Extension Gathers Context

Before sending anything, the extension inspects your editor. A script called ContextExtractor.ts grabs:

  • Your active file path (src/middleware/auth.ts)
  • Your cursor line number (line 14) and any highlighted code
  • The filenames of other open tabs in your editor
  • The root project folders currently mounted

2Traveling Across the WebSocket Wire

The extension sends this bundle over a local WebSocket connection (ws://127.0.0.1:8000/agent/ws). Why a WebSocket? Because it acts like a live open phone call: words stream back in under 10 milliseconds, and you can hit "Cancel" at any second to stop the model before tokens are wasted.

agent.prompt.dispatch (JSON-RPC)
{
  "jsonrpc": "2.0",
  "method": "agent.prompt.dispatch",
  "params": {
    "sessionId": "fdae5b0a-4945-43d9-9418-3c9a03262697",
    "prompt": "Add authentication middleware in TypeScript...",
    "context": {
      "activeFilePath": "src/middleware/auth.ts",
      "cursorLine": 14,
      "openTabPaths": ["src/types.ts"],
      "workspaceRoots": ["c:/Projects/MyApp"]
    }
  }
}

3Semantic Memory Recall (LanceDB)

Before calling the AI, Kairos queries its local LanceDB Vector Database. It performs a hybrid search:

Score = 0.65 × (Conceptual Meaning) + 0.35 × (Exact Code Symbol Match)

Kairos finds your company rule ("Always use TypeScript strict types, never use `any`"), finds your existing UserRole interface, and injects them into the prompt buffer so the model doesn't make rookie errors.

4The Multi-Model Router (Picking the Right Brain)

In Antigravity, you are locked to Gemini. In Cursor, you are locked to their cloud proxy. In Kairos, the Multi-Model Router picks dynamically:

  • Frontier Deliberation: Deep architecture questions route to GPT-6 or Fable 5.1.
  • High-Speed Tool Execution: AST searches and lint checks route to Gemini 3.8 Flash (saving up to 85% on token costs).
  • Air-Gapped Sovereign Node: Sensitive healthcare or financial IP routes to local DeepSeek-R1 running offline on the graphics card.

5Planning Mode (The Safety Brake)

The model is strictly prohibited from touching files right away. It first outputs an implementation_plan.md.

WHAT YOU SEE IN VS CODE:
The Kairos sidebar displays the markdown plan with an interactive button: `[ Proceed / Approve Plan ]`. Nothing is modified until you click it.

6Deterministic File Surgery (Safe Code Changes)

The AI does not rewrite the whole 10,000-line file. It outputs a precision snippet:

"In lines 42 to 58, replace this exact TargetContent with this ReplacementContent."

Kairos verifies the line range, verifies that the syntax is valid (AST check), and sends the diff proposal to VS Code. The extension invokes vscode.WorkspaceEdit, highlighting the changes in green and red in your editor gutter. You can click a checkmark to accept or press Ctrl+Z to revert at any time.

7Running Commands & Watching Processes

If tests or dev servers need to run (npm test), Kairos launches them in the background. It watches the process exit code. If tests fail, it automatically reads the stack trace and drafts a fix; if they pass, it marks the task complete.

84:00 AM Nocturnal Memory Consolidation

Every night at 4:00 AM, a background script (dream.py) wakes up. It summarizes the day's architectural lessons into memories/system_history.md, prunes temporary compiler noise, and updates LanceDB. When you open your laptop the next morning, the AI remembers what was learned yesterday.

Frontier AI Research Breakthrough

4. The Secret Weapon: The Schema Harness Engine

Why does Kairos outperform standard coding assistants like Copilot and Cursor? The answer lies in the groundbreaking research from Impossible Research, UC Berkeley, and CMU (July 2026): The Schema Harness.

ARC-AGI-3 Complex Reasoning BenchmarkZero Weight Changes
Standard Single Model
13.3%
Standard Harness (Claude Code)
42.8%
Schema Harness (Opus 4.8 + Fable 5)
98.98%
"How you use the model matters as much as the model itself. The world representation should be an executable program, not an internal neural vector or implicit conversation buffer."

The 5 Schema Superpowers Built into the Kairos Appliance

1. Predictive Self-Checking ("Reality Outranks the Model")

When Cursor or Copilot run a 5-step file edit, if step 2 silently fails, they keep executing steps 3, 4, and 5—destroying your repository. In Kairos, every action formulates an expected state delta. If a tool output diverges by even 1 byte, the execution halts immediately and voids the pending queue, returning the exact counterexample to the model.

2. Micro-Simulators Before Live Execution

Instead of guessing and testing in live databases or production endpoints, Kairos spins up lightweight Python micro-simulators (verify_logic.py) to run deterministic state-transition checks and verify algorithmic invariants for $0 token cost before applying changes.

3. The Anti-Epicycle Rule (Indicting the Representation)

When junior developers or standard AIs hit repeated compiler errors, they pile on defensive if/else patches (epicycles). Kairos enforces an explicit rule: "If an error persists across 2 consecutive cycles, stop adding patches. Audit the underlying data structure or schema."

4. Single-Variable Active Probing

When debugging complex cloud errors (Firebase Auth, CORS, Vite bundle conflicts), Kairos runs a 5-line scratch probe designed specifically to bisect competing hypotheses, rather than making massive multi-file speculative edits.

5. Regression Backtesting on Event History

During the 4:00 AM Dream Session, Kairos replays candidate instructions against hundreds of historical interaction frames stored in memories/events.jsonl to mathematically certify that new behaviors cause zero regressions on previously solved workflows.

5. How the Files Are Organized in the Extension

Here is the exact TypeScript project structure for the extension:

kairos-vscode-extension/
├── package.json              # Extension manifest (defines sidebar icon)
├── tsconfig.json             # TypeScript config
├── src/
│   ├── extension.ts          # Main entry point (activates in VS Code)
│   ├── network/
│   │   └── WebSocketClient.ts # Persistent connection to localhost:8000
│   ├── providers/
│   │   └── SidebarWebview.ts  # Mounts the chat UI in the secondary sidebar
│   ├── editor/
│   │   ├── ContextExtractor.ts# Grabs active buffer, cursor & open tabs
│   │   ├── DiffManager.ts     # Stages atomic diffs (vscode.WorkspaceEdit)
│   │   └── GutterDecorations.ts# Paints green/red lines in the editor gutter
│   └── webview-ui/            # The interactive React UI inside the sidebar
│       ├── App.tsx            # Chat stream + Model Picker
│       └── components/PlanHUD.tsx # Renders implementation plan

6. Why This Architecture Wins

FeatureCursor / WindsurfClaude Code (CLI)Google AntigravityKairos Appliance
The InterfaceCustom desktop forkTerminal CLI onlyCustom desktop forkStandard VS Code + HUD
Model FreedomCloud proxy onlyClaude onlyGemini onlyGPT-6, Fable, Claude, Ollama
Execution SafetyUnconstrained trial-and-errorGeneric harness (42.8% benchmark)Planning mode onlySchema Harness (99% guard)
Data PrivacyThird-party cloudAnthropic Cloud serversGoogle Cloud100% On-Premise / VPC Node
Monthly Cost$20 - $40 / moAPI usage ($50 - $200+)Internal quota$0 / dev / mo (Self-Hosted)
Persistent MemoryShallow session historySession-only memoryLocal knowledge itemsLanceDB + 4 AM Dream Sync
Maintenance BurdenResolving fork merge conflictsCLI environment updatesGoogle internalZero (Microsoft updates editor)
Back to /local-ai OverviewKairos Sovereign Architecture • Protoss