Self-healing agent · MTZ dynamics

The Autonomous Coding Engine.

Kairo clones, writes, tests, and auto-merges code. If it breaks, it heals itself using MTZ dynamics.

MTZ Visualizer
V29 Agentic
1.00.5 · fallback0.0
S (live)
0.94
Healthy
  • › probe: S=1.00 · V29 agentic path engaged
Architecture

The Oscillation Engine

Two execution paths and one immune system. Kairo moves between them based on stability, not on a fixed script.

S ≥ 0.5

V29 Agentic Path

The default mode. Kairo explores the repository, discovers the features involved, plans the change, and edits across multiple files in one coherent pass.

discovery → plan → multi-file edit
router.tsM
auth/session.tsM
db/schema.sqlM
main.pyM
S < 0.5

V28 Stateless Path

When stability drops, Kairo drops state. Fast, minimal pivots driven by the most recent scar on the LIFO stack.

scar#3 · null derefpop
scar#2 · bad import
scar#1 · test timeout
always on

The Immune System

The V33.1 Health Probe watches every change Kairo makes. When something breaks, it reverts the bad commit automatically and records the failure as a scar so the same mistake is not repeated.

  • Automatic reverts
  • Changes land through pull requests
probe V33.1anomaly → git revertscar → memory
How it works

One prompt. Full loop.

Describe the problem. Kairo clones the repository, gates every change through the AST, reverts what fails, and ships what passes.

kairo — zsh — 80×24
Last login: session restored from LIFO memory
>
waitingopen
LIFO Memory Stream

Every failure leaves a scar.

Errors become persistent memory. The newest scar is consulted first, so Kairo heals faster each time.

ERRTypeError: 'NoneType' object is not subscriptable · main.py:88
SCARnever mutate config during import
HEALreverted a91f3c2 → S restored
ERRModuleNotFoundError: No module named 'utils.cache'
SCARpin transitive deps before build
HEALAST gate rejected unsafe eval()
ERRAssertionError: expected 200, got 500 · test_api.py
SCARcheck null session before redirect
HEALfallback V28 → V29 re-entry
ERRSyntaxError: unexpected EOF while parsing
SCARrun migrations before seeding
ERRTimeoutError: health probe exceeded budget
HEALLIFO pop → scar#17 applied
SCARdo not force-push protected branches
ERRKeyError: 'GITHUB_TOKEN' · env not loaded
HEALrollback complete · tests green

Illustrative log entries.