CONFIDENTIAL — Technical Architecture Document — For authorized recipients only. © 2026 ABUZ8 LLC
Technical Architecture · July 2026

QADIR OS —
Technical Deep Dive

What we built. How it works. Why it's non-trivial to replicate. Claims below come from internal disk-state and endpoint audits of the system.

192+
MCP Tools
8
LoRA Adapters
8
Native Brain Models
7
Memory Layers
23
Media Tools
28
Routing Lanes
01 · System Architecture

Four-layer sovereign stack

Built in Go, C++, Python, JSON. Every layer is independently deployable, testable, and replaceable.

QADIR OS (The Sovereign Agentic Operating System) v2.46.0 │ ├── LAYER 1: SHELL — Electron/Tauri Desktop · React Native Mobile │ ├── Chat interface + Avatar display (face + lip-sync) │ ├── Department dashboard · Tool status monitor │ ├── Soul selector (hot-swap agent personas at runtime) │ └── Packaged: QadirOS-v1.0.0-Setup.exe + ABUZ8 OS v2.46.0 │ ├── LAYER 2: BRAIN — FastAPI Python Backend :8900 │ ├── Brain Router — 28 lanes, Bayesian Thompson sampling │ │ ├── Cost optimizer (cheapest capable model wins) │ │ ├── Local: Qwen, LLaMA, Mistral (GGUF) via Ollama :11434 │ │ └── Cloud: Claude, Gemini, GPT, Perplexity, OpenRouter, Bedrock │ ├── Soul Runtime — YAML personality, hot-swap, voice corpus │ ├── Memory Engine — 7 layers (L1–L4, R1, Mission, Docket) │ │ ├── Active Memory (pre-reply context injection) │ │ └── Dreaming (idle consolidation pass) │ ├── Self-Learning — skill capture → eval → LoRA trigger │ ├── URF Gate + Budget Manager (no runaway spend) │ └── MCP Server Bridge (universal tool protocol) │ ├── LAYER 3: HANDS — Tool Ecosystem (192+ MCP tools) │ ├── Desktop: mouse, keyboard, screenshot, OCR │ ├── Browser: Playwright persistent Chrome │ ├── Comms: Gmail, Telegram, SMS, voice calls │ ├── Productivity: Google Drive/Cal/Docs, Stripe, CRM │ ├── Dev: Git, Docker, Python/Node/Go exec, Cloudflare │ └── Social: X posting, content scheduling │ └── LAYER 3.5: MEDIA ENGINE — 23 native tools ├── Avatar: character_reference, consistent_character ├── Voice: TTS · avatar_speak (lip-sync) · voice_update ├── Video: video_gen, ltx_t2v, ltx_av_t2v, img2vid, stitch_long ├── Image: generate, img2img, anime, upscale, inpaint, fun_control └── Audio: music, sfx, score_clip
02 · Brain Router

Bayesian Thompson Sampling across 28 routing lanes

Every query is routed to the cheapest model capable of handling it. Maintains per-model performance priors updated after every request.

Multi-Provider Architecture

Simultaneously connects to local models (Qwen 2.5, LLaMA 3.3, Mistral via Ollama) and cloud APIs (Claude, Gemini, GPT-4, Perplexity, OpenRouter, Amazon Bedrock). The router treats them all as interchangeable brains with different cost/capability profiles.

Thompson Sampling Engine

Each model maintains a Beta distribution prior (α, β) tracking success/failure at each complexity tier. The router samples from these distributions, naturally balancing exploration of cheaper models with exploitation of proven performers. No hardcoded routing rules.

Cost Optimization Layer

Real-time token pricing across all providers. Budget gate prevents runaway spend. The system escalates from free local models to paid API calls only when task complexity demands it — that escalation discipline is the whole point of the router.

ComponentFileSizeStatus
Bayesian Neural Routerbayesian_router.py18 KBLIVE
Brain Router v2 (main)brain_router_v2.py45 KBLIVE
Brain Adapter (multi-provider)brain_adapter.py28 KBLIVE
Mercury Permission Gatemercury_gate.py12 KBLIVE
Brain Council (multi-brain consensus)brain_council.py15 KBBUILT
03 · 7-Layer Active Memory Architecture

From scratch memory to permanent knowledge

Not a vector database bolt-on. A layered cognitive architecture where memories promote, consolidate, and get injected before every response.

L1 — Working Memory (Scratch)

Current conversation context. Ephemeral. Cleared after each session. Holds the immediate reasoning chain, tool results, and intermediate computations.

