Skip to main content
V1 · V2 · V3 Dated experiment

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 →

On this page (4 sections)
  1. 1. What the Audit Found: Five Root Bottlenecks
  2. 2. Consolidating 47 → 23 Visible Node Workflows
  3. 3. 99.7% llama.cpp KV-Cache Reuse & 6.56 GiB Dual-Worker Stack
  4. 4. Checkpointing, 3D Spatial Affordances & Autonomy Lease Hardening

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.

Architecture comparison diagram contrasting the retired 43-node cold-prefill 4-model telephone game (30-36.5K cold prompt tokens per step, 0% KV reuse) against the refactored 15-node environment-mode native GGUF tool loop (99.7% llama.cpp KV prefix reuse, 47 to 23 cognitive graphs, and 6.56 GiB co-resident 0.8B Q8_0 + 9B 32K VRAM stack).
Before vs. after the November 26–28 cognitive refactor: Replacing 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:

  1. 43-node graph sprawl: environment-mode alone had grown to 43 nodes and 166 edges (4 duplicate context readers, 6 expression nodes, 3 task planners, and 2 competing status writers) across 47 workflow files—making live visual debugging nearly impossible.
  2. 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.
  3. Cold-prefill token sink (0% KV reuse): Every step rebuilt system prompts, live timestamps, status dumps, and a 13.1 KB motion schema right at the top of messages[0]. Changing a timestamp near token 0 invalidated llama-server’s KV cache on every turn, burning 30–36.5K cold prompt tokens per step.
  4. O(N2)O(N^2) SQLite checkpoint churn: Durable checkpoints re-serialized full growing node-history arrays on every transition (+3.76 MB / 603 ms on a single 43-node pass), duplicate resume events caused 78.7% no-op queue churn, a file watcher self-triggered on its own queue directory, and raw 5–10 Hz IMU packets woke sleeping waits 1,965 times in five minutes.
  5. Mode-boundary & shutdown bugs: Live simulator stress tests caught Semi-Auto cold boots bypassing the 5-minute timer, missing 9B Persona LoRA wiring, blind approach walks running without a visible target, switching into Reactive skipping 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:

SurfaceBeforeAfter (Nov 28)Reduction
Built-in Cognitive Graphs47 (39 post-Phase 1)23 workflows-51.1% graphs
Total Nodes / Edges (from 39-graph baseline)355 nodes / 671 edges176 nodes / 321 edges-50.4% nodes / -52.2% edges
Embodied Companion Graph43 nodes / 166 edges15 nodes (fast lane + native tool loop + TTS)-65.1% nodes, single status writer
Autonomy Controller26 nodes / 62 edges12 nodes (Semi [0,100] & Full dispatch)-53.8% nodes, retires 3 boredom graphs
Interactive Chat4 separate chat graphs1 unified dual-mode (dual / agent / emulation)Retires duplicate delivery subgraphs
Inner Life & Agency3 curiosity + 6 desire + 2 dream + 2 organizerUnified curiosity, 3 desire, dreamer, lightweight organizerCleaner 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 lightweight 0.8B triage LoRA (31–35 ms TTFT) routes simple commands (“wave”, “sit”, “stop”) straight through a one-shot 0.8B task LoRA without waking the 9B planner.
  • 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 blind approach with target_not_visible when no target is in view), control_posture_or_expression, speak_aloud, delegate_operator, and complete_or_park_objective.
  • Visible TTS Output & two-stage audio routing: Every spoken reply passes through an explicit TTS Output node 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 (robot speaker vs. computer speakers).
  • Automated architecture checks: CI now verifies automatically that canonical docs stay synced with the 23 graphs 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:

  1. Byte-identical messages[0] prefix: Moving live status fields, timestamps, and the 13.1 KB motion schema out of messages[0] keeps <tools>, system prompt, prior <think>/<tool_call> blocks, and role: "tool" observations 100% prefix-identical across turns.
  2. 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).
  3. 6.56 GiB co-resident dual-worker footprint:
    • Quantizing Qwen3.5-0.8B from BF16 (1.52 GB) to Q8_0 (811.8 MB) saved ~0.7 GiB VRAM while hosting four hot-swapped specialist LoRAs in 1.22 GiB:
      • Triage (v36): 99.09% route accuracy (-93.4% prompt tokens, down to 27–36 tokens).
      • One-shot Task (v35b): 100.0% schema validity, 83.9% acceptable routing, -68.0% prompt tokens, 0 false completions.
      • Freestyle: 939 clean choreography rows.
      • Edge Tool-Loop (0.8B): 99.81% tool grammar validity, passing 12/12 closed-loop rollouts (including 7/7 multi-step “Find my keys” searches for edge SBCs like the Radxa Dragon Q6A).
    • Simultaneously, Qwen3.5-9B (Q4_K_M) expanded from 8K to 32,768 context with dynamic Persona/Autonomy LoRA scaling in 5.34 GiB—for 6.56 GiB total, leaving plenty of headroom on a 16 GB GPU alongside Blender or MoGe-2.

Live Multi-Step KV-Cache Benchmark (“Find My Keys”)#

Active Model & AdapterLoop Turn & ActionCached TokensNew TokensKV Prefix ReusePrompt Prefill
0.8B Q8_0 + Triage LoRA1-Shot Triage → multi_step_loop027—195.1 ms (312.6 ms wall)
0.8B Q8_0 + Tool-Loop LoRATurn 1 → sense_environment(["keys"])01,271Cold start182.1 ms
0.8B Q8_0 + Tool-Loop LoRATurn 2 (+ tool delta) → relative_turn(90°)1,26718099.69%97.9 ms (505.5 ms turn)
Qwen3.5-9B (32K ctx)Turn 1 → sense_environment(["keys"])01,473Cold start379.8 ms
Qwen3.5-9B (32K ctx)Turn 2 (+ tool delta) → relative_turn(45°)1,46934399.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:

  • O(N)O(N) 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 mm within 250 ms) debounces in memory instead of flooding SQLite.
  • 3D spatial affordances & target coasting: Body Control now fuses RT-DETRv2 + OWLv2 2D boxes directly with MoGe-2 metric depth grids into 3D sector affordances (retiring the last legacy YOLOE shims). Active tracking adds 0–1,200 ms target coasting, 1,200–4,000 ms yaw-scan reacquisition, and 9-point PyrLK optical flow (10/10 obstacle and 10/10 occlusion simulator benchmarks passed), backed by a unified episodes diagnostic view joining receipts, unwrapped IMU yaw, and 4th-wire tracking error.
  • Hardened Reactive / Semi / Full Auto leases: Semi-Auto starts every drive strictly at 0% on boot and fires only at 100%; switching into Reactive immediately halts active autonomous runs and movement; and bridge disconnect during an open-ended walk triggers an explicit cancel backed by an 8.0 s gateway orphan-lease estop.

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

Cutting the Telephone Game: Refactoring Ainekio OS From 47 to 23 Node Workflows, 99.7% KV-Cached Autonomous Loops & Prompt-Free 0.8B Specialists
https://ainek.io/posts/2026-11-28-autonomous-node-workflow-refactor-kv-caching-and-specialists/
Author
Ainekio
Published at
2026-11-28
License
CC BY-NC-SA 4.0