Cutting the Telephone Game: Refactoring Ainekio OS From 47 to 23 Node Workflows, 99.7% KV-Cached Autonomous Loops & Prompt-Free 0.8B Specialists
November 26–28 Ainekio OS & Body Control cognitive refactor: consolidating 47 node graphs down to 23, replacing the 4-model 'telephone game' with a 15-node native tool loop hitting 99.7% llama.cpp KV-cache reuse, fitting 0.8B Q8_0 LoRAs alongside 32K Qwen3.5-9B in 6.56 GiB VRAM, and hardening SQLite checkpoints and autonomy leases.
Dated workbench entry from . See where the robot stands today →
At the end of our November 25 Kanzagroth milestone, getting V2’s walking (MicroDuck v20) and posture (NeuralPose v8) physically reliable stripped away the mechanical noise that had been masking deeper bugs in autonomous operation.
Over November 26–28, we audited and refactored Ainekio OS (Greg-Aster/ainekio-os) and Body Control (Greg-Aster/Ainekio-bot)—consolidating 47 cognitive workflow graphs down to 23 (-50.4% nodes, -52.2% edges), replacing cold per-step prompt rebuilds with a native llama.cpp KV-cached tool loop (99.7% prefix reuse), fitting prompt-free 0.8B Q8_0 specialist LoRAs alongside 32K-context Qwen3.5-9B + Persona LoRA in 6.56 GiB VRAM, and fixing the checkpointing, spatial-perception, and lease bugs exposed in live simulation runs.

