KAI OS

Local-first Evidence OS for AI agents in Kotlin: process traces, syscall ledgers, replayable capsules, and CI-grade proof.

Star it if you want a JVM/Kotlin agent runtime focused on process traces, syscall ledgers, replayable capsules, and CI evidence gates.

Agent Process
Workflow Scheduler
Tool Syscall
Run Evidence

A runtime model, not another chain wrapper.

KAI OS starts from operating-system primitives: lifecycle, scheduling, permissions, memory, and observable process state.

agent-runtime / kernel
coroutine scheduler online

Agent Runtime

Spawn, start, suspend, resume, cancel, succeed, and fail agent processes with durable event traces.

AgentProcess(pid, state)

Scheduler

Execute DAG workflows with parallel-ready nodes, observable retries, fallback routing, timeout policy, and sibling cancellation.

WorkflowScheduler

Tool System

Route side effects through permissioned syscall-style tools instead of direct agent access.

ToolRegistry

Memory Layer

Use session memory, SQLite persistence, and JSON run snapshots for local inspection.

MemoryStore
kaios ps terminal process table showing planner, executor, and validator agents

Inspect agents like processes.

The CLI exposes process-style observability from the first demo, with no external API key required.

PID Every agent execution gets a stable process id inside the run.
CPU Token usage is tracked as the runtime's first compute metric.
MEM Context size and persisted memory make agent state visible.
IO Tool calls are counted as syscalls across the process lifecycle.

Watch a run become processes.

The default workflow and editable project configs emit process metrics, lifecycle events, and KAI Process Trace JSON that can be inspected after the run.

Animated KAI OS CLI demo showing run, ps, and inspect commands

v0.3 ships Evidence Core.

The first evidence milestone is intentionally small, deterministic, and inspectable: process recovery, priority scheduling, and a syscall ledger are visible in the runtime artifacts.

Deterministic by default

Mock model execution keeps the first run local and reproducible, while provider interfaces leave room for real models.

MockModelProvider

Real provider boundary

OpenAI-compatible and Ollama providers plug into the same runtime abstraction when you want live inference.

ModelProvider

Safe syscalls first

Echo, clock, mock HTTP, allowlisted real HTTP, and scoped file access demonstrate permissioned tool execution.

ToolPermission

Persisted state

Session memory, SQLite memory, and JSON snapshots make agent runs inspectable after execution.

MemoryStore

CLI process manager

Ask for the next command, run workflows, list runs, print process tables, inspect lifecycle events, emit process traces, package evidence, render reports, and export Markdown artifacts.

kaios evidence

Project context

Generate no-key Markdown or JSON project reports with kaios analyze, map source shape, and preview bounded context files.

kaios analyze

Project configs

Generate template workflows, validate configs, show the DAG, auto-run kaios.json, and create a GitHub Actions Agent Gate with JSON evidence and failure reports.

kaios init --ci

Kotlin-native DSL

Describe agents and workflows with typed Kotlin APIs that can grow into plugin and UI layers.

agent { workflow }

Use KAI OS when agent work needs runtime evidence.

Start with the local review loop: current Git change in, Markdown artifact, process trace, replayable capsule, and baseline gate out.

KAI OS evidence map showing git change, kaios review, review artifact, process trace, replay capsule, audit, and baseline gate

Current-Change Review

Review a dirty Git workspace with bounded changed-file context, no API key, and a stable kaios.review/v1 JSON contract.

kaios review

CI Agent Gate

Add a no-key readiness gate that validates config, runs a deterministic workflow, writes JSON evidence, and explains failures from the PR page.

kaios gate

Runtime Debugging

Inspect a multi-agent run through process ids, lifecycle events, token usage, context size, syscall counts, and trace validity.

kaios ps

Portable Evidence

Package a run as a capsule, replay it offline, compare it against a baseline, and print a PR-friendly evidence summary.

kaios evidence

Project Context

Analyze, index, and attach bounded repository context so an agent can reason over a project without copying the whole workspace.

kaios run --index

Run the Evidence OS loop in 60 seconds.

KAI OS starts locally with no API key. Tour creates a disposable repo and runs the full Evidence OS loop; quickstart, review, and evidence are the real-project path.

# Run KAI OS after installing the CLI
kaios tour

# Real project path
kaios quickstart
kaios review
kaios evidence --summary
kaios evidence --baseline artifacts/baseline.capsule.json --check

# Ask KAI OS for the next workspace-aware command
kaios next

# Preview onboarding writes:
kaios quickstart --dry-run

# local-only first run:
kaios quickstart --no-ci

# manual path:
kaios demo
kaios setup --ci
kaios gate
# optional when you keep a baseline:
kaios gate --baseline artifacts/baseline.capsule.json --check
kaios export

# or:
curl -fsSL https://morning-verlu.github.io/KAI/install.sh | sh
export PATH="$HOME/.kaios/bin:$PATH"
kaios tour
kaios next
kaios quickstart
kaios review
kaios ps
kaios inspect
kaios trace --check
# optional when you keep a baseline:
kaios evidence --baseline artifacts/baseline.capsule.json --check
kaios report