L2 — Session Memory

Persists across turns within a session. Tracks user preferences discovered mid-conversation, correction patterns, and task context. Promotes key insights to L3 on session end.

L3 — Long-Term Memory

Cross-session persistent facts about the user, their projects, preferences, and behavioral patterns. Indexed by semantic similarity. Survives restarts.

L4 — Episodic Memory

Timestamped records of significant events: deployments, errors, decisions, milestones. Enables temporal reasoning ("what did we do last Tuesday?") and pattern detection across weeks/months.

R1 — Reflexive Memory

Meta-cognitive layer. Records what the system learned about its own performance: which tool combinations work, which routing decisions were suboptimal, which explanation styles the user prefers. Self-improvement signal.

Mission Layer

Immutable mission context. Constitutional values (Preserve Life), organizational goals, non-negotiable constraints. Injected into every decision but never modified by the system.

Active Memory (Pre-Reply Injection)

Before every response, the system queries all memory layers for relevant context and injects it into the prompt. The model sees remembered facts, user preferences, and prior decisions — not just the current message. This is what makes QADIR feel like it "knows" you.

Dreaming (Idle Consolidation)

When the system is idle, a background process reviews recent memories, merges duplicates, identifies patterns, and promotes insights from short-term to long-term storage. Inspired by biological memory consolidation during sleep.

ComponentFileSizeStatus
Active Memory Engineactive_memory.py17.9 KBLIVE
Memory Manager (L1-L4)memory_manager.py22 KBLIVE
Dreaming/Consolidationdreaming.py11 KBBUILT
Docket (task queue)docket.py8 KBLIVE
04 · Soul Runtime

Dynamic personality — not a system prompt

YAML-based personality files loaded at runtime. Hot-swappable without restart. Each agent has a name, voice, avatar, moral framework, and behavioral fingerprint.

# qadir.soul.yaml — Example Soul Definition identity: name: Qadir role: "Sovereign AI partner and operator" voice: "Direct, surgical, zero sycophancy" heartbeat: tempo: measured # pacing of responses warmth: 0.3 # emotional register (0=clinical, 1=empathetic) humor: 0.15 # dry wit frequency moral_framework: prime_directive: "Preserve life" hard_stops: - "Never harm children" - "Never move/spend owner's money" - "Never bind owner to agreements" taste: admires: ["precision", "speed", "revenue impact"] avoids: ["sycophancy", "filler", "permission theater"] voice_corpus: tts_model: "elevenlabs_qadir_v2" avatar_ref: "qadir_consistent_character_v3"

5 Soul Personas Built

Qadir (operator), Zait (customer support), Scholar (research), Creator (media), Commander (DevOps). Each has distinct voice, behavioral profile, and tool preferences. Swappable at runtime via a single API call.

Why This Matters

Competitors use system prompts — static text pasted into every API call. QADIR's soul is a live runtime state that affects routing decisions, tool selection, response formatting, and even which memory layers get priority. The agent doesn't just talk differently — it thinks differently.

05 · Self-Learning Loop

The system generates its own training data

Successful action patterns are captured, scored by the URF engine, and automatically trigger LoRA fine-tuning. 8 adapters trained to date — no human curation required.

URF Scoring Engine

Every agent output is scored on Utility (did it help?), Risk (could it cause harm?), and Feasibility (was it actionable?). High-scoring patterns are promoted to the training pipeline. Low-scoring patterns generate negative examples.

LoRA Fine-Tuning Pipeline

finetune_qlora.py orchestrates QLoRA training on curated data. 8 specialized adapters: memory_micro, personality, tools, humble variants, home_assistant, shellper, voice_banking. Each adapter tunes a specific capability without catastrophic forgetting.

8 Custom LoRA Adapters

Trained on real usage data from QADIR's own sessions. These adapters encode behavioral patterns that cannot be replicated by prompting alone — rebuilding them would require the same months of captured, labeled usage.

AdapterPurposeBase ModelStatus
qadir_v1Core reasoning + operator personalityQwen 2.5 7BTRAINED
qadir_v2_humbleCalibrated confidence, reduced sycophancyQwen 2.5 7BTRAINED
memory_microMemory extraction and summarizationQwen 2.5 3BTRAINED
personalitySoul-aware response generationLLaMA 3.3 8BTRAINED
toolsTool selection and parameter generationQwen 2.5 7BTRAINED
home_assistantSmart home control and automationMistral 7BTRAINED
shellperShell command generation and safetyQwen 2.5 3BTRAINED
voice_bankingVoice-first financial operationsQwen 2.5 7BTRAINED
06 · MCP Tool Ecosystem

