Autonomous Closed-Loop Engine

How AI-OS Operates Autonomously

An interactive, multi-layered visual breakdown of the testing agents, self-healing supervisors, RAG retrieval engine, and permanent skill memory loops.

๐Ÿ›๏ธ Full 5-Layer Stack Architecture
Interactive ยท Click any layer for details
๐Ÿ–ฅ๏ธ Layer 1: Command, Dashboard & Gateway
PORT 9999 / 3000
Central routing tower, health probe aggregator, CORS bypass, and operator command dashboard.
aios-dashboard.html
aios-proxy-server.py
GET /proxy/services-health
POST /proxy/ux-test
โ–ผ Dispatches tests & triggers healing
๐Ÿค– Layer 2: Autonomous UX & Verification Agent
BROWSER-USE + HTTP PROBES
Simulates human navigation, inspects login forms, validates DOM state, and catches regressions.
scripts/ux_test_agent.py
browser-use 0.13.7
Ollama llama3:latest
HTTP Smoke Prober
โ–ผ Detects failure & initiates recovery
๐Ÿ”„ Layer 3: Loop Engineering & Auto-Healing Engine
LOOP-ENGINE + DEEPCODE
Audits liveness (Loop Doctor), performs 4-phase DeepCode ticket triage, and supervises restarts via PM2.
scripts/loop_engine.py
deepcode_orchestrator.py
autoagent_evaluator.py
PM2 Process Supervisor
โ–ผ Consolidates learned facts & queries RAG
๐Ÿง  Layer 4: Long-Term Memory & Local LLM Intelligence
HERMES + OLLAMA + GBRAIN
Extracts learnings from past incidents, writes permanent SOP skills, and queries vector knowledge.
hermes_memory_engine.py
memory/MEMORY.md
skills/*.md SOPs
GBrain PGLite RAG (:8000)
Ollama Engine (:11434)
โ–ผ Governs & maintains
๐Ÿ›ฐ๏ธ Layer 5: Managed Service Fleet
PERSISTENT PM2 FLEET
End-user applications, MCP tools, gateway listeners, and background daemon watchers.
Sekvnri Web App (:3002)
AlphaClaw Dashboard (:3000)
MCP Gateway (:4000)
SysAdmin & Guardian
๐Ÿ”„ Closed-Loop Self-Healing Step Simulator
Click each step to simulate the autonomous flow
STEP 01
1. Probing & UX Testing
STEP 02
2. Incident Detection
STEP 03
3. PM2 Auto-Healing
STEP 04
4. Memory & Skill Update
STEP 05
5. Re-Verification
๐Ÿ“ฆ Core System Modules & Responsibilities
๐Ÿค–
UX Test Agent
scripts/ux_test_agent.py
  • Emulates user clicks, logins, and navigations using browser-use.
  • Connects to local Ollama (llama3:latest) for vision and DOM action decisions.
  • Contains graceful fallback to multi-path HTTP schema smoke testing.
  • Directly dispatches failed services to PM2 auto-restart.
๐Ÿฉบ
Loop Doctor & Engine
scripts/loop_engine.py
  • Inspired by loop-engineering and DeepCode.
  • Doctor Mode: Periodically queries all health endpoints and scores fleet stability.
  • Triage Mode: Pulls support tickets, queries GBrain RAG, and tests fixes.
  • Appends trajectory history to logs/loop-trajectory.jsonl.
๐Ÿง 
Hermes Memory Engine
mcp-server/hermes_memory_engine.py
  • Continuous self-improvement engine inspired by Hermes Desktop.
  • Scans trajectory logs for resolved edge cases and failure patterns.
  • Appends persistent facts into memory/MEMORY.md.
  • Synthesizes structured Markdown SOP guides into skills/.
๐Ÿ›ฐ๏ธ
Control Tower Proxy
aios-proxy-server.py (:9999)
  • Threaded HTTP server and API gateway on port 9999.
  • Aggregates CPU%, memory MB, uptime, and restarts across all PM2 processes.
  • Exposes /proxy/ux-test and /proxy/self-heal endpoints.
  • Serves static dashboard UI and architecture documentation PDF.
โšก
PM2 Process Supervisor
pm2 daemon
  • Maintains 12 persistent local services in user-space.
  • Auto-restarts crashed processes or unhandled socket rejections.
  • Tracks PID, memory limit thresholds, and restarts.
  • Manages the Ollama local LLM server background daemon.
๐Ÿ“š
GBrain Knowledge Base
gbrain-server.py (:8000)
  • Embedded vector storage and RAG engine powered by PGLite.
  • Stores tax codes (DTAA), engineering incident runbooks, and docs.
  • Provides low-latency semantic context retrieval to DeepCode and agents.
  • Exposes health endpoint on http://localhost:8000/health.