Project / Khan-Engine

Khan Engine

Developing · v0.7.0 · Zig 0.16.0

An AI-native World OS for simulated interactive worlds — an operating system in which agents perceive the world through semantic interfaces, act through typed intents, verify results through deterministic simulation, and accumulate experience through observable evidence. An embodied AI runtime that looks like a game engine. Agents are first-class citizens, not tools.

ZIG 0.16.0 ECS VULKAN 1.4 BOX3D MCP GRACE v4.2 AGENT CITIZENSHIP DETERMINISM

💮 formula: LLM gives intent. Engine gives truth. Editor gives human control. Evidence gives trust.

01 / Positioning

Not a chatbot wrapper

Khan Engine is not codegen bolted onto a renderer. It is a domain World OS — the engine is the runtime, the verification, and the trust layer where agents live inside a verifiable world.

Khan Engine is not another AI OS. Khan Engine is not a game engine with a chatbot. Khan Engine is not NPC middleware. Khan Engine is the open World OS for simulated interactive agents — deterministic world + editor + agent citizenship + verification-first runtime.

02 / Architecture

Three layers

GPC gives the agent a body. BDI gives the agent a mind. GRACE contracts give the world its laws. Semantic Mirror gives sight. Agent Session gives citizenship. Physics gives the world its physics.

Layer 1

Compute Core

ECS world, deterministic simulation, physics, render, audio. The truth the engine commits to.

Layer 2

Control Plane

Editor, branch/merge, capability safety, pre-execution gate. The human control surface.

Layer 3

Agent Protocol

Semantic interfaces, typed intents, MCP gateway, agent citizenship. How agents live in the world.

03 / Core loop

LLM gives intent. Engine gives truth.

Intent is generative and may be wrong. Validation is deterministic, contractual, checkable. Evidence is provable, reproducible, rollback-safe.

INTENTproposal (generative, probabilistic)
VALIDATIONdeterministic contract check
EVIDENCEheadless play, assertions, evidence bundle — ready for review

04 / Technology

Stack

  • Zig 0.16.0Language. Debug = native backend, ReleaseFast = LLVM; performance held by structure, not by the optimizer.
  • ECSSparseSet core — contiguous dense arrays, cache-friendly data-oriented iteration.
  • Vulkan 1.4 + GLFW + ImGuiGraphics and the editor surface (vulkan-zig, zglfw, zgui, imguizmo).
  • Box3DVendored physics (erincatto/box3d).
  • cgltfglTF assets via C FFI bindings.
  • MCP GatewayExternal compatibility — drivers, not gods.
  • GRACE v4.2Machine-checked contracts (`zig build check-contracts`) — laws the agents live under.
  • 102 core modulesECS, render, audio, agent/AI, scenario, GUI, physics, transform + editor panels and tooling.

05 / Log element

Transmissions

Latest verified entries from /log.json, filtered to world=khan-engine. The full log lives at /log.html?project=khan-engine.