43-node graph sprawl and 30–36.5K-token cold prompt rebuilds with a 15-node two-speed companion graph, native role: “tool” delta loops (99.7% KV-cache reuse), and 23 streamlined workflows.1. What the Audit Found: Five Root Bottlenecks
Tracing cognitive graphs, llama.cpp slot logs, and SQLite execution checkpoints across multi-step errands like “Look around the room and find my keys” pinpointed five structural bottlenecks:
- 43-node graph sprawl:
environment-modealone had grown to43nodes and166edges (4 duplicate context readers, 6 expression nodes, 3 task planners, and 2 competing status writers) across47workflow files—making live visual debugging nearly impossible. - The 4-model “telephone game”: Multi-step goals bounced across four serial model calls (
Active Operator 9B→ prose →Intent 0.8B→ flags →Task 0.8B / Vision 9B→Goal Review 9B). Every handoff squeezed visual reasoning through narrow flags, causing the robot to forget which sectors it had checked—or declare completion after one photo. - Cold-prefill token sink (
0%KV reuse): Every step rebuilt system prompts, live timestamps, status dumps, and a13.1 KBmotion schema right at the top ofmessages[0]. Changing a timestamp near token0invalidatedllama-server’s KV cache on every turn, burning30–36.5Kcold prompt tokens per step. - SQLite checkpoint churn: Durable checkpoints re-serialized full growing node-history arrays on every transition (
+3.76 MB/603 mson a single 43-node pass), duplicate resume events caused78.7%no-op queue churn, a file watcher self-triggered on its own queue directory, and raw5–10 HzIMU packets woke sleeping waits1,965times in five minutes. - Mode-boundary & shutdown bugs: Live simulator stress tests caught
Semi-Autocold boots bypassing the 5-minute timer, missing9BPersona LoRA wiring, blindapproachwalks running without a visible target, switching intoReactiveskipping active child motions, and open-ended walks continuing if the host bridge shut down mid-stride.
2. Consolidating 47 → 23 Visible Node Workflows
Rather than hiding logic inside opaque scripts—which would defeat an operator-editable node workbench—we codified strict Node & Workflow Design rules and consolidated 47 graphs down to 23 single-owner workflows:
| Surface | Before | After (Nov 28) | Reduction |
|---|---|---|---|
| Built-in Cognitive Graphs | 47 (39 post-Phase 1) | 23 workflows | -51.1% graphs |
| Total Nodes / Edges (from 39-graph baseline) | 355 nodes / 671 edges | 176 nodes / 321 edges | -50.4% nodes / -52.2% edges |
| Embodied Companion Graph | 43 nodes / 166 edges | 15 nodes (fast lane + native tool loop + TTS) | -65.1% nodes, single status writer |
| Autonomy Controller | 26 nodes / 62 edges | 12 nodes (Semi [0,100] & Full dispatch) | -53.8% nodes, retires 3 boredom graphs |
| Interactive Chat | 4 separate chat graphs | 1 unified dual-mode (dual / agent / emulation) | Retires duplicate delivery subgraphs |
| Inner Life & Agency | 3 curiosity + 6 desire + 2 dream + 2 organizer | Unified curiosity, 3 desire, dreamer, lightweight organizer | Cleaner single-owner graphs |
The 15-Node Two-Speed Embodied Graph
Every spoken turn, body event, and autonomous intention now enters one readable 15-node graph:
- Fast lane (
~310 ms): A lightweight0.8Btriage LoRA (31–35 msTTFT) routes simple commands (“wave”, “sit”, “stop”) straight through a one-shot0.8Btask LoRA without waking the9Bplanner. - Native 6-tool reasoning loop: Multi-step searches and open-ended companion goals enter a 3-node loop (
Reasoning→Tool Dispatch→Tool Wait) across 6 capability-gated tools:sense_environment,move_body(rejecting blindapproachwithtarget_not_visiblewhen no target is in view),control_posture_or_expression,speak_aloud,delegate_operator, andcomplete_or_park_objective. - Visible
TTS Output& two-stage audio routing: Every spoken reply passes through an explicitTTS Outputnode on the canvas (plus a dev-only node wired from inner dialogue that disconnects with one click in production). Downstream, a two-stage switch routes audio from Ainekio OS (Off / Browser / Body Control) to Body Control (robotspeaker vs.computerspeakers). - Automated architecture checks: CI now verifies automatically that canonical docs stay synced with the
23graphs and that no node bypasses explicit TTS delivery.
3. 99.7% llama.cpp KV-Cache Reuse & 6.56 GiB Dual-Worker Stack
Inspecting the Jinja2 chat templates inside Qwen3.5-0.8B and Qwen3.5-9B alongside llama.cpp’s slot manager showed how to eliminate cold prefills:
- Byte-identical
messages[0]prefix: Moving live status fields, timestamps, and the13.1 KBmotion schema out ofmessages[0]keeps<tools>, system prompt, prior<think>/<tool_call>blocks, androle: "tool"observations 100% prefix-identical across turns. - Additive mid-task user steering: Spoken mid-task hints (“check near the couch too”) ride inside the active
role: "tool"delta rather than starting a new user message—preserving Qwen3.5’s<think>chain and keeping the vision/text KV cache hot. Only goal-replacing commands start a new turn (evicting old base64 images to keep context lean). 6.56 GiBco-resident dual-worker footprint:- Quantizing
Qwen3.5-0.8BfromBF16(1.52 GB) toQ8_0(811.8 MB) saved~0.7 GiBVRAM while hosting four hot-swapped specialist LoRAs in1.22 GiB:- Triage (
v36):99.09%route accuracy (-93.4%prompt tokens, down to27–36tokens). - One-shot Task (
v35b):100.0%schema validity,83.9%acceptable routing,-68.0%prompt tokens,0false completions. - Freestyle:
939clean choreography rows. - Edge Tool-Loop (
0.8B):99.81%tool grammar validity, passing12/12closed-loop rollouts (including7/7multi-step “Find my keys” searches for edge SBCs like theRadxa Dragon Q6A).
- Triage (
- Simultaneously,
Qwen3.5-9B(Q4_K_M) expanded from8Kto32,768context with dynamic Persona/Autonomy LoRA scaling in5.34 GiB—for6.56 GiBtotal, leaving plenty of headroom on a 16 GB GPU alongside Blender orMoGe-2.
- Quantizing
Live Multi-Step KV-Cache Benchmark (“Find My Keys”)
| Active Model & Adapter | Loop Turn & Action | Cached Tokens | New Tokens | KV Prefix Reuse | Prompt Prefill |
|---|---|---|---|---|---|
0.8B Q8_0 + Triage LoRA | 1-Shot Triage → multi_step_loop | 0 | 27 | — | 195.1 ms (312.6 ms wall) |
0.8B Q8_0 + Tool-Loop LoRA | Turn 1 → sense_environment(["keys"]) | 0 | 1,271 | Cold start | 182.1 ms |
0.8B Q8_0 + Tool-Loop LoRA | Turn 2 (+ tool delta) → relative_turn(90°) | 1,267 | 180 | 99.69% | 97.9 ms (505.5 ms turn) |
Qwen3.5-9B (32K ctx) | Turn 1 → sense_environment(["keys"]) | 0 | 1,473 | Cold start | 379.8 ms |
Qwen3.5-9B (32K ctx) | Turn 2 (+ tool delta) → relative_turn(45°) | 1,469 | 343 | 99.73% | 164.1 ms (2.31× faster; up to 9.6× multimodal) |
4. Checkpointing, 3D Spatial Affordances & Autonomy Lease Hardening
Rounding out the cognitive refactor, three runtime upgrades landed across Ainekio OS and Body Control:
- content-addressed SQLite checkpoints: Growing checkpoint arrays now chunk into SHA-256 content-addressed blocks, active-lease checks drop
78.7%of redundant resume wakes, composite indexes speed up queue lookups, and sub-threshold IMU jitter (< 2°yaw,< 30 mmwithin250 ms) debounces in memory instead of flooding SQLite. - 3D spatial affordances & target coasting: Body Control now fuses
RT-DETRv2 + OWLv22D boxes directly withMoGe-2metric depth grids into 3D sector affordances (retiring the last legacyYOLOEshims). Active tracking adds0–1,200 mstarget coasting,1,200–4,000 msyaw-scan reacquisition, and 9-pointPyrLKoptical flow (10/10obstacle and10/10occlusion simulator benchmarks passed), backed by a unified episodes diagnostic view joining receipts, unwrapped IMU yaw, and 4th-wire tracking error. - Hardened
Reactive/Semi/Full Autoleases:Semi-Autostarts every drive strictly at0%on boot and fires only at100%; switching intoReactiveimmediately halts active autonomous runs and movement; and bridge disconnect during an open-ended walk triggers an explicit cancel backed by an8.0 sgateway orphan-leaseestop.
With the closed-loop simulator qualification suites green across all 23 graphs, the next milestone on the bench is physical floor qualification—running 10 physical 2 m obstacle approaches, 10 occlusion recoveries, and a continuous unattended Full Auto session on V2 “Kanzagroth”.
Related guides: Ainekio OS Architecture · Bounded Autonomy · Don’t Skip Leg Day, Bro · simulator.ainek.io