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.
Built in Go, C++, Python, JSON. Every layer is independently deployable, testable, and replaceable.
Every query is routed to the cheapest model capable of handling it. Maintains per-model performance priors updated after every request.
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.
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.
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.
| Component | File | Size | Status |
|---|---|---|---|
| Bayesian Neural Router | bayesian_router.py | 18 KB | LIVE |
| Brain Router v2 (main) | brain_router_v2.py | 45 KB | LIVE |
| Brain Adapter (multi-provider) | brain_adapter.py | 28 KB | LIVE |
| Mercury Permission Gate | mercury_gate.py | 12 KB | LIVE |
| Brain Council (multi-brain consensus) | brain_council.py | 15 KB | BUILT |
Not a vector database bolt-on. A layered cognitive architecture where memories promote, consolidate, and get injected before every response.
Current conversation context. Ephemeral. Cleared after each session. Holds the immediate reasoning chain, tool results, and intermediate computations.
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.
Cross-session persistent facts about the user, their projects, preferences, and behavioral patterns. Indexed by semantic similarity. Survives restarts.
Timestamped records of significant events: deployments, errors, decisions, milestones. Enables temporal reasoning ("what did we do last Tuesday?") and pattern detection across weeks/months.
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.
Immutable mission context. Constitutional values (Preserve Life), organizational goals, non-negotiable constraints. Injected into every decision but never modified by the system.
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.
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.
| Component | File | Size | Status |
|---|---|---|---|
| Active Memory Engine | active_memory.py | 17.9 KB | LIVE |
| Memory Manager (L1-L4) | memory_manager.py | 22 KB | LIVE |
| Dreaming/Consolidation | dreaming.py | 11 KB | BUILT |
| Docket (task queue) | docket.py | 8 KB | LIVE |
YAML-based personality files loaded at runtime. Hot-swappable without restart. Each agent has a name, voice, avatar, moral framework, and behavioral fingerprint.
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.
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.
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.
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.
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.
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.
| Adapter | Purpose | Base Model | Status |
|---|---|---|---|
| qadir_v1 | Core reasoning + operator personality | Qwen 2.5 7B | TRAINED |
| qadir_v2_humble | Calibrated confidence, reduced sycophancy | Qwen 2.5 7B | TRAINED |
| memory_micro | Memory extraction and summarization | Qwen 2.5 3B | TRAINED |
| personality | Soul-aware response generation | LLaMA 3.3 8B | TRAINED |
| tools | Tool selection and parameter generation | Qwen 2.5 7B | TRAINED |
| home_assistant | Smart home control and automation | Mistral 7B | TRAINED |
| shellper | Shell command generation and safety | Qwen 2.5 3B | TRAINED |
| voice_banking | Voice-first financial operations | Qwen 2.5 7B | TRAINED |
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.
| Category | Tools | Examples |
|---|---|---|
| Desktop Control | 8 | mouse, keyboard, screenshot, OCR, window_manager |
| Browser Automation | 15 | Playwright persistent Chrome, navigate, click, fill, extract |
| Email & Comms | 12 | Gmail send/read/search, Telegram, SMS, voice calls |
| Google Workspace | 14 | Drive CRUD, Calendar events, Docs read/write, Sheets |
| Payments & Commerce | 10 | Stripe charges/products, checkout links, webhooks |
| CRM & Sales | 8 | contact management, pipeline, deal tracking |
| Infrastructure | 12 | Cloudflare Workers/D1/R2/KV, Docker, server management |
| Code Execution | 10 | Python, Node.js, Go, shell, sandbox eval |
| Git & DevOps | 9 | commit, push, branch, PR, diff, status |
| File System | 8 | read, write, search, move, watch, archive |
| ComfyUI Media | 35 | image gen, video, lip-sync, music, SFX, upscale, anime |
| Social Media | 6 | X posting, scheduling, content formatting |
| Research & Web | 10 | web search, fetch, scrape, summarize, PDF extract |
| Memory & Knowledge | 8 | recall, store, search, consolidate, dream |
| Audio & Voice | 7 | TTS, STT, voice clone, lip-sync, audio effects |
| Analytics | 5 | visitor tracking, conversion, funnel, revenue |
| Security & Auth | 5 | HMAC verify, JWT, API key management, rate limit |
| System & Config | 10 | health check, restart, config, logging, diagnostics |
Not a prompt chain. A self-correcting, self-improving execution loop with budget gating, verification steps, and training signal generation at every iteration.
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.
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.
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.
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.
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.
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