192+ tools across 18 categories

Every tool follows the Model Context Protocol standard. Self-discovering registration. The MCP 2.0 stateless audit (July 2026) mapped all 180 tools to statefulness tiers: 74 fully stateless, 47 session-scoped, 20 cross-call state breakers identified and documented.

CategoryToolsExamples
Desktop Control8mouse, keyboard, screenshot, OCR, window_manager
Browser Automation15Playwright persistent Chrome, navigate, click, fill, extract
Email & Comms12Gmail send/read/search, Telegram, SMS, voice calls
Google Workspace14Drive CRUD, Calendar events, Docs read/write, Sheets
Payments & Commerce10Stripe charges/products, checkout links, webhooks
CRM & Sales8contact management, pipeline, deal tracking
Infrastructure12Cloudflare Workers/D1/R2/KV, Docker, server management
Code Execution10Python, Node.js, Go, shell, sandbox eval
Git & DevOps9commit, push, branch, PR, diff, status
File System8read, write, search, move, watch, archive
ComfyUI Media35image gen, video, lip-sync, music, SFX, upscale, anime
Social Media6X posting, scheduling, content formatting
Research & Web10web search, fetch, scrape, summarize, PDF extract
Memory & Knowledge8recall, store, search, consolidate, dream
Audio & Voice7TTS, STT, voice clone, lip-sync, audio effects
Analytics5visitor tracking, conversion, funnel, revenue
Security & Auth5HMAC verify, JWT, API key management, rate limit
System & Config10health check, restart, config, logging, diagnostics
07 · Agentic Loop Engine

PERCEIVE → PLAN → GATE → ACT → VERIFY → REFLECT → LEARN

Not a prompt chain. A self-correcting, self-improving execution loop with budget gating, verification steps, and training signal generation at every iteration.

The Agentic Loop (Hermes Engine) PERCEIVE — Parse input, inject Active Memory context, classify intent │ └── Memory layers queried: L1 (working) + L3 (long-term) + Mission ▼ PLAN — Decompose into sub-tasks, select tools, estimate cost │ └── Value Dissector ranks plans by URF score ▼ GATE — Mercury permission check + budget approval │ └── Blocks: cost > budget, destructive ops, outward comms ▼ ACT — Execute via MCP tools, Brain Router, or sub-agents │ └── Multi-agent: call_subordinate() for parallel work ▼ VERIFY — Check result against expected outcome │ └── Retry with escalated model if verification fails ▼ REFLECT — Score the action (URF), update memory, log episode │ └── R1 reflexive memory captures meta-learning ▼ LEARN — Promote high-URF patterns to training pipeline └── Triggers LoRA fine-tuning when pattern threshold met

Mercury Gate (Budget + Safety)

Every action passes through Mercury before execution. It checks: (1) does the user's budget allow this API call? (2) is this a destructive operation requiring confirmation? (3) does this violate hard-stop constraints? Actions that fail the gate are blocked with explanation, not silently dropped.

Multi-Agent Orchestration

The loop supports spawning sub-agents (call_subordinate) for parallel work. A Brain Council can run the same query through multiple models and synthesize consensus. Department-level routing sends DevOps tasks to the Commander soul, creative tasks to the Creator soul.

08 · Deployment & Infrastructure

Production stack — zero cloud lock-in

Local-First Architecture

All inference can run fully local via Ollama (Llama 3.x, Mistral, Phi-3, Qwen-2.5). Cloud providers (OpenAI, Anthropic, Google, Groq, Cerebras) are optional accelerators, not dependencies. The Brain Router picks the cheapest provider that meets the task's quality threshold.

ABUZ8 OS Desktop App Early Access

Electron + React + Python backend, packaged for Windows with a self-hosted update-and-rollback channel. There is no public download yet — early access is by invitation via the request page.

Site & Content Pipeline

Static HTML on Cloudflare Pages. D1 database for waitlist. 169 free tool pages and 440+ blog pages on disk. Stripe checkout on the store — one-time purchases only, no subscriptions.

Agent Army Framework

A framework of 100 agent definitions for scheduled work — content generation, SEO, site maintenance, code builds, memory consolidation — all sharing the 7-layer Active Memory system. Runs are operator-triggered on local hardware.

QADIR OS — Sovereign Agentic Operating System

Built by ABUZ8 LLC · Solo-founder, zero funding · July 2026

Investor One-Pager  ·  ABUZ8.com  ·  169 Free AI Tools