Alluci-Ai/alluci-sovereign-agent

Python

0

516 commits

updated Sep 9, 2026

See the code

README

Alluci-Sovereign-Agent

Under Development — Coming Soon

The Self-Sovereign Personal/Professional AI Assistant

VerusID Harmonic Logic Security Sovereign Gateway ACE Engine Orchestration Synthesis


Executive Intelligence

The Alluci Sovereign Agent is a self-sovereign, multi-agent computational runtime that serves as your primary personal and professional interface acting as your high-level digital assistant, orchestrating complex workflows, multi-step research, and multi-channel communications.

Alluci unifies local on-device intelligence with policy-driven cloud model federation—allowing you to harness frontier AI capabilities while your data, memories, workflows, and intellectual property remain cryptographically secured and physically under your control within a single Self-Sovereign Agentic Operating System.


The Sovereign Manifold

The Sovereign Manifold acts as your central neural dispatch for all digital communications, workflows, and biometric state tracking. Rather than forcing you to jump between fragmented apps and isolated browser tabs, Alluci unifies your entire digital life under a single sovereign interface.

Every channel integration operates inside an isolated cryptographic Simplicial Vault bound to your VerusID, ensuring seamless multi-channel agency without cross-channel data leaks or unauthorized exposure across four core operational manifolds:

1. Apple Ecosystem

  • Apple iMessage & SMS: Native macOS E2EE iMessage dispatching and SMS bridge.
  • Apple Watch Biometrics & Sensors: Real-time Heart Rate, HRV, Respiratory Rate, and physical stress score streaming into the ACE engine.
  • iOS iPhone Gateway: iOS Push Notifications and Shortcuts local relay.
  • Apple iCloud Storage: E2EE iCloud Drive, Photos, and Reminders integration.

2. Social Manifold

  • Signal: Encrypted messaging via local E2EE daemon.
  • WhatsApp: WhatsApp Web & WhatsApp Cloud API integration.
  • Telegram: Telegram Bot API & Telethon user client gateway.
  • WeChat & WeCom: WeChat Personal & WeCom Enterprise Work Messenger.
  • Nostr: Decentralized Nostr relay protocol & NIP-04/NIP-44 encrypted direct messages.
  • Discord: Discord Bot API & Webhook gateway. X / Twitter: X API v2 Direct Messages, Mentions, and Post dispatching.
  • Instagram: Instagram Direct Messaging & Business Graph API.
  • Facebook Messenger: Meta Facebook Page & Messenger Graph API.
  • BlueSky: AT Protocol XRPC API feed posting, notification polling, and direct messaging.

3. Enterprise Core & Developer Workspace

  • Slack: Enterprise Slack Socket Mode workspace bridge.
  • Microsoft Teams: Microsoft Graph & Teams enterprise channel bridge.
  • Google Workspace: Gmail OAuth2/PubSub & Google Chat API.
  • Google Drive & Docs: Google Drive files, Docs, and Sheets synchronization.
  • Universal Email: Standard IMAP / SMTP email channel integration.
  • Notion Workspace: Notion databases, pages, and workplace memory sync.
  • GitHub Workspace: GitHub repos, issues, pull requests, and webhooks.
  • WebChat Gateway: Streaming WebSocket administrative chat gateway.

4. Verus Sovereign Identity & Blockchain

  • VerusID Sovereign Identity: Decentralized cryptographic identity, claim signing, and vault access control.
  • Verus Blockchain Node & Fund Management: Local Verus node RPC, sovereign wallet fund management, and cryptographic transaction signing.
  • Federated Pheromone Network (PPN): Swarm intelligence problem-solving paths broadcasting topological barcodes over the Verus P2P network.

Multi-Modal Synthesis & API Orchestration

The Multi-Modal Synthesis & API Orchestration engine serves as Alluci’s unified control plane for generative tools, token routers, and cognitive services. Rather than locking you into a single closed ecosystem, Alluci provides policy-driven model federation—dynamically routing tasks across specialized foundation models, voice synthesis engines, and generative media tools while respecting your local privacy constraints and token budge.

1. LLM & Reasoning

  • OpenAI: Advanced general reasoning, multi-modal synthesis, and strategic agentic planning.
  • Anthropic: Deep architectural code generation, complex context analysis, and safety-aligned logical reasoning.
  • Google Cloud: Massive multi-modal context windows, rapid token processing, and broad knowledge synthesis.
  • Groq: Ultra-high-speed LPU inference for real-time tactical execution and sub-second token delivery.
  • xAI (Grok): High-throughput real-time knowledge synthesis and conversational reasoning.
  • DeepSeek: High-efficiency open-architecture reasoning and mathematical problem-solving.
  • Unsloth: On-device memory-optimized model fine-tuning and low-VRAM model distillation.
  • Token Router: Dynamic token budget optimization, multi-provider latency balancing, and intelligent context distribution.
  • OpenRouter: Dynamic multi-provider API aggregation and intelligent failover routing.
  • LM Studio: Local open-weight model hosting and airgapped desktop inference.
  • Together AI: Scalable open-source model infrastructure and custom fine-tune deployment.
  • Cohere: Enterprise RAG, semantic retrieval, and structured business document intelligence.
  • AWS Bedrock: Enterprise security compliance, managed cloud foundation models, and scalable infrastructure.

2. Conversational Audio & Voice

  • ElevenLabs: High-fidelity voice synthesis and custom voice cloning.
  • ElevenLabs Agents: Autonomous conversational voice agent API.
  • Retell AI: Professional automated telephony and voice dialogue.
  • OpenAI Realtime API: Bidirectional low-latency streaming vocal interaction.
  • Inworld AI: Dynamic character and interactive persona voice engine.

3. Image Generation

  • Midjourney: Cinematic & artistic image generation.
  • Fal AI: Ultra-fast FLUX.1 & SDXL image synthesis.
  • Seedance: Generative image synthesis.
  • Google NanoBanana: High-speed web-scale image creation.
  • OpenAI DALL·E 3: High-precision prompt-driven image generation.
  • Adobe Firefly: Commercial-grade generative image and vector design.

4. Video Generation

  • RunwayML: Runway Gen-2 & Gen-3 Alpha video generation.
  • Luma Dream Machine: High-resolution realistic motion video.
  • Google Veo: Generative temporal video model.
  • Google Genie: Interactive generative world and video environment engine.
  • HeyGen: AI avatar and video spokesperson generation.
  • Seedance Video: Generative video synthesis.
  • Livepeer: Decentralized live video streaming and transcoding network.

5. Music Generation

  • ElevenLabs Music: Instrumental and sonic music generation.
  • Suno: Full-track vocal and musical composition.
  • Soundverse: AI-driven audio and sonic structure creation.
  • Google Lyria: Generative music composition engine.
  • Stable Audio: High-resolution acoustic and electronic music generation.
  • Udio: Full-track vocal, pop, and orchestral composition.

The Polytope Manifold Architecture

The Polytope Manifold Architecture serves as the core cognitive blueprint governing how Alluci processes intelligence, preserves stateful memory, and executes multi-agent workflows.

Alluci is powered by a hybrid computational runtime—combining native Python execution engines with high-performance compiled C++ extensions and specialized topological kernels. This architecture pairs proactive cognition and a native Apple MLX engine driving on-device foundation model evaluation on Unified Memory with Non-Euclidean geometric manifold mapping and Betti signature context indexing across a stateful 4-Tier Memory System.

System execution is governed by a three-pillar action safety loop enforcing Lipschitz gradient smoothness and payload verification, integer simplicial boundary operators for Betti topology discrete manifold verification, high-frequency signal processing and harmonic lattice calculations, and cryptographic Simplicial Vault isolation encrypting credentials and bridge secrets via AES-256-GCM.


Polytope Projection Network (PPN)

The Polytope Projection Network (PPN) serves as Alluci’s non-Euclidean geometric intelligence engine. Moving beyond traditional, hallucination-prone vector similarity lookups, PPN projects unstructured multi-modal data streams—text, biometrics, tool actions, and execution traces—into topologically stable geometric manifolds. Governed by algebraic topology and simplicial homology, PPN evaluates state continuity using Betti signatures ($\beta_0, \beta_1, \beta_2$), ensuring that cognitive operations maintain structural integrity across execution cycles.

Topological Manifold Projection & Simplicial Homology

  • Non-Euclidean Representation: Transforms high-dimensional embeddings into low-dimensional geometric manifolds ($d=32$) using fixed deterministic projection matrices, constructing Rips complexes to compute real graph-theoretic simplicial homology.
  • Betti Signature Extraction: Computes invariant Betti topological invariants ($\beta_0$ connected components, $\beta_1$ 1-skeleton cycles, $\beta_2$ 3-clique voids) to quantify topological coherence without relying on fragile keyword matching.

Fixed-Point Quantization & Deterministic Safety (SEC-005)

  • Deterministic Fixed-Point Normalization: Quantizes tensor projections to fixed-point precision ($1/\text{scale}$ steps clamped to int16 boundaries), eliminating floating-point non-determinism across host CPU and Metal GPU runtimes.
  • Side-Channel Mitigation: Prevents timing attacks and numerical drift, ensuring identical manifold states across independent execution nodes and background iterations.

Multimodal Polytope Fusion & Bio-Affective Attunement (ACE)

  • Direct Physiological Coupling: Dynamically couples real-time Apple Watch biometrics (HRV, respiratory rate, stress scores) and affective tension ($\psi$) directly into manifold geometry.
  • Topological Coherence Scoring: Adjusts manifold elasticity and coherence scores ($C \in [0.1, 0.95]$) based on user valence and arousal, modulating agent autonomy without requiring string-to-vector language conversion.

Real-Time Manifold Stability & Tearing Detection

  • Pre-Execution Manifold Checks (_perform_ppn_check): Evaluates candidate task objectives and tool actions for topological tearing ($\Delta \beta$ norm spikes, entropy threshold breaches) before committing steps to execution pipelines.
  • Self-Healing State Recovery: Triggers immediate execution halts or corrective prompt injections when manifold tearing is detected, preventing cascade failures and hallucinated state drift.

Federated Digital Pheromones & Swarm Synchronization

  • Structural Barcode Extraction: Distills complex problem-solving paths into compact, invariant topological barcodes.

  • Zero-Knowledge Swarm Broadcast: Broadcasts structural barcodes over the Verus P2P network, enabling federated multi-agent swarm intelligence without exposing raw prompt context or private user data.


Discrete Projection Kernel (DPK)

The Discrete Projection Kernel (DPK) serves as the high-speed, zero-trust cryptographic gatekeeper of the Alluci execution runtime. Grounded in Kepler's Stella Octangula $S_8$ geometry (compound of dual regular tetrahedra $T_+ \cup T_-$ with 8 vertices, 12 edges, 8 faces, and central octahedron $O_6$), DPK validates state transition vectors ($\mathbf{x}_{t-1} \to \mathbf{x}_t$), enforcing topological boundary nilpotence, Euler characteristic invariants ($\chi = V - E + F$), and idempotent fusion projections before any tool or agent action executes.

Kepler's Stella Octangula $S_8$ & Simplicial Boundary Nilpotence

  • Simplicial Boundary Matrices ($B_1, B_2$): Maps chains $C_2 \xrightarrow{\partial_2} C_1 \xrightarrow{\partial_1} C_0$ using integer boundary matrices $B_1 \in \mathbb{R}^{8 \times 12}$ and $B_2 \in \mathbb{R}^{12 \times 8}$, verifying the Fundamental Theorem of Algebraic Topology: $$\partial_1 \circ \partial_2 = 0 \quad (\text{Exact Boundary Composition Nilpotence: } B_1 B_2 = 0)$$
  • Idempotent Fusion Simplex Operator ($F_n^1$): Projects continuous state vectors onto the convex hull of $S_8$, enforcing exact idempotence $\Pi(\Pi(x)) = \Pi(x)$ for all $x \in \mathbb{R}^3$.
  • Entropic Arrow of Time Monotonicity: Verifies that conditional Shannon entropy across execution states is non-decreasing: $H(X_n \mid X_1) \ge H(X_{n-1} \mid X_1) - \epsilon$.

Integer Boundary Operators & $\mathcal{O}(1)$ Discrete Verification

  • Exact Simplicial Arithmetic: Evaluates topological state transitions using integer simplicial boundary operators ($\partial_k$), computing Euler invariants ($\chi$) in $\mathcal{O}(1)$ time complexity without floating-point rounding errors.
  • Native C++ Performance Acceleration: Dispatches validation queries through a compiled native C++ shared library (dpk_kernel.cpp / ctypes), falling back to a pure Python implementation when hardware constraints dictate.

Dynamic Manifold Tearing & Topology Shift Detection

  • State Shift Calculation ($\Delta \text{Topology}$): Monitors directional topological shift between consecutive execution steps ($\mathbf{s}_{t-1}$ and $\mathbf{s}_t$).
  • Tearing Threshold Enforcement: If topological shift breaches the calibrated dynamic threshold ($\Delta \text{Shift} > \theta_{\text{dynamic}}$), DPK raises a TearingException, instantly halting execution to prevent state corruption or hallucinated loop cascades.

Cryptographic Attribution Hashing (AAP-003)

  • Sovereign Hash Chain: Computes deterministic 64-bit signature hashes ($\text{Hash}_{64}$) derived from SHA-256 for every PolytopeState.
  • VerusID Cryptographic Anchoring: Anchors state transitions and action payloads to the host's VerusID sovereign cryptographic identity, establishing an un-forgeable audit trail for execution history.

Continuous Statistical Safety Calibration & Human-in-the-Loop Override

  • Dynamic Risk Calibration: Integrates with the CalibrationManager to dynamically calibrate safety rejection thresholds based on execution history, affective tension ($\psi$), and active workspace permissions.
  • HITL Executive Security Governance: Supports explicit Human-in-the-Loop (HITL) administrative overrides (is_override=True), allowing authorized users to bypass false-positive manifold halts while preserving audit logs.

Sovereign Topological State Spaces $(W, X, G, N)$ & $\mathcal{J}$-Space World Model

The Sovereign Topological State Space Subsystem (backend/topology/) formalizes Alluci's cognitive reasoning into a mathematically bounded 5-tuple $(W, X, \mathcal{J}, G, N)$ governed by rigorous algebraic topology operators:

          ┌────────────────────────────────────────────────────────┐
          │               W (World Data Space)                    │
          └──────────────────────────┬─────────────────────────────┘
                                     │  P: W × X → [0,1]
                                     ▼  (Vietoris-Rips Filtration)
          ┌────────────────────────────────────────────────────────┐
          │         X (Experience Simplicial Space)                │
          │         [Betti Invariants: β₀, β₁, β₂, β₃]             │
          └──────────────────────────┬─────────────────────────────┘
                                     │  S: X × G × J → J
                                     ▼  (Simplicial CoT & Socratic Synthesis)
          ┌────────────────────────────────────────────────────────┐
          │     J (J-Space Counterfactual Simulation Sandbox)      │
          │     Kepler S₈ Synthesis: T₊ ∪ T₋ → O₆ Kernel          │
          └──────────────────────────┬─────────────────────────────┘
                                     │  D: J × G → [0,1]
                                     ▼  (Convex Hull Affordance)
          ┌────────────────────────────────────────────────────────┐
          │         G (Action Affordance Envelope Space)           │
          │         [3D Risk Simplex & Sub-Agent Bounds]           │
          └──────────────────────────┬─────────────────────────────┘
                                     │  A: G × W → [0,1]
                                     ▼  (Markov Trace & DPO Harvesting)
          ┌────────────────────────────────────────────────────────┐
          │     N (Discrete Topological Barcode Clock Count)       │
          │     [Monotonic Pacing: N → N+1, Birth/Death Tracking]  │
          └────────────────────────────────────────────────────────┘

1. Foundational State Spaces $(W, X, \mathcal{J}, G, N)$

  • $W$ (World Data Space): Continuous, unbounded environmental data streams, real-time biometrics, user messages, file system inputs, and raw knowledge graphs.
  • $X$ (Experience Simplicial Complex Space): Invariant simplicial complexes and Betti topological numbers ($\beta_0, \beta_1, \beta_2, \beta_3$) generated from $W$ via Vietoris-Rips simplicial filtration at scale radius $\epsilon$.
  • $\mathcal{J}$ ($\mathcal{J}$-Space Counterfactual Simulation Sandbox): Air-gapped mental sandbox executing multi-step predictive rollouts, Simplicial Chain-of-Thought (S-CoT) boundary verification, and Socratic dialectic synthesis before committing actions to external environments.
  • $G$ (Action Affordance Envelope Space): Convex hull boundary defining permissible action vectors, tool invocations, and sub-agent capability bounds on a 3D spatial risk coordinate simplex.
  • $N$ (Discrete Barcode Clock Count): Monotonic discrete clock count tracking topological feature births ($b$), deaths ($d$), lifetime persistence, and active Betti numbers across all cognitive cycles.

2. The Four Foundational Algebraic Operators $(P, S, D, A)$

  • Perceive ($P: W \times X \to [0, 1]$ / PMETFiltrationEngine): Samples multi-dimensional point clouds from $W$, constructs Vietoris-Rips complexes up to 2-skeleton (triangular faces), and extracts exact Betti invariants ($\beta_0$ connected components, $\beta_1$ 1-skeleton cycles, $\beta_2$ 2-voids).
  • Simulate ($S: X \times G \times \mathcal{J} \to \mathcal{J}$ / JSpaceSimulator): Evaluates multi-step counterfactual simulation traces, validating deductive reasoning steps as 2-simplices to ensure algebraic boundary nilpotence ($\partial_1 \circ \partial_2 = 0$). Reconciles constructive hypotheses ($T_+$) and critical skeptic critiques ($T_-$) into the central intersection kernel ($O_6$).
  • Decide ($D: \mathcal{J} \times G \to [0, 1]$ / ActionAffordanceEnvelope): Validates candidate execution vectors against sub-agent domain boundaries (Codi, Rocco, Admin) and bio-affective stress thresholds ($\psi \le 0.85$), ensuring destructive tasks are strictly intercepted by HITL governance.
  • Act ($A: G \times W \to [0, 1]$ / MarkovTraceEngine & DPOTripletHarvester): Executes verified actions, evaluates multi-step trajectories using the Schur complement Markov Trace operator ($\text{Tr}_A(P) = A + B(I-C)^{-1}D$), monitors Frenet-Serret curvature ($\kappa \le 5.0$), and records verified $(x, y_w, y_l)$ preference triplets for offline distillation.

3. Simplicial Chain-of-Thought (S-CoT) & Boundary Nilpotence

  • Triadic Deductive Simplices: Represents reasoning triads (Premise A, Premise B $\implies$ Conclusion C) as oriented 2-simplices $\sigma = [V_0, V_1, V_2]$.
  • Algebraic Nilpotence Verification: Enforces exact boundary composition nilpotence ($\partial_1 \circ \partial_2 = 0$) on code/tool execution DAGs, eliminating circular dependencies, self-referential tautologies, and hallucinated reasoning loops.
  • Elastic Conversational Relaxation: Applies adaptive topological relaxation during open-ended creative dialogue to permit high-temperature associative leaps without triggering premature safe-halts.

4. Thread-Safe Topological Barcode Clock (TopologicalBarcodeClock)

  • Discrete Pacing Primitive: Provides a synchronized discrete clock count ($N \to N+1$) that paces H-LSM memory decay, PCL world model snapshots, and Heartbeat diagnostic orders.
  • Persistence Interval Tracking: Computes feature lifespans $\Delta N = d - b$ for memories, goals, and sub-agent trajectories.
  • Active 1D Topological Hole Detection: Evaluates active Betti numbers ($\beta_1$ count); if $\beta_1 > 0$ during sub-agent execution, detects circular reasoning loops and triggers corrective self-healing.

Action Verification Loop (AVL Gate)

The Action Verification Loop (AVL Gate) serves as Alluci’s zero-trust safety and payload verification engine. Functioning as an inline firewall between LLM generation outputs and tool execution adapters, the AVL Gate enforces a mathematical three-pillar security protocol. It prevents unauthorized code execution, prompt injections, and structural hallucinations by verifying cryptographic attribution, gradient smoothness limits, and topological continuity before any action payload is committed.

Three-Pillar Structural Safety Protocol

  • Pillar 1: Sovereign Attribution Verification: Checks signature hashes ($\text{Hash}_{64} \neq 0$), hard-rejecting any unsigned or external manifold completions that lack cryptographic proof of origin.
  • Pillar 2: ALCE Gradient Smoothness Verification: Enforces Lipschitz continuity budget limits ($\text{Budget}{\text{used}} \leq \text{Budget}{\text{dynamic}}$). Rejects actions that breach Relational Boundary Manifolds ($\text{RBM}$) to eliminate gradient explosion and execution runaways.
  • Pillar 3: Topological Continuity Verification: Validates Euler characteristic consistency ($|\chi - \beta_{\chi}| \leq \text{Euler}_{\text{tolerance}}$, where $\chi = V - E + F$), detecting structural ruptures and hallucinated sequence jumps.

GJK Convex Boundary Projection & Structured Tool Clamping

  • Gilbert-Johnson-Keerthi (GJK) Distance Algorithm: Evaluates out-of-bounds action vectors against admissible manifold boundaries using support point functions $S_{S8}(d)$.
  • Deterministic Action Refinement (project_to_boundary): Projects near-boundary prompt violations back into admissible Lipschitz bounds, neutralizing prompt injection attacks without disrupting execution flow.
  • Structured Tool Payload Clamping (verify_action_payload): Dynamically scales and clamps numeric tool parameters (top_k, limit, timeout, depth, steps, count, max_tokens) proportionally to available Lipschitz budget capacity.

Self-Healing Executive Loop & Protocol 3 Lipschitz Saturation

  • Corrective Prompt Injection: When an action payload fails verification, the ExecutiveOrchestrator self-healing loop injects a high-priority <SECURITY_RUPTURE> prompt directive, instructing the agent to regenerate a safe, strictly bounded plan.
  • Protocol 3 Lipschitz Saturation (3-Strike Lock): If gradient smoothness violations persist across 3 consecutive iterations, the AVL Gate forces a hard exit to HUMAN-IN-THE-LOOP REQUIRED mode, halting autonomous execution to preserve workspace integrity.

Discovery Mode Learning & Evolving Thresholds

  • Dynamic Baseline Calibration: Integrates with the CalibrationManager (avl_calibration_cache.json) to continuously track execution history, tool success rates, and affective tension ($\psi$).
  • Adaptive Rejection Calibration: Automatically adjusts safety rejection thresholds over time—learning routine operational baselines to eliminate false positives while maintaining zero-trust governance.

Proactive Cognition Layer (PCL)

The Proactive Cognition Layer (PCL) serves as Alluci’s continuous background reasoning and autonomous intelligence engine. Architecturally distinct from passive event watchers or simple cron pollers, PCL operates as an autonomous cognitive loop—continuously observing system signals, constructing stateful world models, identifying execution opportunities, and executing proactive workstreams without requiring explicit user prompting.

Five-Stage Cognitive Lifecycle (OBSERVE → MODEL → DETECT → JUDGE → ACT)

  • Observe: Scans multi-modal signal sources across active goals, inbound channel threads, H-LSM episodic memory, and real-time biometrics.
  • Model: Synthesizes raw environmental metrics into a structured, unified WorldModel snapshot persisted to SQLite database tables (pcl_world_snapshot).
  • Detect: Executes pluggable opportunity detection engines (StalledGoalDetector, UnresolvedThreadDetector, HardwareAnomalyDetector, AffectiveStressDetector) to discover actionable tasks.
  • Judge: Evaluates candidate opportunities against affective stress ($\psi$), quiet-hours boundaries ($22:00–07:00$), and workspace policy constraints, assigning calibrated confidence scores ($S_{\text{conf}} \in [0.0, 1.0]$).
  • Act / Notify: Dispatches verified low-risk background execution pipelines directly to the ExecutiveOrchestrator or broadcasts non-intrusive administrative notifications via streaming WebSockets (JsonRpcGateway).

Persistent World Model Synthesis

  • Stateful Snapshot Engine: Tracks long-term goal trajectories, project deadlines, and unresolved memory threads over rolling 48-hour windows.
  • Dream Cycle Integration: Feeds compressed world model snapshots into the nightly "Dream" cycle, enabling Socratic self-reflection and teacher-student preference harvests while hardware load is low.

Bio-Affective & Autonomy Calibration (ACE Integration)

  • Affective Stress Gating: Reads real-time valence, arousal, and stress scores ($\psi$) from the Affective Computing Engine (ACE).
  • Dynamic Intrusiveness Control: Automatically deprioritizes non-critical notifications and background task dispatches during high user stress, preserving focus and aligning system behavior with human physiology.

PVT Manifold Health Monitor (PVT)

The PVT Manifold Health Monitor (PVT) serves as Alluci’s real-time thermodynamic health and stability engine. Operating as a continuous diagnostic monitor within the ExecutiveOrchestrator, PVT models the cognitive state space using a thermodynamic triple ($P, V, T$) and Frenet-Serret state trajectory kinematics. It measures manifold pressure, available agency volume, entropy temperature, and trajectory curvature to prevent system instability, topological drift, and unauthorized execution runaways.

Thermodynamic State Triple ($P, V, T$)

  • Pressure ($P \in [0.0, 1.0]$): Measures constraint density relative to admissible volume ($P = \frac{\text{Active Constraints}}{4.0 \cdot V_{\text{agency}} + \epsilon}$). High pressure ($P > 0.8$) indicates hyper-constrained cognitive state space.
  • Volume ($V \in [0.0, 1.0]$): Quantifies admissible polytope hyper-volume and agent agency space ($V = (1 - \text{Budget}_{\text{used}}) \cdot \text{Coherence}$). Low volume ($V < 0.2$) indicates restricted operational autonomy.
  • Temperature ($T \in [0.0, 1.0]$): Tracks entropy spikes, topological instability, and trajectory curvature ($T = \Delta \beta_{\text{norm}} + D_{\text{KL}}(P_t \parallel P_{t-1}) + 0.3 \cdot \kappa_{\text{norm}}$). Evaluates normalized Betti signature shifts ($\Delta \beta$) and Kullback-Leibler divergence between execution steps.

Polytope Trajectory Continuity & Frenet-Serret Curvature (trajectory.py)

  • Geodesic Kinematics: Continuously tracks state trajectory vectors $\gamma(t) \in \mathbb{R}^d$, computing velocity $v(t) = \gamma(t) - \gamma(t-1)$ and acceleration $a(t) = \gamma(t) - 2\gamma(t-1) + \gamma(t-2)$.
  • Frenet-Serret Curvature Calculation: Derives instantaneous trajectory curvature: $$\kappa(t) = \frac{\sqrt{|v|^2 |a|^2 - (v \cdot a)^2}}{|v|^3 + \epsilon}$$
  • Curvature Rupture Detection: Detects abrupt cognitive shocks or prompt injection snaps when $\kappa(t) > 5.0$.

Real-Time Rupture Threshold & Safe-Halt Protocol

  • Rupture Detection ($T > 0.8$ or $\kappa > 5.0$): When entropy temperature breaches the critical rupture threshold ($T > 0.8$) or trajectory curvature snaps ($\kappa > 5.0$), PVT flags a CRITICAL state.
  • Emergency Safe-Halt ($g=0$): The ExecutiveOrchestrator immediately engages an emergency safe-halt ($g=0$), freezing tool actions and locking execution to protect workspace state.

Real-Time Telemetry & Audit Ledger Integration

  • WebSocket Streaming Gateway (manifold.pvt): Pushes live PVT telemetry triples ($P, V, T$) and curvature metrics over WebSocket RPC to client dashboards (PVTDashboard.tsx).
  • Cryptographic Audit Persistence (pvt_json): Serializes PVT diagnostic state triples into SQLite audit log ledgers (pvt_json), generating an immutable record of system thermodynamic stability.

Affective Computing Engine (ACE)

The ACE aligns machine logic with human biology. It bridges raw data and human sentiment, ensuring the assistant works in resonance with your current physiological and mental state.

Multi-Modal Polytope Fusion

  • Zero-Latency Biometrics: Streams Heart Rate, HRV, and Respiratory Rate directly from your Apple Watch into a shared "Affective Polytope". The agent intrinsically "feels" your physical stress without relying on string-to-vector language conversions.
  • Resonance Mapping: ACE adjusts agent autonomy and notification intensity in real-time. If physical strain is high, the Assistant deprioritizes non-urgent tasks.
  • Ambient ACE Dashboard: An SVG-based dynamic visualizer in the Terminal header. A pulsating Polytope shifts color (Valence), animation speed (Arousal), and structural complexity (Tension) in real-time to mirror your physical state.

1. The Local Cognitive Engine (LCE)

The Local Cognitive Engine (LCE) serves as Alluci’s native, on-device foundation intelligence substrate. Built around a Sovereign-First execution model, the LCE evaluates neural network models locally on host hardware—delivering ultra-low latency, zero-copy memory access, dynamic VRAM safeguards, and privacy-preserving cloud federation without cloud vendor lock-in or un-sanctioned data egress.

Official quantized model weights across all tiers are hosted on HuggingFace (Alluci LCE Models).

Apple Silicon Execution Plane

  • Native MLX Engine: Evaluates models 100% natively using Apple mlx_lm and mlx_vlm frameworks, leveraging Apple Silicon’s shared Unified Memory architecture for zero-copy tensor evaluation.
  • Thread-Safe Singleton & Async Lock: Operates as a thread-safe singleton managed by a strict Python asyncio.Lock inference semaphore, ensuring only one generation stream executes at any given moment to protect Metal GPU command buffers from memory panics.
  • Single & Multi-Worker Compute Threads: Offloads heavy non-blocking synchronous matrix calculations to a dedicated single-worker thread pool (ThreadPoolExecutor), while multi-agent task queues manage async token dispatching in parallel.
  • Dynamic Architectural Binding: Dynamically maps custom or fine-tuned model architectures to native mlx_lm model classes at runtime without monkey-patching codebase files.

Non-Apple Operating Systems Execution Plane

  • Cross-Platform PC & Linux Engine: On Windows, Linux, and NVIDIA CUDA environments, the LCE routes local inference requests through local_bridge.py utilizing standard llama.cpp C++ GGUF bindings or CUDA-accelerated PyTorch/vLLM adapters.
  • Unified API Parity: Ensures identical privacy gating, PII pseudonymization, and 4-tier memory integration across non-Apple hardware.

5-Tier System Hardware Profiling Matrix

Automatically profiles available System RAM and VRAM upon initialization, mapping the host environment to Apple’s product lineup and optimal model precision tiers:

  • TIER_0_ULTRA ($\ge 128\text{ GB} - 512\text{ GB}$ Unified RAM / $\ge 96\text{ GB}$ Code Threshold): Flagship Workstations & Sovereign Server Nodes (MacBook Pro / Mac Studio / Mac Pro Ultra) running unquantized 31B 16-bit (BF16) dense models.
  • TIER_1_MAX ($64\text{ GB} - 96\text{ GB}$ Unified RAM / $\ge 60\text{ GB}$ Code Threshold): High-Performance Studio & Pro Workstations (MacBook Pro / Mac Studio Max) running high-density 31B 8-bit / 4-bit models.
  • TIER_2_PRO ($32\text{ GB} - 48\text{ GB}$ Unified RAM / $\ge 30\text{ GB}$ Code Threshold): Executive & Developer Laptops (MacBook Pro Pro/Max Series) running 26B Mixture-of-Experts (MoE) 4-bit models.
  • TIER_3_BASE ($16\text{ GB} - 24\text{ GB}$ Unified RAM / $\ge 15\text{ GB}$ Code Threshold): Standard Consumer Hardware (MacBook Air, Mac mini, iMac) running 12B 4-bit dense models.
  • TIER_4_EDGE ($8\text{ GB} - 12\text{ GB}$ Unified RAM / $< 15\text{ GB}$ Code Threshold): Mobile Devices & Sentinels (iPhone 17 Series / Base Macs) running lightweight 2B 4-bit models.

VRAM Lifecycle, KV Cache & Offloading Safeguards

  • Metal VRAM Cache Ceiling: Metal GPU VRAM cache allocation (mx.set_cache_limit) to prevent host system slowdowns.
  • RAM Ceiling Protection: Restricts peak memory allocation to 75% of total system RAM.
  • Dynamic Q4 KV Cache Quantization: Automatically detects long prompts and activates 4-bit KV cache quantization while capping max generation tokens to prevent Metal buffer overflow crashes.
  • Streaming Attention Sinks (>16k Characters): When prompt context length exceeds 16,000 characters (>4,000 tokens), _apply_streaming_attention_sink() permanently pins initial system directives, zero-trust invariants, and grounding laws at token 0 (sink size: 2,000 chars) while maintaining a rolling active conversational tail (14,000 chars). Intermediate conversational turns are archived into H-LSM L1 episodic memory, enabling infinite multi-turn sessions without memory spikes.
  • Inter-Iteration VRAM Purging: Compulsory mx.clear_cache() and Python garbage collection calls execute before, during, and after every generation stream.
  • Idle Memory Auto-Offloader: Spawns a background thread monitor that unloads model weights and releases VRAM after idle time.

Zero-Restart LoRA Context Moat Ingestion

  • Dynamic Adapter Hot-Swapping: When specialized agents execute domain tasks (e.g. Legal, Financial, Coding), the LCE hot-swaps per-agent LoRA weights (models/loras/agent_{id}_lora.safetensors) directly into the active MLX model on the fly without restarting the engine process or breaking skill manifests.

Bio-Affective Telemetry Attunement

  • Silent System Directive Injection: Injects a silent <ACE_ATTUNEMENT_DIRECTIVE> into system prompts matching real-time Apple Watch biometrics (HRV, respiratory rate, stress score).
  • Dynamic Sampling Temperature Modulation: Dynamically modulates sampling temperature during high human stress (for hyper-focused, deterministic outputs) to relaxed states (for creative exploration).

Native Apple MLX Speculative Decoding (2B ➔ 31B)

  • Draft-Verification Acceleration: Pairs the lightweight edge model (mirror_cache/alluci-polytope-gemma-4-e2b-it-4bit) as an asynchronous speculator with the dense verifier model (mirror_cache/alluci-polytope-gemma-4-31b-it-bf16).
  • Parallel Sequence Validation: Evaluates speculated token streams natively through mlx_lm.stream_generate(..., draft_model=draft_engine), achieving 2.5x–4x faster local inference speeds with zero loss in mathematical precision.
  • Automated Fallback Circuit-Breaker: If draft model loading or memory allocation encounters pressure, the engine transparently retries via single-model generation with zero user disruption.

Model Router & Cross-Platform Scoping

  • Policy-Driven Execution: Routes requests dynamically based on privacy classifications (AIRGAPPED, SENSITIVE, PUBLIC) and token complexity requirements.
  • Cross-Platform PC Scoping: On non-Apple Silicon nodes (Windows, Linux, NVIDIA CUDA), automatically falls back to standard cross-platform backends (llama.cpp bindings or CUDA PyTorch/vLLM adapters) via local_bridge.py.

Neural Decoupling Layer

  • Abstract Engine Interface: Implemented by the abstract ExecutiveRouter interface, decoupling the high-level Agent Harness (skills, tools, memory, bridges) from underlying model weights so base weights can be upgraded without breaking skill manifests.

User Defined Privacy Gating

  • On-Device Isolation: Automatically intercepts tasks classified as AIRGAPPED or SENSITIVE, hard-routing them 100% on-device inside the local MLX engine with zero network egress.

Local PII Extraction & Pseudonymization

  • Inline Egress Firewall: When tasks are policy-routed to cloud model providers, outbound prompts pass through the AlluciSecureProxy. Sensitive names, phone numbers, email addresses, and private keys are extracted into a local ephemeral vault and replaced in the outbound prompt by abstract placeholders (e.g., <PERSON_1>, <PHONE_1>).

Local Response Re-Hydration

  • Local Vault Token Restoration: When external API models return their text response, the AlluciSecureProxy restores the original vault data locally on your device, delivering complete answers without external cloud providers ever receiving raw user PII.

2. Local Voice & Conversational Speech Engine

The Local Voice & Conversational Speech Engine (AlluciVoiceOrchestrator in backend/inference/voice_orchestrator.py) provides native, zero-latency audio transcription and cross-device voice interaction. Operating natively on host hardware, the Voice Engine pairs Apple Silicon mlx_whisper speech-to-text with hybrid voice synthesis, dynamically routing audio payloads based on host device capabilities.

Streaming Audio Processing & Utterance Finalization (/ws/voice)

  • Streaming 200ms Audio Fragments: Ingests live PCM audio streams (16kHz float32 arrays) over streaming WebSocket RPC channels (backend/routers/voice.py).
  • End-of-Speech Utterance Finalization: Accumulates audio fragments in a rolling buffer, automatically detecting sustained silence to finalize complete speech utterances (finalize_utterance) and dispatch text tokens to the LCE for reasoning.

Hybrid Cross-Device Voice Synthesis (synthesize_response)

  • Native Apple OS Speech (WATCH_ULTRA & IPHONE_17_PRO): Delivers lightweight text tokens (type: "text_for_native_tts") to edge devices, triggering native Apple OS AVSpeechSynthesizer (Siri Voice Engine) on the Apple Watch and paired iPhone for battery-efficient, natural voice playback.
  • Neural Kokoro MLX Engine (MACBOOK_WORKSTATION): On developer workstations, synthesizes neural 24kHz PCM audio buffers using kokoro_mlx (kokoro_bridge.py), rendering studio-quality custom voice profiles directly on Metal GPU.

Cross-Device Model Topology Map (TIER_MODEL_MAP)

  • MACBOOK_WORKSTATION (Workstation Core): Runs unquantized whisper-large-v3-turbo for high-precision transcription coupled directly to local 31B foundation models.
  • IPHONE_17_PRO (Mobile Hub): Runs 8-bit whisper-base-8bit alongside lightweight edge models (EDGE_2B_4BIT) for offline mobile speech recognition.
  • WATCH_ULTRA (Edge Sentinel): Uses native WatchOS audio capture (AVAudioEngine) and native speech synthesis (AVSpeechSynthesizer), delegating all cognitive reasoning and heavy transcription to the paired iPhone or host workstation over encrypted P2P WebSocket tunnels.

3. Executive Orchestration Engine for Tasks, Crons & DAGs

The Executive Orchestrator serves as Alluci’s high-level planning and task execution engine. It transforms complex, ambiguous user objectives into structured, non-blocking execution pipelines. By combining hierarchical task decomposition, recurring background cron scheduling, real-time context compression, and continuous statistical safety calibration, the Orchestrator manages multi-agent Constellations with sub-second execution efficiency.

Tasks & Goal Management

  • Autonomous Task Lifecycle: Manages long-running, multi-step goals from initial user prompt to final artifact generation. Tasks are tracked as stateful execution records with real-time status updates, error recovery, and pause/resume capabilities.

Cron Engine & Recurring Schedules

  • Autonomous Background Crons: Schedules and executes recurring background jobs (e.g. daily memory summarization, automated channel polling, market monitoring, or system health sweeps) without requiring active user presence.

Hierarchical DAG Planner

  • Directed Acyclic Graph Decomposition: Parses multi-agent goals into Directed Acyclic Graphs (DAGs). Sub-tasks are dispatched in parallel across specialized worker agents (e.g., Deep Research, Code Architect, Financial Analyst), dramatically accelerating execution speed for complex workflows.

Topological Heartbeat Daemon & Standing Surveillance

  • 6-Path Proactive Plane: Operates continuous background diagnostic sweeps (task_deadline, file_watch, goal_progress, url_fetch, system_health, bridge_silence, subagent_loop, topological_drift).
  • Discrete Barcode Clock Synchrony: Paced on every iteration by barcode_clock.tick() ($N \to N+1$).
  • 1D Reasoning Loop Detection: Continuously probes active Betti invariants; detects circular sub-agent execution loops when $\beta_1 > 0$ and triggers automated self-healing.
  • Quiet-Hours Counterfactual Dreaming: Runs offline perturbation simulations in JSpaceSimulator during low-load windows ($22:00–07:00$), persisting verified recovery triplets to DPOTripletHarvester.

Supervisor Agent Context Compression

  • Token Optimization & Bloat Prevention: The SupervisorAgent condenses verbose worker node outputs into dense "Sovereign Context Tokens" before passing state to downstream nodes in the DAG, preventing context-window bloat and maximizing token efficiency.

Dynamic Multi-Tier Model Routing

  • Policy-Driven Provider Selection: Routes individual Task, Cron, and DAG nodes dynamically based on privacy classifications (AIRGAPPED, SENSITIVE, PUBLIC), model strengths, and execution speed—dispatching private data locally to the LCE engine while routing high-density web synthesis to fast cloud APIs.

Multi-Agent Constellations & Sub-Agent Configurations

Alluci is built from the ground up as a Self-Sovereign Multi-Agent Operating System. Rather than executing all workloads within a single monolithic prompt loop, Alluci allows you to instantiate, configure, and orchestrate arrays of specialized agents (AgentRecord) operating as autonomous background daemons, channel handlers, or parallel DAG worker nodes.

1. Independent Agent Record & Engine Matrix (AgentRecord)

Each agent in the Constellation is backed by a stateful AgentRecord table in SQLite, defining its identity, underlying foundation model, and operational parameters:

  • Model Provisioning: Assign specific primary foundation models per agent—ranging from local MLX/LCE models (alluci-polytope4-31b) to cloud foundation models (OpenAI gpt-4o, Anthropic claude-3-5-sonnet, Google gemini-1.5-pro).
  • Resilient Fallback Chains (fallback_chain): Configures ordered model failover routes (e.g., gpt-4o -> claude-3-5-sonnet -> local_mlx), guaranteeing execution continuity if primary cloud endpoints experience outages or rate limits.
  • Engine Matrix Controls (engine_manifest): Fine-tunes cognitive execution parameters per agent, including Thinking Depth (thinking_level), Verbose Output Scales (verbose_level), and Multi-Step Reasoning Intensity (reasoning_level).

2. Sub-Agent Domain Specialization & Scoped Manifests

To prevent cross-domain context contamination, sub-agents are provisioned with granular access controls across seven dedicated configuration tabs (AgentDetailTabs.tsx):

  • Scoped Skill Profiles (skills_manifest): Grants or restricts domain-specific skill manifests (e.g. Legal Contract Audit, Compensation Strategy, Deep Research, SFT LoRA Forge).
  • Tool Access Grants (tools_manifest): Enforces fine-grained permissioning over available executable tools (Shell Executor, Memory Adapter, Web Browser, Vault Keys), ensuring sub-agents operate strictly within authorized boundaries.
  • Soul Profile Overrides (soul_profile_id / soul_manifest_override): Allows sub-agents to inherit or override the system's global Soul Manifest with specialized domain personas.
  • Automated Heartbeat Orders (HeartbeatOrderRecord): Schedules periodic diagnostic probes (fired_at, probe_type, action_type) to execute background health sweeps, channel monitoring, or memory maintenance automatically.

3. Hierarchical DAG Swarm & Supervisor Context Compression

  • Parallel Sub-Task Decomposition: The ExecutiveOrchestrator parses complex, ambiguous user goals into Directed Acyclic Graphs (DAGs). Sub-tasks are dispatched in parallel across specialized sub-agents running concurrently.
  • Supervisor Context Compression: To prevent context-window bloat during long-running multi-agent workflows, the SupervisorAgent condenses verbose worker node outputs into dense Sovereign Context Tokens before propagating state to downstream DAG nodes.
  • Multi-Channel Subscriptions: Sub-agents can be assigned to dedicated communication bridges (iMessage, Slack, Signal, Telegram, Discord, WebChat), acting as specialized channel handlers for inbound messages.

4. Zero-Trust Security & Sub-Agent Privacy Controls

  • Granular PII Masking Overrides (pii_override_enabled): Allows administrative override or enforcement of inline PII pseudonymization for specific sub-agents handling sensitive data streams through the AlluciSecureProxy.
  • Biometric & Executive Safety Interceptors: All sub-agent tool executions—regardless of autonomy level—remain strictly governed by the AVL Gate, DPK integer boundary checks, and the HITL Security Intervention Modal.

4. Simplicial H-LSM Memory

  • The Hierarchical Long-Short Manifold (H-LSM) is Alluci’s 4‑tier stateful memory architecture. Managed by HLSMManager (backend/memory/hlsm_manager.py) augmented by the Markov Trace & Spectral Geometry Engine (backend/memory/markov_trace.py).

  • H-LSM enables the agent to retain personal and organizational memory over time without context‑window bloat, context degradation, or hallucinations.

  • H-LSM operates across four cognitive memory storage tiers: • L0 Working Memory: Ultra‑fast, session‑level expiring context backed by Redis (Key‑Value) with automatic zero-config fallback to SQLite table hlsm_working. • L1 Episodic Memory: Full chat turns, interaction history, and episodic event logs backed by SQLite table hlsm_episodic with a high‑performance SQLite FTS5 full‑text search index (hlsm_episodic_fts). • L2 Semantic Memory: Long‑term vector embeddings for retrieval‑augmented generation (RAG), backed by Sentence‑Transformers (all‑MiniLM‑L6‑v2) and KùzuDB graph nodes (polytope_data.kuzu). • L3 Knowledge Graph: Permanent structured entity‑relationship graph nodes backed by the KùzuDB embedded graph database engine (polytope_data.kuzu).

  • Tri-Hybrid Reciprocal Rank Fusion (RRF $k=60$): • Parallel Asynchronous Retrieval: Dispatches queries concurrently across L1 SQLite FTS5 ($w=1.0$), L2 MiniLM Dense Vectors ($w=1.2$), and L3 KùzuDB Knowledge Graph Entities ($w=1.4$). • Authoritative Score Fusion: Harmonizes multi-modal score distributions using the standard RRF constant ($k=60$): $$\text{Score}{\text{RRF}}(d) = \sum{t \in {\text{L1}, \text{L2}, \text{L3}}} \frac{w_t}{60 + \text{rank}_t(d)}$$ • Knowledge Graph Entity Injection: Automatically extracts retrieved entity relations from KùzuDB and injects them directly into prompt grounding contexts under structured entity headers (── Knowledge Graph Entities ──).

  • Markov Trace Multi-Hop Rescoring & Scale-Dependent Spectral Geometry (markov_trace.py): • Schur Complement Trace Operator: Uncovers multi-hop hidden excursion pathways across visible and hidden memory nodes: $$\text{Tr}_A(P) = A + B(I - C + \epsilon I)^{-1} D$$ boosting visible candidate scores (80% direct semantic relevance + 20% topological excursion boost) and promoting high-coupling hidden bridge nodes. • Symmetrized Normalized Laplacian ($L_A$): Computes normalized Laplacian eigenvalues $\lambda_i \ge 0$, Fiedler algebraic connectivity ($\lambda_2$), and heat return probability $P_A(\sigma) = \frac{1}{|A|} \sum e^{-\sigma \lambda_i}$. • Dynamic Context Depth Scaling: Derives the scale-dependent spectral dimension $d_s^A(\sigma) = 2\sigma \frac{\sum \lambda_i e^{-\sigma \lambda_i}}{\sum e^{-\sigma \lambda_i}}$, dynamically expanding retrieval depth (max_per_tier) when mixing is sparse ($d_s^A > 1.5$).


5. Local Fine-Tuning (SFT) & The LoRA Forge

Alluci utilizes a specialized "Training Sandbox" mode that leverages the Unsloth library (optimized for 80% less VRAM usage) to perform Supervised Fine‑Tuning (SFT) directly on your hardware.

  • The Data Pipeline: Alluci’s H‑LSM Memory acts as the dataset generator. It continuously scrapes and cleans your local usage logs, business documents, and chat history into a secure "Sovereign Dataset."
  • Native DPO & LoRA Forge: You can trigger a "Skill Distillation" session where Alluci uses your specific data and a native PyTorch Direct Preference Optimization (DPO) kernel to forge custom LoRA (Low‑Rank Adaptation) adapters for Gemma 4.

6. The "Dream" Cycle & Autonomous Evolution

When the system detects low cognitive load (you are asleep or away), the daemon halts external polling and reallocates 100% of hardware resources to internal evolution:

  • 5-Stage Nightly Evolution Pipeline: 1) Extraction (Episodic memories, PCL world model snapshot, ACE baseline, quarantine pool), 2) Offline $\mathcal{J}$-Space Counterfactual Rollouts (j_space_simulator.py) simulating boundary recovery, 3) Teacher Synthesis (air-gapped local 31B Dense model instruction pair synthesis), 4) Cognitive Distillation (Socratic questioning of episodic logs into permanent Semantic Truths), and 5) Preference Harvesting.
  • Direct Preference Optimization (DPO) Harvesting (dpo_harvester.py, markov_trace.py): Automatically harvests teacher-student preference triplets $(x, y_w, y_l)$ from:
    1. H-LSM Self-Healing Deltas: Resolved failure-to-healing plan pairs (failed_plan $\to$ successful_plan).
    2. Quarantined AST Anti-Patterns: Quarantined execution traces (reverted_code $\to$ repaired_code).
    3. Offline $\mathcal{J}$-Space Dream Traces: Counterfactual perturbation simulations verifying state projection recovery onto the $O_6$ convex kernel.
  • Analytical Softplus DPO Loss: Evaluates model preference margin using analytical softplus loss: $$\mathcal{L}{\text{DPO}} = \ln\left(1 + \exp\left(-\beta \left[(\log \pi\theta(y_w \mid x) - \log \pi_{\text{ref}}(y_w \mid x)) - (\log \pi_\theta(y_l \mid x) - \log \pi_{\text{ref}}(y_l \mid x))\right]\right)\right)$$ persisting atomic JSONL preference datasets for local LoRA adapter fine-tuning without mutating immutable base model weights.

Soul Configuration & Persona Architecture

The Soul Manifest serves as Alluci’s core behavioral blueprint and active cognitive runtime engine. Moving beyond static system prompts and plain .md files, Alluci decouples persona configuration into a stateful, auditable Soul Manifest that actively drives model sampling parameters, dynamic neural-weight adapters, zero-trust security gates, and bio-affective attunement loops in real time.

1. Active Dynamic Runtime Execution

  • Zero-Restart Neural LoRA Injection (apply_lora_adapter): Rather than cluttering context windows with lengthy text instructions, Soul Profiles hot-swap compiled LoRA neural weights (agent_{id}_lora.safetensors) directly into VRAM on the fly without restarting the inference engine process.
  • Bio-Affective Parameter Attunement: Dynamically couples user biometrics (HRV, stress score $\psi$) from the ACE Engine, continuously modulating sampling temperature, memory retention thresholds, and intrusiveness limits in real time.
  • Topological Boundary Gating: Candidate actions generated under an active Soul Profile are continuously validated by the Discrete Projection Kernel (DPK) and AVL Gate to prevent structural hallucinations and out-of-bounds execution.
  • Dual Persistent Identity (VerusID VDXF & AES-256 Vault): Serializes manifests into decentralized VerusID VDXF keys (contentmultimap) for portable identity, with local AES-256-GCM envelope encryption for air-gapped sovereignty.

2. Behavioral Parameters & Reasoning Frameworks

  • Identity Core & Boot Directives: Defines the foundational identity handle (identityCore), voice profiles (voiceProfile), system directives, and boot sequence parameters (bootSequence).
  • Cognitive Control Sliders: Quantifies reasoning styles via dynamic scalar controls including Creativity, Verbosity, Humor, Conciseness, Tone, and Empathy (SoulPreferences).
  • Structured Thought Frameworks: Injects granular cognitive guidelines into execution loops, including specific Mindsets, Methodologies, Decision Frameworks, Logic Constraints, Chains-of-Thought, and Domain Best Practices.
  • Active Skill & Tool Bindings: Maps specific active skill IDs (active_skill_ids) and executable tool IDs (active_tool_ids) directly to the soul context, restricting or expanding agency based on active persona.

3. Reusable Soul Profiles & Real-Time Preview Engine

  • Profile Library (SoulProfileRecord): Supports creating, updating, listing, and switching between pre-configured Soul Profiles stored in the local SQLite database (/soul/profiles), allowing users to toggle between executive, technical, creative, or analytical personas on the fly.
  • Interactive Persona Preview (/soul/preview): Features a dedicated preview endpoint that executes candidate prompts through the current Soul Manifest before committing updates to active agent sessions, providing instant feedback on persona alignment and safety constraints.

Dynamic Skills, Tools & Builder Engines

Traditional AI agent frameworks define "Skills" and "Tools" as static markdown text files (SKILL.md) or simple string descriptions embedded in system prompts. This legacy approach suffers from severe limitations: high context window bloat, steep API token costs, floating-point non-determinism, soft pattern-matching hallucinations, and a complete lack of runtime execution validation.

The Alluci Sovereign Agent completely re-architects Skills and Tools from passive text documents into Active Cognitive Python Runtimes and Skill-Specific Deterministic Tool Engines. Managed by the SkillManager (backend/routers/skills.py) and ToolRegistry (backend/routers/tools.py), Skills and Tools operate as compiled, stateful runtimes driven by five deterministic cognitive parameters (Knowledge, Mindsets, Methodologies, Chains of Thought, and Logic), zero-trust security gates, and hardware biometric governance.

1. Skills & The Skill Builder Engine

When creating or instantiating a Skill, the Skill Builder Engine configures five deterministic parameters that govern the active Python Skill Runtime:

  • Knowledge Parameters: Binds the skill directly to the 4-Tier H-LSM Memory manifold—retrieving real-time entity-relationship subgraphs from KùzuDB (L3 Knowledge Graph), semantic embeddings (L2 Vector RAG), and indexed interaction history (L1 Episodic FTS5) without factual drift.
  • Mindset Parameters: Injects structured cognitive framing vectors (e.g., Zero-Trust Security, First-Principles Engineering, Sovereign Capital Optimization) that govern how sub-agents frame complex problems, weigh risks, and prioritize tradeoffs.
  • Methodology Parameters: Enforces rigid, multi-step operational algorithms (e.g., RACI/RAPID decision governance, 30-60-90 milestone roadmaps, total rewards auditing) that mandate the exact sequence of workflow execution.
  • Chain of Thought (CoT) Parameters: Specifies prescriptive reasoning trajectories where intermediate reasoning steps must satisfy topological continuity rules before downstream execution steps are granted.
  • Logic Parameters: Enforces bit-exact execution using fixed-point quantization (SEC-005 int16 clamping) and discrete integer simplicial boundary operators ($\partial_k: C_k \to C_{k-1}$), eliminating floating-point non-determinism across Host CPU, CUDA GPU, and Apple Metal GPU runtimes.

2. Python Skill Runtime & LoRA Neural Distillation

  • Direct Preference Optimization (DPO) Forge: As agents execute skills, high-quality interaction trajectories are harvested into DPO preference pairs. The local LoRAForge (backend/engine/lora_forge.py) crystallizes these trajectories into native PyTorch/MLX LoRA adapters (e.g., coding_lora.safetensors, legal_lora.safetensors).
  • Zero-Restart Neural Swapping: Activating a skill hot-swaps its fine-tuned LoRA weights directly into inference memory via apply_lora_adapter(), delivering domain expertise with zero prompt-window bloat.
  • Swarm Skill Synchronization (AntNetworkProtocol): Skill execution paths are mapped into Betti topological barcodes ($\beta_0, \beta_1, \beta_2$) and broadcast over the Verus P2P network, allowing multi-agent constellations to share skill intelligence zero-knowledge across devices.

3. Tools & The Tool Builder Engine

Tools in Alluci are Skill-Specific Deterministic Tool Engines backed by sandboxed Python runtimes, Model Context Protocol (MCP) servers, JSON-RPC daemons, and compiled C++ kernels:

  • The Tool Builder Engine & Sandboxed Runtimes: Enables users and autonomous agents to create, test, register, and update custom Python tool adapters dynamically (alluci_vault/tools/ and core_tools/) with explicit JSON Schema contracts, rate limits, and timeout boundaries.
  • Rocco 2.0 Multi-Query Deep Research Harvester (WebSearchAdapter): Decomposes complex research queries into parallel orthogonal search vectors executed concurrently with strict 4.0s timeouts, URL deduplication, and a dedicated 24-hour TTL SQLite cache (ResearchDossierCache in backend/data/research_cache.db), serving repeat lookups with 0ms latency and real markdown citations.
  • Multi-Runtime Adapter Support: Native execution support for sandboxed Python modules, MCP servers, REST/RPC endpoints, CLI scripts, and compiled C++ DPK security kernels.
  • Integrated Zero-Trust Interception: Tool executions from Python Skill Runtimes pass through the AVL Gate, DPK integer boundary checks, and biometric pulse liveness guards before payload commitment.

Hardware-Level Security Governance

Alluci implements a zero-trust, hardware-anchored security model that couples system execution directly to physical human presence and device liveness. Rather than relying solely on software passwords or API key tokens, Alluci enforces multi-modal biometric liveness, hardware kill switches, interactive executive governance, and isolated cryptographic vault containers to guarantee absolute data sovereignty and prevent unauthorized execution.

HITL Executive Security Governance & Intercept Guards

  • Three-Tier Hard Security Interceptors: Intercepts high-risk critical action tasks—such as destructive memory wipes, database schema alterations, file overwrites, financial transactions, or administrative configuration changes—before any backend execution occurs (backend/routers/gemini.py).
  • Interactive Security Intervention Modal: Any execution intent classified as a critical action task triggers an interactive user approval modal (SecurityInterventionModal.tsx), requiring explicit administrative authorization ([ Approve & Execute Action ]) before operations proceed.

Sovereign Biometric Kill Switch Daemon (BioTelemetryAuth / PPN-017)

  • Multi-Device Hardware Support: Monitors biological telemetry natively from Apple Watch as well as cross-platform wearable streams (Garmin, Whoop, Oura) via BioTelemetryAuth.
  • On-Wrist & Pulse Liveness Verification: Validates physical on-wrist presence (is_on_wrist=True) and active heart rate pulse before executing sensitive operations (banking, db_write, file_overwrite, os_exec, crypto_tx).
  • Configurable Policy Enforcement: When strict biometric enforcement is enabled (REQUIRE_WATCH_TELEMETRY=True), loss of wrist contact or missing pulse instantly activates the Sovereign Kill Switch—aborting execution, locking the agent, and encrypting active working memory.

Multi-Modal Anti-Spoofing & Deepfake Defense (PPN-018)

  • Acoustic Micro-Hesitation Analysis: Analyzes incoming voice streams for sub-audible jitter, acoustic tremor, and natural vocal breath pauses to detect synthetic AI voice clones.
  • Live Respiratory Cross-Verification: Cross-references vocal micro-hesitations against real-time Apple Watch respiratory telemetry to verify physical human liveness before executing privileged commands.

Simplicial Cryptographic Vault Isolation

  • Isolated Bridge Containers: Sandboxes every external communication channel and tool integration (Signal, iMessage, Slack, Google Drive, Email) within isolated cryptographic containers.
  • AES-256-GCM Envelope Encryption: Protects channel secrets, tokens, and bridge state using AES-256-GCM envelope encryption, preventing cross-bridge context leaks or unauthorized data access.

Verus Sovereign Identity & DREAM Architecture

Alluci is built natively around the Verus DREAM (Decentralized Real-time Encrypted Application Model) framework. By abandoning centralized cloud application servers, API keys, and third-party database proxies, Alluci pairs local-first machine intelligence with VerusID self-sovereign identities, structured VDXF data namespaces, local blockchain nodes, and encrypted peer-to-peer (P2P) state synchronization.

1. Alignment with the Verus DREAM Application Model

  • Decentralized Real-Time Encrypted Runtime: Implements the DREAM paradigm by anchoring agent state, user authorization, and executive manifests directly to self-sovereign identity handles (identity@).
  • Zero-Trust Peer-to-Peer Protocol: Replaces central server infrastructure with encrypted P2P messaging and VDXF data structures. Agent instances communicate peer-to-peer using Ed25519 cryptographic signatures without exposing raw data to central relays.

2. Local Verus Blockchain Node & PBaaS Architecture (verus_rpc.py)

  • Native Local Node Execution: Interacts directly with a local Verus blockchain node via high-performance JSON-RPC (verus_get_info, verus_get_identity).
  • Self-Sovereign Fund & Asset Control: Manages local wallet funds, executes cross-chain transfers (verus_send_currency), and creates decentralized marketplace orders (verus_make_offer) natively on-device.
  • Public Blockchains as a Service (PBaaS): Leverages Verus PBaaS multichain infrastructure for cross-chain identity verification and sovereign token settlement across interconnected blockchain networks.

3. Verus Data eXchange Format (VDXF) Data Layer (vdxf_store.py)

  • Structured Sovereign Data Namespaces: Utilizes standardized, typed VDXF keys (verus_get_vdxf_id) to structure application data, skill manifests, and agent configurations without vendor lock-in.
  • Identity-Bound Content Mapping (contentmultimap): Stores and retrieves encrypted agent manifests and peer messages directly on the VerusID content multimap (VDXFStore), creating a portable, decentralized state storage layer.

4. On-Chain Audit Ledger Anchoring (audit_ledger.py / verus_txid)

  • Cryptographic State Invariance Proxies: Periodically computes SHA-256 state hashes ($\text{Hash}_{\text{integrity}}$) across the AuditLedger and H-LSM memory manifolds.
  • Immutable On-Chain Proofs (verus_txid): Anchors state integrity hashes and executive action summaries directly to the Verus blockchain (verus_txid and vdxf_key), generating an un-alterable, mathematically verifiable audit log of agent history.

5. Federated Swarm Intelligence & Digital Pheromones (AntNetworkProtocol)

  • P2P Swarm Problem Solving: Uses the AntNetworkProtocol (Alluci_Ant_v1) over Verus VDXF messaging channels to coordinate multi-agent constellations across distributed devices.
  • Zero-Knowledge Digital Pheromones: Broadcasts abstract, invariant "Topological Barcodes" (Betti signature pheromones) over the Verus P2P network. Agents harvest collective problem-solving paths to achieve swarm intelligence without ever transmitting raw prompts, private text, or personal credentials.

🌍 Data Residency & EU Compliance

For enterprise environments requiring strict GDPR or Schrems II compliance, the Sovereign Agent utilizes a "Defense in Depth" proxy strategy:

  • AlluciSecureProxy: The proxy automatically intercepts outbound LLM requests, extracts PII into a local ephemeral vault, and sends only mathematically abstract payloads (pseudonymization) to cloud providers (OpenAI/Gemini).
  • Hard-Locked Egress: Setting DATA_REGION="EU" in the environment mathematically prevents any cloud egress without passing through the pseudonymization proxy.
  • Physical Endpoint Overrides: Setting ENFORCE_EU_ENDPOINTS=True forces Azure OpenAI and Google Vertex API clients to dynamically route to EU-based datacenters on the fly.

[!NOTE] See the full Data Residency & Compliance Architecture for legal and technical implementation details.


📊 Token Usage, Spending Monitoring & Budget Controls

Alluci includes an integrated Usage & Cost Analytics Engine (UsageTracker in backend/analytics.py and backend/routers/usage.py) that delivers real-time token tracking, financial telemetry, multi-provider model cost rollups, and spending optimization across all cloud and local execution paths.

1. Real-Time Token & Financial Cost Telemetry (/usage)

  • Granular Token Tracking: Automatically tracks Input Tokens, Output Tokens, KV Cache Read Tokens, KV Cache Write Tokens, and calculated financial costs in USD for every interaction.
  • Time-Series Analytics Endpoints: Exposes dedicated REST endpoints for aggregate cost summaries (/usage/summary), daily usage rollups (/usage/daily), and turn-by-turn cumulative session curves (/usage/sessions/{session_key}/timeseries).
  • Session-Aggregated Breakdown (/usage/sessions): Provides session-level audit metrics detailing agent identities, provider distributions, model selection, total turn counts, and timestamp logs.

2. Multi-Provider & Heterogeneous Model Cost Allocation

  • Unified Multi-Cloud Costing: Accurately calculates costs across heterogeneous cloud APIs (OpenAI, Anthropic, Google Cloud, Groq, DeepSeek, OpenRouter, AWS Bedrock) as well as zero-cost local MLX/LCE models ($0.00/token).
  • Cache Efficiency Telemetry: Monitors cache hit ratios and KV cache reuse savings, optimizing prompt caching efficiency across OpenAI, Anthropic, and Google Cloud context windows.

3. Policy-Driven Spending Controls & Token Budgeting

  • Intelligent Token Router: Dynamically routes tasks based on cost thresholds, model performance profiles, and user-defined privacy tiers (AIRGAPPED, SENSITIVE, PUBLIC).
  • Air-Gapped Zero-Cost Fallback: Automatically diverts high-volume background tasks, memory summarization crons, and sensitive document indexing to local on-device MLX/LCE models, capping cloud API expenditure.

4. Auditable Enterprise CSV Exports (/usage/sessions/export/csv)

  • Downloadable CSV Reports: Generates downloadable CSV exports containing turn-by-turn usage records, agent tags, provider breakdowns, cache metrics, and total expenditure for accounting, cost allocation, and financial compliance auditing.

🚀 Comprehensive Onboarding Guide

The Sovereignty Level Wizard makes onboarding seamless. Choose between Cloud-only (Level 1), Local Edge (Level 2), or the Full Sovereign Base (Level 3).

📋 System Prerequisites & Dependency Matrix

Before installing Alluci, verify that your host environment meets the following requirements:

1. Core Runtimes & Build Toolchains

  • Frontend Runtime: Node.js (v20+) & npm (v10+)
  • Backend Runtime: Python (v3.12+) & pip
  • Native Build Tools: C++ Compiler (clang++ on macOS, g++ on Linux, MSVC on Windows), make, git, and lsof (Required to compile native DPK security kernels)

2. Inference & Acceleration Engines

  • Apple Silicon (macOS): Native Apple MLX frameworks (mlx, mlx-lm, mlx-vlm, mlx-whisper) leveraging Unified Memory
  • PC & Linux (NVIDIA CUDA / CPU): PyTorch (torch>=2.4.0), sentence-transformers, or llama.cpp GGUF bindings via local_bridge.py
  • Model Provisioning: huggingface_hub CLI for downloading model weights from HuggingFace (Alluci Models)

3. Data & Storage Engines

  • Relational & Search: SQLite3 with FTS5 enabled (Built into Python standard library)
  • Embedded Graph DB: KùzuDB (kuzu embedded C++ engine) powering H-LSM Knowledge Graph
  • In-Memory Cache: Redis (v7.0+, optional for high-speed L0 Working Memory; automatically falls back to SQLite in zero-config LITE_MODE)

4. Optional Sovereign Services

  • Verus Identity & Blockchain Node: Local verusd node RPC daemon for VerusID decentralized identity, VDXF content maps, and on-chain audit ledger anchoring
  • Biometric Telemetry Webhooks: Apple Watch bridge (bridges/iwatch.py) or wearable webhooks (Garmin, Whoop, Oura) for bio-affective stress attunement and the Sovereign Kill Switch

1. Air-Gap Boundary & Automated Model Provisioning

Alluci features an automated, hardware-aware model downloader (scripts/download_models.py).

  1. Hardware-Aware Model Provisioning (Online Setup): Running ./scripts/setup_sovereign_stack.sh triggers HardwareProfiler.get_system_profile(). The profiler scans host System RAM, VRAM, and GPU architecture, automatically downloading the optimal model weights directly from HuggingFace (Alluci Models) into your local mirror_cache/:

    • Automatically pulls your assigned primary tier model (TIER_0_ULTRA through TIER_4_EDGE).
    • Automatically pulls the lightweight speculator model (EDGE_2B_4BIT) for draft-verification token acceleration.
    • Automatically pulls the offline PPN embedding model (all-MiniLM-L6-v2) for local RAG vector search.
  2. Air-Gap Activation (100% Offline Sovereignty): Once the setup script outputs [ INFO ]: Setup Complete, all model weights, tokenizer manifests, and embedding models are cached locally. You can physically disconnect network cables or disable Wi-Fi, and the Sovereign Agent will execute indefinitely offline with zero external network dependencies.


2. Local Stack Execution & Automation

Automated Stack Initialization

chmod +x scripts/setup_sovereign_stack.sh
./scripts/setup_sovereign_stack.sh

Managing the Stack via Makefile The easiest way to run the entire stack locally is using our pre-configured Makefile:

make init     # Initialize .env, virtualenv, and install dependencies via bootstrap_all.sh
make start    # Cleanly start Backend (Port 8000) and Frontend (Port 3000)
make status   # Verify port 8000/3000 status and active services
make doctor   # Run diagnostic check on toolchain and local environment (scripts/verify_local.py)
make stop     # Gracefully terminate active background processes

Manual Startup Alternative:

  • Backend (Port 8000): source .venv/bin/activate && uvicorn backend.app:app --port 8000 --host 0.0.0.0
  • Frontend (Port 3000): npm run dev -- --port 3000 --host 0.0.0.0

Open http://localhost:3000 to launch the Alluci Sovereign Gateway. Upon first launch, the Sovereignty Wizard will guide your configuration.


3. Configuring Vault Secrets & Sovereign Credentials

The Sovereign Agent uses a strictly local .env file to seed its Verus Vault and configuration parameters:

cp .env.example .env

Configure core environment keys in .env:

  • POLYTOPE_MASTER_KEY: Master seed for AES-256 vault encryption and 2FA secrets.
  • JWT_SECRET_KEY: Used for secure session token signing.
  • VERUS_ID_IDENTITY: Sovereign VerusID identity handle (YourIdentity@).
  • VERUS_ID_PRIVATE_KEY: Ed25519 private key seed for executive manifest signing.
  • REQUIRE_WATCH_TELEMETRY: Set to True to enforce biometric kill switch liveness checks.
  • DATA_REGION: Set to EU to enforce the SecureProxy PII firewall.
  • ENFORCE_EU_ENDPOINTS: Set to True for strict physical EU cloud datacenter routing.

4. Sovereign Reliability Engineering (SRE) & Quality Gate

Alluci incorporates a rigorous quality gate to guarantee local system stability, zero-trust security, and immutable supply-chain integrity:

make quality

The Quality Gate Executes:

  • Preflight Checks: Validates toolchain dependencies, virtualenv setup, and environment integrity (scripts/production_readiness/preflight.sh).
  • Test Suite Execution: Runs full backend pytest suites (pytest backend/tests/ -v) and performance benchmarks (pytest backend/tests/performance/test_benchmarks.py).
  • Security & Dependency Audits: Performs npm audit, pip-audit, and static secret detection scanning.
  • Automated Release Reporting: Generates timestamped diagnostic reports in reports/ (generate_release_report.py).

To run tests manually:

source .venv/bin/activate
pytest backend/tests/ -v

🔧 Debug & Diagnostic Mode

The DEBUG environment variable controls system diagnostic verbosity:

  • Production (DEBUG=False): Mutes internal exception tracebacks, masks FastAPI error details, and sanitizes JSON-RPC response payloads.
  • Development (DEBUG=True): Enables full exception tracebacks, detailed validation data, and verbose topological log output.

Set DEBUG=True in your .env or export the variable locally to enable detailed diagnostics during development.


📜 License

Copyright © 2026 Alluci-Ai. All Rights Reserved.

This software and associated documentation files (the "Software") are the proprietary property of Alluci-Ai. Unauthorized copying, reproduction, distribution, modification, or use of this Software, via any medium, is strictly prohibited without the express written permission of Alluci-Ai.

For information on our strictly-gated proprietary contribution process, please review our Contribution Guidelines.


"Alluci-Polytope: Turning AI from a passive tool into a sovereign, affective partner."

Alluci-Ai/alluci-sovereign-agent

Python

0

516 commits

updated Sep 9, 2026

See the code

README

Alluci-Sovereign-Agent

Under Development — Coming Soon

The Self-Sovereign Personal/Professional AI Assistant

VerusID Harmonic Logic Security Sovereign Gateway ACE Engine Orchestration Synthesis


Executive Intelligence

The Alluci Sovereign Agent is a self-sovereign, multi-agent computational runtime that serves as your primary personal and professional interface acting as your high-level digital assistant, orchestrating complex workflows, multi-step research, and multi-channel communications.

Alluci unifies local on-device intelligence with policy-driven cloud model federation—allowing you to harness frontier AI capabilities while your data, memories, workflows, and intellectual property remain cryptographically secured and physically under your control within a single Self-Sovereign Agentic Operating System.


The Sovereign Manifold

The Sovereign Manifold acts as your central neural dispatch for all digital communications, workflows, and biometric state tracking. Rather than forcing you to jump between fragmented apps and isolated browser tabs, Alluci unifies your entire digital life under a single sovereign interface.

Every channel integration operates inside an isolated cryptographic Simplicial Vault bound to your VerusID, ensuring seamless multi-channel agency without cross-channel data leaks or unauthorized exposure across four core operational manifolds:

1. Apple Ecosystem

  • Apple iMessage & SMS: Native macOS E2EE iMessage dispatching and SMS bridge.
  • Apple Watch Biometrics & Sensors: Real-time Heart Rate, HRV, Respiratory Rate, and physical stress score streaming into the ACE engine.
  • iOS iPhone Gateway: iOS Push Notifications and Shortcuts local relay.
  • Apple iCloud Storage: E2EE iCloud Drive, Photos, and Reminders integration.

2. Social Manifold

  • Signal: Encrypted messaging via local E2EE daemon.
  • WhatsApp: WhatsApp Web & WhatsApp Cloud API integration.
  • Telegram: Telegram Bot API & Telethon user client gateway.
  • WeChat & WeCom: WeChat Personal & WeCom Enterprise Work Messenger.
  • Nostr: Decentralized Nostr relay protocol & NIP-04/NIP-44 encrypted direct messages.
  • Discord: Discord Bot API & Webhook gateway. X / Twitter: X API v2 Direct Messages, Mentions, and Post dispatching.
  • Instagram: Instagram Direct Messaging & Business Graph API.
  • Facebook Messenger: Meta Facebook Page & Messenger Graph API.
  • BlueSky: AT Protocol XRPC API feed posting, notification polling, and direct messaging.

3. Enterprise Core & Developer Workspace

  • Slack: Enterprise Slack Socket Mode workspace bridge.
  • Microsoft Teams: Microsoft Graph & Teams enterprise channel bridge.
  • Google Workspace: Gmail OAuth2/PubSub & Google Chat API.
  • Google Drive & Docs: Google Drive files, Docs, and Sheets synchronization.
  • Universal Email: Standard IMAP / SMTP email channel integration.
  • Notion Workspace: Notion databases, pages, and workplace memory sync.
  • GitHub Workspace: GitHub repos, issues, pull requests, and webhooks.
  • WebChat Gateway: Streaming WebSocket administrative chat gateway.

4. Verus Sovereign Identity & Blockchain

  • VerusID Sovereign Identity: Decentralized cryptographic identity, claim signing, and vault access control.
  • Verus Blockchain Node & Fund Management: Local Verus node RPC, sovereign wallet fund management, and cryptographic transaction signing.
  • Federated Pheromone Network (PPN): Swarm intelligence problem-solving paths broadcasting topological barcodes over the Verus P2P network.

Multi-Modal Synthesis & API Orchestration

The Multi-Modal Synthesis & API Orchestration engine serves as Alluci’s unified control plane for generative tools, token routers, and cognitive services. Rather than locking you into a single closed ecosystem, Alluci provides policy-driven model federation—dynamically routing tasks across specialized foundation models, voice synthesis engines, and generative media tools while respecting your local privacy constraints and token budge.

1. LLM & Reasoning

  • OpenAI: Advanced general reasoning, multi-modal synthesis, and strategic agentic planning.
  • Anthropic: Deep architectural code generation, complex context analysis, and safety-aligned logical reasoning.
  • Google Cloud: Massive multi-modal context windows, rapid token processing, and broad knowledge synthesis.
  • Groq: Ultra-high-speed LPU inference for real-time tactical execution and sub-second token delivery.
  • xAI (Grok): High-throughput real-time knowledge synthesis and conversational reasoning.
  • DeepSeek: High-efficiency open-architecture reasoning and mathematical problem-solving.
  • Unsloth: On-device memory-optimized model fine-tuning and low-VRAM model distillation.
  • Token Router: Dynamic token budget optimization, multi-provider latency balancing, and intelligent context distribution.
  • OpenRouter: Dynamic multi-provider API aggregation and intelligent failover routing.
  • LM Studio: Local open-weight model hosting and airgapped desktop inference.
  • Together AI: Scalable open-source model infrastructure and custom fine-tune deployment.
  • Cohere: Enterprise RAG, semantic retrieval, and structured business document intelligence.
  • AWS Bedrock: Enterprise security compliance, managed cloud foundation models, and scalable infrastructure.

2. Conversational Audio & Voice

  • ElevenLabs: High-fidelity voice synthesis and custom voice cloning.
  • ElevenLabs Agents: Autonomous conversational voice agent API.
  • Retell AI: Professional automated telephony and voice dialogue.
  • OpenAI Realtime API: Bidirectional low-latency streaming vocal interaction.
  • Inworld AI: Dynamic character and interactive persona voice engine.

3. Image Generation

  • Midjourney: Cinematic & artistic image generation.
  • Fal AI: Ultra-fast FLUX.1 & SDXL image synthesis.
  • Seedance: Generative image synthesis.
  • Google NanoBanana: High-speed web-scale image creation.
  • OpenAI DALL·E 3: High-precision prompt-driven image generation.
  • Adobe Firefly: Commercial-grade generative image and vector design.

4. Video Generation

  • RunwayML: Runway Gen-2 & Gen-3 Alpha video generation.
  • Luma Dream Machine: High-resolution realistic motion video.
  • Google Veo: Generative temporal video model.
  • Google Genie: Interactive generative world and video environment engine.
  • HeyGen: AI avatar and video spokesperson generation.
  • Seedance Video: Generative video synthesis.
  • Livepeer: Decentralized live video streaming and transcoding network.

5. Music Generation

  • ElevenLabs Music: Instrumental and sonic music generation.
  • Suno: Full-track vocal and musical composition.
  • Soundverse: AI-driven audio and sonic structure creation.
  • Google Lyria: Generative music composition engine.
  • Stable Audio: High-resolution acoustic and electronic music generation.
  • Udio: Full-track vocal, pop, and orchestral composition.

The Polytope Manifold Architecture

The Polytope Manifold Architecture serves as the core cognitive blueprint governing how Alluci processes intelligence, preserves stateful memory, and executes multi-agent workflows.

Alluci is powered by a hybrid computational runtime—combining native Python execution engines with high-performance compiled C++ extensions and specialized topological kernels. This architecture pairs proactive cognition and a native Apple MLX engine driving on-device foundation model evaluation on Unified Memory with Non-Euclidean geometric manifold mapping and Betti signature context indexing across a stateful 4-Tier Memory System.

System execution is governed by a three-pillar action safety loop enforcing Lipschitz gradient smoothness and payload verification, integer simplicial boundary operators for Betti topology discrete manifold verification, high-frequency signal processing and harmonic lattice calculations, and cryptographic Simplicial Vault isolation encrypting credentials and bridge secrets via AES-256-GCM.


Polytope Projection Network (PPN)

The Polytope Projection Network (PPN) serves as Alluci’s non-Euclidean geometric intelligence engine. Moving beyond traditional, hallucination-prone vector similarity lookups, PPN projects unstructured multi-modal data streams—text, biometrics, tool actions, and execution traces—into topologically stable geometric manifolds. Governed by algebraic topology and simplicial homology, PPN evaluates state continuity using Betti signatures ($\beta_0, \beta_1, \beta_2$), ensuring that cognitive operations maintain structural integrity across execution cycles.

Topological Manifold Projection & Simplicial Homology

  • Non-Euclidean Representation: Transforms high-dimensional embeddings into low-dimensional geometric manifolds ($d=32$) using fixed deterministic projection matrices, constructing Rips complexes to compute real graph-theoretic simplicial homology.
  • Betti Signature Extraction: Computes invariant Betti topological invariants ($\beta_0$ connected components, $\beta_1$ 1-skeleton cycles, $\beta_2$ 3-clique voids) to quantify topological coherence without relying on fragile keyword matching.

Fixed-Point Quantization & Deterministic Safety (SEC-005)

  • Deterministic Fixed-Point Normalization: Quantizes tensor projections to fixed-point precision ($1/\text{scale}$ steps clamped to int16 boundaries), eliminating floating-point non-determinism across host CPU and Metal GPU runtimes.
  • Side-Channel Mitigation: Prevents timing attacks and numerical drift, ensuring identical manifold states across independent execution nodes and background iterations.

Multimodal Polytope Fusion & Bio-Affective Attunement (ACE)

  • Direct Physiological Coupling: Dynamically couples real-time Apple Watch biometrics (HRV, respiratory rate, stress scores) and affective tension ($\psi$) directly into manifold geometry.
  • Topological Coherence Scoring: Adjusts manifold elasticity and coherence scores ($C \in [0.1, 0.95]$) based on user valence and arousal, modulating agent autonomy without requiring string-to-vector language conversion.

Real-Time Manifold Stability & Tearing Detection

  • Pre-Execution Manifold Checks (_perform_ppn_check): Evaluates candidate task objectives and tool actions for topological tearing ($\Delta \beta$ norm spikes, entropy threshold breaches) before committing steps to execution pipelines.
  • Self-Healing State Recovery: Triggers immediate execution halts or corrective prompt injections when manifold tearing is detected, preventing cascade failures and hallucinated state drift.

Federated Digital Pheromones & Swarm Synchronization

  • Structural Barcode Extraction: Distills complex problem-solving paths into compact, invariant topological barcodes.

  • Zero-Knowledge Swarm Broadcast: Broadcasts structural barcodes over the Verus P2P network, enabling federated multi-agent swarm intelligence without exposing raw prompt context or private user data.


Discrete Projection Kernel (DPK)

The Discrete Projection Kernel (DPK) serves as the high-speed, zero-trust cryptographic gatekeeper of the Alluci execution runtime. Grounded in Kepler's Stella Octangula $S_8$ geometry (compound of dual regular tetrahedra $T_+ \cup T_-$ with 8 vertices, 12 edges, 8 faces, and central octahedron $O_6$), DPK validates state transition vectors ($\mathbf{x}_{t-1} \to \mathbf{x}_t$), enforcing topological boundary nilpotence, Euler characteristic invariants ($\chi = V - E + F$), and idempotent fusion projections before any tool or agent action executes.

Kepler's Stella Octangula $S_8$ & Simplicial Boundary Nilpotence

  • Simplicial Boundary Matrices ($B_1, B_2$): Maps chains $C_2 \xrightarrow{\partial_2} C_1 \xrightarrow{\partial_1} C_0$ using integer boundary matrices $B_1 \in \mathbb{R}^{8 \times 12}$ and $B_2 \in \mathbb{R}^{12 \times 8}$, verifying the Fundamental Theorem of Algebraic Topology: $$\partial_1 \circ \partial_2 = 0 \quad (\text{Exact Boundary Composition Nilpotence: } B_1 B_2 = 0)$$
  • Idempotent Fusion Simplex Operator ($F_n^1$): Projects continuous state vectors onto the convex hull of $S_8$, enforcing exact idempotence $\Pi(\Pi(x)) = \Pi(x)$ for all $x \in \mathbb{R}^3$.
  • Entropic Arrow of Time Monotonicity: Verifies that conditional Shannon entropy across execution states is non-decreasing: $H(X_n \mid X_1) \ge H(X_{n-1} \mid X_1) - \epsilon$.

Integer Boundary Operators & $\mathcal{O}(1)$ Discrete Verification

  • Exact Simplicial Arithmetic: Evaluates topological state transitions using integer simplicial boundary operators ($\partial_k$), computing Euler invariants ($\chi$) in $\mathcal{O}(1)$ time complexity without floating-point rounding errors.
  • Native C++ Performance Acceleration: Dispatches validation queries through a compiled native C++ shared library (dpk_kernel.cpp / ctypes), falling back to a pure Python implementation when hardware constraints dictate.

Dynamic Manifold Tearing & Topology Shift Detection

  • State Shift Calculation ($\Delta \text{Topology}$): Monitors directional topological shift between consecutive execution steps ($\mathbf{s}_{t-1}$ and $\mathbf{s}_t$).
  • Tearing Threshold Enforcement: If topological shift breaches the calibrated dynamic threshold ($\Delta \text{Shift} > \theta_{\text{dynamic}}$), DPK raises a TearingException, instantly halting execution to prevent state corruption or hallucinated loop cascades.

Cryptographic Attribution Hashing (AAP-003)

  • Sovereign Hash Chain: Computes deterministic 64-bit signature hashes ($\text{Hash}_{64}$) derived from SHA-256 for every PolytopeState.
  • VerusID Cryptographic Anchoring: Anchors state transitions and action payloads to the host's VerusID sovereign cryptographic identity, establishing an un-forgeable audit trail for execution history.

Continuous Statistical Safety Calibration & Human-in-the-Loop Override

  • Dynamic Risk Calibration: Integrates with the CalibrationManager to dynamically calibrate safety rejection thresholds based on execution history, affective tension ($\psi$), and active workspace permissions.
  • HITL Executive Security Governance: Supports explicit Human-in-the-Loop (HITL) administrative overrides (is_override=True), allowing authorized users to bypass false-positive manifold halts while preserving audit logs.

Sovereign Topological State Spaces $(W, X, G, N)$ & $\mathcal{J}$-Space World Model

The Sovereign Topological State Space Subsystem (backend/topology/) formalizes Alluci's cognitive reasoning into a mathematically bounded 5-tuple $(W, X, \mathcal{J}, G, N)$ governed by rigorous algebraic topology operators:

          ┌────────────────────────────────────────────────────────┐
          │               W (World Data Space)                    │
          └──────────────────────────┬─────────────────────────────┘
                                     │  P: W × X → [0,1]
                                     ▼  (Vietoris-Rips Filtration)
          ┌────────────────────────────────────────────────────────┐
          │         X (Experience Simplicial Space)                │
          │         [Betti Invariants: β₀, β₁, β₂, β₃]             │
          └──────────────────────────┬─────────────────────────────┘
                                     │  S: X × G × J → J
                                     ▼  (Simplicial CoT & Socratic Synthesis)
          ┌────────────────────────────────────────────────────────┐
          │     J (J-Space Counterfactual Simulation Sandbox)      │
          │     Kepler S₈ Synthesis: T₊ ∪ T₋ → O₆ Kernel          │
          └──────────────────────────┬─────────────────────────────┘
                                     │  D: J × G → [0,1]
                                     ▼  (Convex Hull Affordance)
          ┌────────────────────────────────────────────────────────┐
          │         G (Action Affordance Envelope Space)           │
          │         [3D Risk Simplex & Sub-Agent Bounds]           │
          └──────────────────────────┬─────────────────────────────┘
                                     │  A: G × W → [0,1]
                                     ▼  (Markov Trace & DPO Harvesting)
          ┌────────────────────────────────────────────────────────┐
          │     N (Discrete Topological Barcode Clock Count)       │
          │     [Monotonic Pacing: N → N+1, Birth/Death Tracking]  │
          └────────────────────────────────────────────────────────┘

1. Foundational State Spaces $(W, X, \mathcal{J}, G, N)$

  • $W$ (World Data Space): Continuous, unbounded environmental data streams, real-time biometrics, user messages, file system inputs, and raw knowledge graphs.
  • $X$ (Experience Simplicial Complex Space): Invariant simplicial complexes and Betti topological numbers ($\beta_0, \beta_1, \beta_2, \beta_3$) generated from $W$ via Vietoris-Rips simplicial filtration at scale radius $\epsilon$.
  • $\mathcal{J}$ ($\mathcal{J}$-Space Counterfactual Simulation Sandbox): Air-gapped mental sandbox executing multi-step predictive rollouts, Simplicial Chain-of-Thought (S-CoT) boundary verification, and Socratic dialectic synthesis before committing actions to external environments.
  • $G$ (Action Affordance Envelope Space): Convex hull boundary defining permissible action vectors, tool invocations, and sub-agent capability bounds on a 3D spatial risk coordinate simplex.
  • $N$ (Discrete Barcode Clock Count): Monotonic discrete clock count tracking topological feature births ($b$), deaths ($d$), lifetime persistence, and active Betti numbers across all cognitive cycles.

2. The Four Foundational Algebraic Operators $(P, S, D, A)$

  • Perceive ($P: W \times X \to [0, 1]$ / PMETFiltrationEngine): Samples multi-dimensional point clouds from $W$, constructs Vietoris-Rips complexes up to 2-skeleton (triangular faces), and extracts exact Betti invariants ($\beta_0$ connected components, $\beta_1$ 1-skeleton cycles, $\beta_2$ 2-voids).
  • Simulate ($S: X \times G \times \mathcal{J} \to \mathcal{J}$ / JSpaceSimulator): Evaluates multi-step counterfactual simulation traces, validating deductive reasoning steps as 2-simplices to ensure algebraic boundary nilpotence ($\partial_1 \circ \partial_2 = 0$). Reconciles constructive hypotheses ($T_+$) and critical skeptic critiques ($T_-$) into the central intersection kernel ($O_6$).
  • Decide ($D: \mathcal{J} \times G \to [0, 1]$ / ActionAffordanceEnvelope): Validates candidate execution vectors against sub-agent domain boundaries (Codi, Rocco, Admin) and bio-affective stress thresholds ($\psi \le 0.85$), ensuring destructive tasks are strictly intercepted by HITL governance.
  • Act ($A: G \times W \to [0, 1]$ / MarkovTraceEngine & DPOTripletHarvester): Executes verified actions, evaluates multi-step trajectories using the Schur complement Markov Trace operator ($\text{Tr}_A(P) = A + B(I-C)^{-1}D$), monitors Frenet-Serret curvature ($\kappa \le 5.0$), and records verified $(x, y_w, y_l)$ preference triplets for offline distillation.

3. Simplicial Chain-of-Thought (S-CoT) & Boundary Nilpotence

  • Triadic Deductive Simplices: Represents reasoning triads (Premise A, Premise B $\implies$ Conclusion C) as oriented 2-simplices $\sigma = [V_0, V_1, V_2]$.
  • Algebraic Nilpotence Verification: Enforces exact boundary composition nilpotence ($\partial_1 \circ \partial_2 = 0$) on code/tool execution DAGs, eliminating circular dependencies, self-referential tautologies, and hallucinated reasoning loops.
  • Elastic Conversational Relaxation: Applies adaptive topological relaxation during open-ended creative dialogue to permit high-temperature associative leaps without triggering premature safe-halts.

4. Thread-Safe Topological Barcode Clock (TopologicalBarcodeClock)

  • Discrete Pacing Primitive: Provides a synchronized discrete clock count ($N \to N+1$) that paces H-LSM memory decay, PCL world model snapshots, and Heartbeat diagnostic orders.
  • Persistence Interval Tracking: Computes feature lifespans $\Delta N = d - b$ for memories, goals, and sub-agent trajectories.
  • Active 1D Topological Hole Detection: Evaluates active Betti numbers ($\beta_1$ count); if $\beta_1 > 0$ during sub-agent execution, detects circular reasoning loops and triggers corrective self-healing.

Action Verification Loop (AVL Gate)

The Action Verification Loop (AVL Gate) serves as Alluci’s zero-trust safety and payload verification engine. Functioning as an inline firewall between LLM generation outputs and tool execution adapters, the AVL Gate enforces a mathematical three-pillar security protocol. It prevents unauthorized code execution, prompt injections, and structural hallucinations by verifying cryptographic attribution, gradient smoothness limits, and topological continuity before any action payload is committed.

Three-Pillar Structural Safety Protocol

  • Pillar 1: Sovereign Attribution Verification: Checks signature hashes ($\text{Hash}_{64} \neq 0$), hard-rejecting any unsigned or external manifold completions that lack cryptographic proof of origin.
  • Pillar 2: ALCE Gradient Smoothness Verification: Enforces Lipschitz continuity budget limits ($\text{Budget}{\text{used}} \leq \text{Budget}{\text{dynamic}}$). Rejects actions that breach Relational Boundary Manifolds ($\text{RBM}$) to eliminate gradient explosion and execution runaways.
  • Pillar 3: Topological Continuity Verification: Validates Euler characteristic consistency ($|\chi - \beta_{\chi}| \leq \text{Euler}_{\text{tolerance}}$, where $\chi = V - E + F$), detecting structural ruptures and hallucinated sequence jumps.

GJK Convex Boundary Projection & Structured Tool Clamping

  • Gilbert-Johnson-Keerthi (GJK) Distance Algorithm: Evaluates out-of-bounds action vectors against admissible manifold boundaries using support point functions $S_{S8}(d)$.
  • Deterministic Action Refinement (project_to_boundary): Projects near-boundary prompt violations back into admissible Lipschitz bounds, neutralizing prompt injection attacks without disrupting execution flow.
  • Structured Tool Payload Clamping (verify_action_payload): Dynamically scales and clamps numeric tool parameters (top_k, limit, timeout, depth, steps, count, max_tokens) proportionally to available Lipschitz budget capacity.

Self-Healing Executive Loop & Protocol 3 Lipschitz Saturation

  • Corrective Prompt Injection: When an action payload fails verification, the ExecutiveOrchestrator self-healing loop injects a high-priority <SECURITY_RUPTURE> prompt directive, instructing the agent to regenerate a safe, strictly bounded plan.
  • Protocol 3 Lipschitz Saturation (3-Strike Lock): If gradient smoothness violations persist across 3 consecutive iterations, the AVL Gate forces a hard exit to HUMAN-IN-THE-LOOP REQUIRED mode, halting autonomous execution to preserve workspace integrity.

Discovery Mode Learning & Evolving Thresholds

  • Dynamic Baseline Calibration: Integrates with the CalibrationManager (avl_calibration_cache.json) to continuously track execution history, tool success rates, and affective tension ($\psi$).
  • Adaptive Rejection Calibration: Automatically adjusts safety rejection thresholds over time—learning routine operational baselines to eliminate false positives while maintaining zero-trust governance.

Proactive Cognition Layer (PCL)

The Proactive Cognition Layer (PCL) serves as Alluci’s continuous background reasoning and autonomous intelligence engine. Architecturally distinct from passive event watchers or simple cron pollers, PCL operates as an autonomous cognitive loop—continuously observing system signals, constructing stateful world models, identifying execution opportunities, and executing proactive workstreams without requiring explicit user prompting.

Five-Stage Cognitive Lifecycle (OBSERVE → MODEL → DETECT → JUDGE → ACT)

  • Observe: Scans multi-modal signal sources across active goals, inbound channel threads, H-LSM episodic memory, and real-time biometrics.
  • Model: Synthesizes raw environmental metrics into a structured, unified WorldModel snapshot persisted to SQLite database tables (pcl_world_snapshot).
  • Detect: Executes pluggable opportunity detection engines (StalledGoalDetector, UnresolvedThreadDetector, HardwareAnomalyDetector, AffectiveStressDetector) to discover actionable tasks.
  • Judge: Evaluates candidate opportunities against affective stress ($\psi$), quiet-hours boundaries ($22:00–07:00$), and workspace policy constraints, assigning calibrated confidence scores ($S_{\text{conf}} \in [0.0, 1.0]$).
  • Act / Notify: Dispatches verified low-risk background execution pipelines directly to the ExecutiveOrchestrator or broadcasts non-intrusive administrative notifications via streaming WebSockets (JsonRpcGateway).

Persistent World Model Synthesis

  • Stateful Snapshot Engine: Tracks long-term goal trajectories, project deadlines, and unresolved memory threads over rolling 48-hour windows.
  • Dream Cycle Integration: Feeds compressed world model snapshots into the nightly "Dream" cycle, enabling Socratic self-reflection and teacher-student preference harvests while hardware load is low.

Bio-Affective & Autonomy Calibration (ACE Integration)

  • Affective Stress Gating: Reads real-time valence, arousal, and stress scores ($\psi$) from the Affective Computing Engine (ACE).
  • Dynamic Intrusiveness Control: Automatically deprioritizes non-critical notifications and background task dispatches during high user stress, preserving focus and aligning system behavior with human physiology.

PVT Manifold Health Monitor (PVT)

The PVT Manifold Health Monitor (PVT) serves as Alluci’s real-time thermodynamic health and stability engine. Operating as a continuous diagnostic monitor within the ExecutiveOrchestrator, PVT models the cognitive state space using a thermodynamic triple ($P, V, T$) and Frenet-Serret state trajectory kinematics. It measures manifold pressure, available agency volume, entropy temperature, and trajectory curvature to prevent system instability, topological drift, and unauthorized execution runaways.

Thermodynamic State Triple ($P, V, T$)

  • Pressure ($P \in [0.0, 1.0]$): Measures constraint density relative to admissible volume ($P = \frac{\text{Active Constraints}}{4.0 \cdot V_{\text{agency}} + \epsilon}$). High pressure ($P > 0.8$) indicates hyper-constrained cognitive state space.
  • Volume ($V \in [0.0, 1.0]$): Quantifies admissible polytope hyper-volume and agent agency space ($V = (1 - \text{Budget}_{\text{used}}) \cdot \text{Coherence}$). Low volume ($V < 0.2$) indicates restricted operational autonomy.
  • Temperature ($T \in [0.0, 1.0]$): Tracks entropy spikes, topological instability, and trajectory curvature ($T = \Delta \beta_{\text{norm}} + D_{\text{KL}}(P_t \parallel P_{t-1}) + 0.3 \cdot \kappa_{\text{norm}}$). Evaluates normalized Betti signature shifts ($\Delta \beta$) and Kullback-Leibler divergence between execution steps.

Polytope Trajectory Continuity & Frenet-Serret Curvature (trajectory.py)

  • Geodesic Kinematics: Continuously tracks state trajectory vectors $\gamma(t) \in \mathbb{R}^d$, computing velocity $v(t) = \gamma(t) - \gamma(t-1)$ and acceleration $a(t) = \gamma(t) - 2\gamma(t-1) + \gamma(t-2)$.
  • Frenet-Serret Curvature Calculation: Derives instantaneous trajectory curvature: $$\kappa(t) = \frac{\sqrt{|v|^2 |a|^2 - (v \cdot a)^2}}{|v|^3 + \epsilon}$$
  • Curvature Rupture Detection: Detects abrupt cognitive shocks or prompt injection snaps when $\kappa(t) > 5.0$.

Real-Time Rupture Threshold & Safe-Halt Protocol

  • Rupture Detection ($T > 0.8$ or $\kappa > 5.0$): When entropy temperature breaches the critical rupture threshold ($T > 0.8$) or trajectory curvature snaps ($\kappa > 5.0$), PVT flags a CRITICAL state.
  • Emergency Safe-Halt ($g=0$): The ExecutiveOrchestrator immediately engages an emergency safe-halt ($g=0$), freezing tool actions and locking execution to protect workspace state.

Real-Time Telemetry & Audit Ledger Integration

  • WebSocket Streaming Gateway (manifold.pvt): Pushes live PVT telemetry triples ($P, V, T$) and curvature metrics over WebSocket RPC to client dashboards (PVTDashboard.tsx).
  • Cryptographic Audit Persistence (pvt_json): Serializes PVT diagnostic state triples into SQLite audit log ledgers (pvt_json), generating an immutable record of system thermodynamic stability.

Affective Computing Engine (ACE)

The ACE aligns machine logic with human biology. It bridges raw data and human sentiment, ensuring the assistant works in resonance with your current physiological and mental state.

Multi-Modal Polytope Fusion

  • Zero-Latency Biometrics: Streams Heart Rate, HRV, and Respiratory Rate directly from your Apple Watch into a shared "Affective Polytope". The agent intrinsically "feels" your physical stress without relying on string-to-vector language conversions.
  • Resonance Mapping: ACE adjusts agent autonomy and notification intensity in real-time. If physical strain is high, the Assistant deprioritizes non-urgent tasks.
  • Ambient ACE Dashboard: An SVG-based dynamic visualizer in the Terminal header. A pulsating Polytope shifts color (Valence), animation speed (Arousal), and structural complexity (Tension) in real-time to mirror your physical state.

1. The Local Cognitive Engine (LCE)

The Local Cognitive Engine (LCE) serves as Alluci’s native, on-device foundation intelligence substrate. Built around a Sovereign-First execution model, the LCE evaluates neural network models locally on host hardware—delivering ultra-low latency, zero-copy memory access, dynamic VRAM safeguards, and privacy-preserving cloud federation without cloud vendor lock-in or un-sanctioned data egress.

Official quantized model weights across all tiers are hosted on HuggingFace (Alluci LCE Models).

Apple Silicon Execution Plane

  • Native MLX Engine: Evaluates models 100% natively using Apple mlx_lm and mlx_vlm frameworks, leveraging Apple Silicon’s shared Unified Memory architecture for zero-copy tensor evaluation.
  • Thread-Safe Singleton & Async Lock: Operates as a thread-safe singleton managed by a strict Python asyncio.Lock inference semaphore, ensuring only one generation stream executes at any given moment to protect Metal GPU command buffers from memory panics.
  • Single & Multi-Worker Compute Threads: Offloads heavy non-blocking synchronous matrix calculations to a dedicated single-worker thread pool (ThreadPoolExecutor), while multi-agent task queues manage async token dispatching in parallel.
  • Dynamic Architectural Binding: Dynamically maps custom or fine-tuned model architectures to native mlx_lm model classes at runtime without monkey-patching codebase files.

Non-Apple Operating Systems Execution Plane

  • Cross-Platform PC & Linux Engine: On Windows, Linux, and NVIDIA CUDA environments, the LCE routes local inference requests through local_bridge.py utilizing standard llama.cpp C++ GGUF bindings or CUDA-accelerated PyTorch/vLLM adapters.
  • Unified API Parity: Ensures identical privacy gating, PII pseudonymization, and 4-tier memory integration across non-Apple hardware.

5-Tier System Hardware Profiling Matrix

Automatically profiles available System RAM and VRAM upon initialization, mapping the host environment to Apple’s product lineup and optimal model precision tiers:

  • TIER_0_ULTRA ($\ge 128\text{ GB} - 512\text{ GB}$ Unified RAM / $\ge 96\text{ GB}$ Code Threshold): Flagship Workstations & Sovereign Server Nodes (MacBook Pro / Mac Studio / Mac Pro Ultra) running unquantized 31B 16-bit (BF16) dense models.
  • TIER_1_MAX ($64\text{ GB} - 96\text{ GB}$ Unified RAM / $\ge 60\text{ GB}$ Code Threshold): High-Performance Studio & Pro Workstations (MacBook Pro / Mac Studio Max) running high-density 31B 8-bit / 4-bit models.
  • TIER_2_PRO ($32\text{ GB} - 48\text{ GB}$ Unified RAM / $\ge 30\text{ GB}$ Code Threshold): Executive & Developer Laptops (MacBook Pro Pro/Max Series) running 26B Mixture-of-Experts (MoE) 4-bit models.
  • TIER_3_BASE ($16\text{ GB} - 24\text{ GB}$ Unified RAM / $\ge 15\text{ GB}$ Code Threshold): Standard Consumer Hardware (MacBook Air, Mac mini, iMac) running 12B 4-bit dense models.
  • TIER_4_EDGE ($8\text{ GB} - 12\text{ GB}$ Unified RAM / $< 15\text{ GB}$ Code Threshold): Mobile Devices & Sentinels (iPhone 17 Series / Base Macs) running lightweight 2B 4-bit models.

VRAM Lifecycle, KV Cache & Offloading Safeguards

  • Metal VRAM Cache Ceiling: Metal GPU VRAM cache allocation (mx.set_cache_limit) to prevent host system slowdowns.
  • RAM Ceiling Protection: Restricts peak memory allocation to 75% of total system RAM.
  • Dynamic Q4 KV Cache Quantization: Automatically detects long prompts and activates 4-bit KV cache quantization while capping max generation tokens to prevent Metal buffer overflow crashes.
  • Streaming Attention Sinks (>16k Characters): When prompt context length exceeds 16,000 characters (>4,000 tokens), _apply_streaming_attention_sink() permanently pins initial system directives, zero-trust invariants, and grounding laws at token 0 (sink size: 2,000 chars) while maintaining a rolling active conversational tail (14,000 chars). Intermediate conversational turns are archived into H-LSM L1 episodic memory, enabling infinite multi-turn sessions without memory spikes.
  • Inter-Iteration VRAM Purging: Compulsory mx.clear_cache() and Python garbage collection calls execute before, during, and after every generation stream.
  • Idle Memory Auto-Offloader: Spawns a background thread monitor that unloads model weights and releases VRAM after idle time.

Zero-Restart LoRA Context Moat Ingestion

  • Dynamic Adapter Hot-Swapping: When specialized agents execute domain tasks (e.g. Legal, Financial, Coding), the LCE hot-swaps per-agent LoRA weights (models/loras/agent_{id}_lora.safetensors) directly into the active MLX model on the fly without restarting the engine process or breaking skill manifests.

Bio-Affective Telemetry Attunement

  • Silent System Directive Injection: Injects a silent <ACE_ATTUNEMENT_DIRECTIVE> into system prompts matching real-time Apple Watch biometrics (HRV, respiratory rate, stress score).
  • Dynamic Sampling Temperature Modulation: Dynamically modulates sampling temperature during high human stress (for hyper-focused, deterministic outputs) to relaxed states (for creative exploration).

Native Apple MLX Speculative Decoding (2B ➔ 31B)

  • Draft-Verification Acceleration: Pairs the lightweight edge model (mirror_cache/alluci-polytope-gemma-4-e2b-it-4bit) as an asynchronous speculator with the dense verifier model (mirror_cache/alluci-polytope-gemma-4-31b-it-bf16).
  • Parallel Sequence Validation: Evaluates speculated token streams natively through mlx_lm.stream_generate(..., draft_model=draft_engine), achieving 2.5x–4x faster local inference speeds with zero loss in mathematical precision.
  • Automated Fallback Circuit-Breaker: If draft model loading or memory allocation encounters pressure, the engine transparently retries via single-model generation with zero user disruption.

Model Router & Cross-Platform Scoping

  • Policy-Driven Execution: Routes requests dynamically based on privacy classifications (AIRGAPPED, SENSITIVE, PUBLIC) and token complexity requirements.
  • Cross-Platform PC Scoping: On non-Apple Silicon nodes (Windows, Linux, NVIDIA CUDA), automatically falls back to standard cross-platform backends (llama.cpp bindings or CUDA PyTorch/vLLM adapters) via local_bridge.py.

Neural Decoupling Layer

  • Abstract Engine Interface: Implemented by the abstract ExecutiveRouter interface, decoupling the high-level Agent Harness (skills, tools, memory, bridges) from underlying model weights so base weights can be upgraded without breaking skill manifests.

User Defined Privacy Gating

  • On-Device Isolation: Automatically intercepts tasks classified as AIRGAPPED or SENSITIVE, hard-routing them 100% on-device inside the local MLX engine with zero network egress.

Local PII Extraction & Pseudonymization

  • Inline Egress Firewall: When tasks are policy-routed to cloud model providers, outbound prompts pass through the AlluciSecureProxy. Sensitive names, phone numbers, email addresses, and private keys are extracted into a local ephemeral vault and replaced in the outbound prompt by abstract placeholders (e.g., <PERSON_1>, <PHONE_1>).

Local Response Re-Hydration

  • Local Vault Token Restoration: When external API models return their text response, the AlluciSecureProxy restores the original vault data locally on your device, delivering complete answers without external cloud providers ever receiving raw user PII.

2. Local Voice & Conversational Speech Engine

The Local Voice & Conversational Speech Engine (AlluciVoiceOrchestrator in backend/inference/voice_orchestrator.py) provides native, zero-latency audio transcription and cross-device voice interaction. Operating natively on host hardware, the Voice Engine pairs Apple Silicon mlx_whisper speech-to-text with hybrid voice synthesis, dynamically routing audio payloads based on host device capabilities.

Streaming Audio Processing & Utterance Finalization (/ws/voice)

  • Streaming 200ms Audio Fragments: Ingests live PCM audio streams (16kHz float32 arrays) over streaming WebSocket RPC channels (backend/routers/voice.py).
  • End-of-Speech Utterance Finalization: Accumulates audio fragments in a rolling buffer, automatically detecting sustained silence to finalize complete speech utterances (finalize_utterance) and dispatch text tokens to the LCE for reasoning.

Hybrid Cross-Device Voice Synthesis (synthesize_response)

  • Native Apple OS Speech (WATCH_ULTRA & IPHONE_17_PRO): Delivers lightweight text tokens (type: "text_for_native_tts") to edge devices, triggering native Apple OS AVSpeechSynthesizer (Siri Voice Engine) on the Apple Watch and paired iPhone for battery-efficient, natural voice playback.
  • Neural Kokoro MLX Engine (MACBOOK_WORKSTATION): On developer workstations, synthesizes neural 24kHz PCM audio buffers using kokoro_mlx (kokoro_bridge.py), rendering studio-quality custom voice profiles directly on Metal GPU.

Cross-Device Model Topology Map (TIER_MODEL_MAP)

  • MACBOOK_WORKSTATION (Workstation Core): Runs unquantized whisper-large-v3-turbo for high-precision transcription coupled directly to local 31B foundation models.
  • IPHONE_17_PRO (Mobile Hub): Runs 8-bit whisper-base-8bit alongside lightweight edge models (EDGE_2B_4BIT) for offline mobile speech recognition.
  • WATCH_ULTRA (Edge Sentinel): Uses native WatchOS audio capture (AVAudioEngine) and native speech synthesis (AVSpeechSynthesizer), delegating all cognitive reasoning and heavy transcription to the paired iPhone or host workstation over encrypted P2P WebSocket tunnels.

3. Executive Orchestration Engine for Tasks, Crons & DAGs

The Executive Orchestrator serves as Alluci’s high-level planning and task execution engine. It transforms complex, ambiguous user objectives into structured, non-blocking execution pipelines. By combining hierarchical task decomposition, recurring background cron scheduling, real-time context compression, and continuous statistical safety calibration, the Orchestrator manages multi-agent Constellations with sub-second execution efficiency.

Tasks & Goal Management

  • Autonomous Task Lifecycle: Manages long-running, multi-step goals from initial user prompt to final artifact generation. Tasks are tracked as stateful execution records with real-time status updates, error recovery, and pause/resume capabilities.

Cron Engine & Recurring Schedules

  • Autonomous Background Crons: Schedules and executes recurring background jobs (e.g. daily memory summarization, automated channel polling, market monitoring, or system health sweeps) without requiring active user presence.

Hierarchical DAG Planner

  • Directed Acyclic Graph Decomposition: Parses multi-agent goals into Directed Acyclic Graphs (DAGs). Sub-tasks are dispatched in parallel across specialized worker agents (e.g., Deep Research, Code Architect, Financial Analyst), dramatically accelerating execution speed for complex workflows.

Topological Heartbeat Daemon & Standing Surveillance

  • 6-Path Proactive Plane: Operates continuous background diagnostic sweeps (task_deadline, file_watch, goal_progress, url_fetch, system_health, bridge_silence, subagent_loop, topological_drift).
  • Discrete Barcode Clock Synchrony: Paced on every iteration by barcode_clock.tick() ($N \to N+1$).
  • 1D Reasoning Loop Detection: Continuously probes active Betti invariants; detects circular sub-agent execution loops when $\beta_1 > 0$ and triggers automated self-healing.
  • Quiet-Hours Counterfactual Dreaming: Runs offline perturbation simulations in JSpaceSimulator during low-load windows ($22:00–07:00$), persisting verified recovery triplets to DPOTripletHarvester.

Supervisor Agent Context Compression

  • Token Optimization & Bloat Prevention: The SupervisorAgent condenses verbose worker node outputs into dense "Sovereign Context Tokens" before passing state to downstream nodes in the DAG, preventing context-window bloat and maximizing token efficiency.

Dynamic Multi-Tier Model Routing

  • Policy-Driven Provider Selection: Routes individual Task, Cron, and DAG nodes dynamically based on privacy classifications (AIRGAPPED, SENSITIVE, PUBLIC), model strengths, and execution speed—dispatching private data locally to the LCE engine while routing high-density web synthesis to fast cloud APIs.

Multi-Agent Constellations & Sub-Agent Configurations

Alluci is built from the ground up as a Self-Sovereign Multi-Agent Operating System. Rather than executing all workloads within a single monolithic prompt loop, Alluci allows you to instantiate, configure, and orchestrate arrays of specialized agents (AgentRecord) operating as autonomous background daemons, channel handlers, or parallel DAG worker nodes.

1. Independent Agent Record & Engine Matrix (AgentRecord)

Each agent in the Constellation is backed by a stateful AgentRecord table in SQLite, defining its identity, underlying foundation model, and operational parameters:

  • Model Provisioning: Assign specific primary foundation models per agent—ranging from local MLX/LCE models (alluci-polytope4-31b) to cloud foundation models (OpenAI gpt-4o, Anthropic claude-3-5-sonnet, Google gemini-1.5-pro).
  • Resilient Fallback Chains (fallback_chain): Configures ordered model failover routes (e.g., gpt-4o -> claude-3-5-sonnet -> local_mlx), guaranteeing execution continuity if primary cloud endpoints experience outages or rate limits.
  • Engine Matrix Controls (engine_manifest): Fine-tunes cognitive execution parameters per agent, including Thinking Depth (thinking_level), Verbose Output Scales (verbose_level), and Multi-Step Reasoning Intensity (reasoning_level).

2. Sub-Agent Domain Specialization & Scoped Manifests

To prevent cross-domain context contamination, sub-agents are provisioned with granular access controls across seven dedicated configuration tabs (AgentDetailTabs.tsx):

  • Scoped Skill Profiles (skills_manifest): Grants or restricts domain-specific skill manifests (e.g. Legal Contract Audit, Compensation Strategy, Deep Research, SFT LoRA Forge).
  • Tool Access Grants (tools_manifest): Enforces fine-grained permissioning over available executable tools (Shell Executor, Memory Adapter, Web Browser, Vault Keys), ensuring sub-agents operate strictly within authorized boundaries.
  • Soul Profile Overrides (soul_profile_id / soul_manifest_override): Allows sub-agents to inherit or override the system's global Soul Manifest with specialized domain personas.
  • Automated Heartbeat Orders (HeartbeatOrderRecord): Schedules periodic diagnostic probes (fired_at, probe_type, action_type) to execute background health sweeps, channel monitoring, or memory maintenance automatically.

3. Hierarchical DAG Swarm & Supervisor Context Compression

  • Parallel Sub-Task Decomposition: The ExecutiveOrchestrator parses complex, ambiguous user goals into Directed Acyclic Graphs (DAGs). Sub-tasks are dispatched in parallel across specialized sub-agents running concurrently.
  • Supervisor Context Compression: To prevent context-window bloat during long-running multi-agent workflows, the SupervisorAgent condenses verbose worker node outputs into dense Sovereign Context Tokens before propagating state to downstream DAG nodes.
  • Multi-Channel Subscriptions: Sub-agents can be assigned to dedicated communication bridges (iMessage, Slack, Signal, Telegram, Discord, WebChat), acting as specialized channel handlers for inbound messages.

4. Zero-Trust Security & Sub-Agent Privacy Controls

  • Granular PII Masking Overrides (pii_override_enabled): Allows administrative override or enforcement of inline PII pseudonymization for specific sub-agents handling sensitive data streams through the AlluciSecureProxy.
  • Biometric & Executive Safety Interceptors: All sub-agent tool executions—regardless of autonomy level—remain strictly governed by the AVL Gate, DPK integer boundary checks, and the HITL Security Intervention Modal.

4. Simplicial H-LSM Memory

  • The Hierarchical Long-Short Manifold (H-LSM) is Alluci’s 4‑tier stateful memory architecture. Managed by HLSMManager (backend/memory/hlsm_manager.py) augmented by the Markov Trace & Spectral Geometry Engine (backend/memory/markov_trace.py).

  • H-LSM enables the agent to retain personal and organizational memory over time without context‑window bloat, context degradation, or hallucinations.

  • H-LSM operates across four cognitive memory storage tiers: • L0 Working Memory: Ultra‑fast, session‑level expiring context backed by Redis (Key‑Value) with automatic zero-config fallback to SQLite table hlsm_working. • L1 Episodic Memory: Full chat turns, interaction history, and episodic event logs backed by SQLite table hlsm_episodic with a high‑performance SQLite FTS5 full‑text search index (hlsm_episodic_fts). • L2 Semantic Memory: Long‑term vector embeddings for retrieval‑augmented generation (RAG), backed by Sentence‑Transformers (all‑MiniLM‑L6‑v2) and KùzuDB graph nodes (polytope_data.kuzu). • L3 Knowledge Graph: Permanent structured entity‑relationship graph nodes backed by the KùzuDB embedded graph database engine (polytope_data.kuzu).

  • Tri-Hybrid Reciprocal Rank Fusion (RRF $k=60$): • Parallel Asynchronous Retrieval: Dispatches queries concurrently across L1 SQLite FTS5 ($w=1.0$), L2 MiniLM Dense Vectors ($w=1.2$), and L3 KùzuDB Knowledge Graph Entities ($w=1.4$). • Authoritative Score Fusion: Harmonizes multi-modal score distributions using the standard RRF constant ($k=60$): $$\text{Score}{\text{RRF}}(d) = \sum{t \in {\text{L1}, \text{L2}, \text{L3}}} \frac{w_t}{60 + \text{rank}_t(d)}$$ • Knowledge Graph Entity Injection: Automatically extracts retrieved entity relations from KùzuDB and injects them directly into prompt grounding contexts under structured entity headers (── Knowledge Graph Entities ──).

  • Markov Trace Multi-Hop Rescoring & Scale-Dependent Spectral Geometry (markov_trace.py): • Schur Complement Trace Operator: Uncovers multi-hop hidden excursion pathways across visible and hidden memory nodes: $$\text{Tr}_A(P) = A + B(I - C + \epsilon I)^{-1} D$$ boosting visible candidate scores (80% direct semantic relevance + 20% topological excursion boost) and promoting high-coupling hidden bridge nodes. • Symmetrized Normalized Laplacian ($L_A$): Computes normalized Laplacian eigenvalues $\lambda_i \ge 0$, Fiedler algebraic connectivity ($\lambda_2$), and heat return probability $P_A(\sigma) = \frac{1}{|A|} \sum e^{-\sigma \lambda_i}$. • Dynamic Context Depth Scaling: Derives the scale-dependent spectral dimension $d_s^A(\sigma) = 2\sigma \frac{\sum \lambda_i e^{-\sigma \lambda_i}}{\sum e^{-\sigma \lambda_i}}$, dynamically expanding retrieval depth (max_per_tier) when mixing is sparse ($d_s^A > 1.5$).


5. Local Fine-Tuning (SFT) & The LoRA Forge

Alluci utilizes a specialized "Training Sandbox" mode that leverages the Unsloth library (optimized for 80% less VRAM usage) to perform Supervised Fine‑Tuning (SFT) directly on your hardware.

  • The Data Pipeline: Alluci’s H‑LSM Memory acts as the dataset generator. It continuously scrapes and cleans your local usage logs, business documents, and chat history into a secure "Sovereign Dataset."
  • Native DPO & LoRA Forge: You can trigger a "Skill Distillation" session where Alluci uses your specific data and a native PyTorch Direct Preference Optimization (DPO) kernel to forge custom LoRA (Low‑Rank Adaptation) adapters for Gemma 4.

6. The "Dream" Cycle & Autonomous Evolution

When the system detects low cognitive load (you are asleep or away), the daemon halts external polling and reallocates 100% of hardware resources to internal evolution:

  • 5-Stage Nightly Evolution Pipeline: 1) Extraction (Episodic memories, PCL world model snapshot, ACE baseline, quarantine pool), 2) Offline $\mathcal{J}$-Space Counterfactual Rollouts (j_space_simulator.py) simulating boundary recovery, 3) Teacher Synthesis (air-gapped local 31B Dense model instruction pair synthesis), 4) Cognitive Distillation (Socratic questioning of episodic logs into permanent Semantic Truths), and 5) Preference Harvesting.
  • Direct Preference Optimization (DPO) Harvesting (dpo_harvester.py, markov_trace.py): Automatically harvests teacher-student preference triplets $(x, y_w, y_l)$ from:
    1. H-LSM Self-Healing Deltas: Resolved failure-to-healing plan pairs (failed_plan $\to$ successful_plan).
    2. Quarantined AST Anti-Patterns: Quarantined execution traces (reverted_code $\to$ repaired_code).
    3. Offline $\mathcal{J}$-Space Dream Traces: Counterfactual perturbation simulations verifying state projection recovery onto the $O_6$ convex kernel.
  • Analytical Softplus DPO Loss: Evaluates model preference margin using analytical softplus loss: $$\mathcal{L}{\text{DPO}} = \ln\left(1 + \exp\left(-\beta \left[(\log \pi\theta(y_w \mid x) - \log \pi_{\text{ref}}(y_w \mid x)) - (\log \pi_\theta(y_l \mid x) - \log \pi_{\text{ref}}(y_l \mid x))\right]\right)\right)$$ persisting atomic JSONL preference datasets for local LoRA adapter fine-tuning without mutating immutable base model weights.

Soul Configuration & Persona Architecture

The Soul Manifest serves as Alluci’s core behavioral blueprint and active cognitive runtime engine. Moving beyond static system prompts and plain .md files, Alluci decouples persona configuration into a stateful, auditable Soul Manifest that actively drives model sampling parameters, dynamic neural-weight adapters, zero-trust security gates, and bio-affective attunement loops in real time.

1. Active Dynamic Runtime Execution

  • Zero-Restart Neural LoRA Injection (apply_lora_adapter): Rather than cluttering context windows with lengthy text instructions, Soul Profiles hot-swap compiled LoRA neural weights (agent_{id}_lora.safetensors) directly into VRAM on the fly without restarting the inference engine process.
  • Bio-Affective Parameter Attunement: Dynamically couples user biometrics (HRV, stress score $\psi$) from the ACE Engine, continuously modulating sampling temperature, memory retention thresholds, and intrusiveness limits in real time.
  • Topological Boundary Gating: Candidate actions generated under an active Soul Profile are continuously validated by the Discrete Projection Kernel (DPK) and AVL Gate to prevent structural hallucinations and out-of-bounds execution.
  • Dual Persistent Identity (VerusID VDXF & AES-256 Vault): Serializes manifests into decentralized VerusID VDXF keys (contentmultimap) for portable identity, with local AES-256-GCM envelope encryption for air-gapped sovereignty.

2. Behavioral Parameters & Reasoning Frameworks

  • Identity Core & Boot Directives: Defines the foundational identity handle (identityCore), voice profiles (voiceProfile), system directives, and boot sequence parameters (bootSequence).
  • Cognitive Control Sliders: Quantifies reasoning styles via dynamic scalar controls including Creativity, Verbosity, Humor, Conciseness, Tone, and Empathy (SoulPreferences).
  • Structured Thought Frameworks: Injects granular cognitive guidelines into execution loops, including specific Mindsets, Methodologies, Decision Frameworks, Logic Constraints, Chains-of-Thought, and Domain Best Practices.
  • Active Skill & Tool Bindings: Maps specific active skill IDs (active_skill_ids) and executable tool IDs (active_tool_ids) directly to the soul context, restricting or expanding agency based on active persona.

3. Reusable Soul Profiles & Real-Time Preview Engine

  • Profile Library (SoulProfileRecord): Supports creating, updating, listing, and switching between pre-configured Soul Profiles stored in the local SQLite database (/soul/profiles), allowing users to toggle between executive, technical, creative, or analytical personas on the fly.
  • Interactive Persona Preview (/soul/preview): Features a dedicated preview endpoint that executes candidate prompts through the current Soul Manifest before committing updates to active agent sessions, providing instant feedback on persona alignment and safety constraints.

Dynamic Skills, Tools & Builder Engines

Traditional AI agent frameworks define "Skills" and "Tools" as static markdown text files (SKILL.md) or simple string descriptions embedded in system prompts. This legacy approach suffers from severe limitations: high context window bloat, steep API token costs, floating-point non-determinism, soft pattern-matching hallucinations, and a complete lack of runtime execution validation.

The Alluci Sovereign Agent completely re-architects Skills and Tools from passive text documents into Active Cognitive Python Runtimes and Skill-Specific Deterministic Tool Engines. Managed by the SkillManager (backend/routers/skills.py) and ToolRegistry (backend/routers/tools.py), Skills and Tools operate as compiled, stateful runtimes driven by five deterministic cognitive parameters (Knowledge, Mindsets, Methodologies, Chains of Thought, and Logic), zero-trust security gates, and hardware biometric governance.

1. Skills & The Skill Builder Engine

When creating or instantiating a Skill, the Skill Builder Engine configures five deterministic parameters that govern the active Python Skill Runtime:

  • Knowledge Parameters: Binds the skill directly to the 4-Tier H-LSM Memory manifold—retrieving real-time entity-relationship subgraphs from KùzuDB (L3 Knowledge Graph), semantic embeddings (L2 Vector RAG), and indexed interaction history (L1 Episodic FTS5) without factual drift.
  • Mindset Parameters: Injects structured cognitive framing vectors (e.g., Zero-Trust Security, First-Principles Engineering, Sovereign Capital Optimization) that govern how sub-agents frame complex problems, weigh risks, and prioritize tradeoffs.
  • Methodology Parameters: Enforces rigid, multi-step operational algorithms (e.g., RACI/RAPID decision governance, 30-60-90 milestone roadmaps, total rewards auditing) that mandate the exact sequence of workflow execution.
  • Chain of Thought (CoT) Parameters: Specifies prescriptive reasoning trajectories where intermediate reasoning steps must satisfy topological continuity rules before downstream execution steps are granted.
  • Logic Parameters: Enforces bit-exact execution using fixed-point quantization (SEC-005 int16 clamping) and discrete integer simplicial boundary operators ($\partial_k: C_k \to C_{k-1}$), eliminating floating-point non-determinism across Host CPU, CUDA GPU, and Apple Metal GPU runtimes.

2. Python Skill Runtime & LoRA Neural Distillation

  • Direct Preference Optimization (DPO) Forge: As agents execute skills, high-quality interaction trajectories are harvested into DPO preference pairs. The local LoRAForge (backend/engine/lora_forge.py) crystallizes these trajectories into native PyTorch/MLX LoRA adapters (e.g., coding_lora.safetensors, legal_lora.safetensors).
  • Zero-Restart Neural Swapping: Activating a skill hot-swaps its fine-tuned LoRA weights directly into inference memory via apply_lora_adapter(), delivering domain expertise with zero prompt-window bloat.
  • Swarm Skill Synchronization (AntNetworkProtocol): Skill execution paths are mapped into Betti topological barcodes ($\beta_0, \beta_1, \beta_2$) and broadcast over the Verus P2P network, allowing multi-agent constellations to share skill intelligence zero-knowledge across devices.

3. Tools & The Tool Builder Engine

Tools in Alluci are Skill-Specific Deterministic Tool Engines backed by sandboxed Python runtimes, Model Context Protocol (MCP) servers, JSON-RPC daemons, and compiled C++ kernels:

  • The Tool Builder Engine & Sandboxed Runtimes: Enables users and autonomous agents to create, test, register, and update custom Python tool adapters dynamically (alluci_vault/tools/ and core_tools/) with explicit JSON Schema contracts, rate limits, and timeout boundaries.
  • Rocco 2.0 Multi-Query Deep Research Harvester (WebSearchAdapter): Decomposes complex research queries into parallel orthogonal search vectors executed concurrently with strict 4.0s timeouts, URL deduplication, and a dedicated 24-hour TTL SQLite cache (ResearchDossierCache in backend/data/research_cache.db), serving repeat lookups with 0ms latency and real markdown citations.
  • Multi-Runtime Adapter Support: Native execution support for sandboxed Python modules, MCP servers, REST/RPC endpoints, CLI scripts, and compiled C++ DPK security kernels.
  • Integrated Zero-Trust Interception: Tool executions from Python Skill Runtimes pass through the AVL Gate, DPK integer boundary checks, and biometric pulse liveness guards before payload commitment.

Hardware-Level Security Governance

Alluci implements a zero-trust, hardware-anchored security model that couples system execution directly to physical human presence and device liveness. Rather than relying solely on software passwords or API key tokens, Alluci enforces multi-modal biometric liveness, hardware kill switches, interactive executive governance, and isolated cryptographic vault containers to guarantee absolute data sovereignty and prevent unauthorized execution.

HITL Executive Security Governance & Intercept Guards

  • Three-Tier Hard Security Interceptors: Intercepts high-risk critical action tasks—such as destructive memory wipes, database schema alterations, file overwrites, financial transactions, or administrative configuration changes—before any backend execution occurs (backend/routers/gemini.py).
  • Interactive Security Intervention Modal: Any execution intent classified as a critical action task triggers an interactive user approval modal (SecurityInterventionModal.tsx), requiring explicit administrative authorization ([ Approve & Execute Action ]) before operations proceed.

Sovereign Biometric Kill Switch Daemon (BioTelemetryAuth / PPN-017)

  • Multi-Device Hardware Support: Monitors biological telemetry natively from Apple Watch as well as cross-platform wearable streams (Garmin, Whoop, Oura) via BioTelemetryAuth.
  • On-Wrist & Pulse Liveness Verification: Validates physical on-wrist presence (is_on_wrist=True) and active heart rate pulse before executing sensitive operations (banking, db_write, file_overwrite, os_exec, crypto_tx).
  • Configurable Policy Enforcement: When strict biometric enforcement is enabled (REQUIRE_WATCH_TELEMETRY=True), loss of wrist contact or missing pulse instantly activates the Sovereign Kill Switch—aborting execution, locking the agent, and encrypting active working memory.

Multi-Modal Anti-Spoofing & Deepfake Defense (PPN-018)

  • Acoustic Micro-Hesitation Analysis: Analyzes incoming voice streams for sub-audible jitter, acoustic tremor, and natural vocal breath pauses to detect synthetic AI voice clones.
  • Live Respiratory Cross-Verification: Cross-references vocal micro-hesitations against real-time Apple Watch respiratory telemetry to verify physical human liveness before executing privileged commands.

Simplicial Cryptographic Vault Isolation

  • Isolated Bridge Containers: Sandboxes every external communication channel and tool integration (Signal, iMessage, Slack, Google Drive, Email) within isolated cryptographic containers.
  • AES-256-GCM Envelope Encryption: Protects channel secrets, tokens, and bridge state using AES-256-GCM envelope encryption, preventing cross-bridge context leaks or unauthorized data access.

Verus Sovereign Identity & DREAM Architecture

Alluci is built natively around the Verus DREAM (Decentralized Real-time Encrypted Application Model) framework. By abandoning centralized cloud application servers, API keys, and third-party database proxies, Alluci pairs local-first machine intelligence with VerusID self-sovereign identities, structured VDXF data namespaces, local blockchain nodes, and encrypted peer-to-peer (P2P) state synchronization.

1. Alignment with the Verus DREAM Application Model

  • Decentralized Real-Time Encrypted Runtime: Implements the DREAM paradigm by anchoring agent state, user authorization, and executive manifests directly to self-sovereign identity handles (identity@).
  • Zero-Trust Peer-to-Peer Protocol: Replaces central server infrastructure with encrypted P2P messaging and VDXF data structures. Agent instances communicate peer-to-peer using Ed25519 cryptographic signatures without exposing raw data to central relays.

2. Local Verus Blockchain Node & PBaaS Architecture (verus_rpc.py)

  • Native Local Node Execution: Interacts directly with a local Verus blockchain node via high-performance JSON-RPC (verus_get_info, verus_get_identity).
  • Self-Sovereign Fund & Asset Control: Manages local wallet funds, executes cross-chain transfers (verus_send_currency), and creates decentralized marketplace orders (verus_make_offer) natively on-device.
  • Public Blockchains as a Service (PBaaS): Leverages Verus PBaaS multichain infrastructure for cross-chain identity verification and sovereign token settlement across interconnected blockchain networks.

3. Verus Data eXchange Format (VDXF) Data Layer (vdxf_store.py)

  • Structured Sovereign Data Namespaces: Utilizes standardized, typed VDXF keys (verus_get_vdxf_id) to structure application data, skill manifests, and agent configurations without vendor lock-in.
  • Identity-Bound Content Mapping (contentmultimap): Stores and retrieves encrypted agent manifests and peer messages directly on the VerusID content multimap (VDXFStore), creating a portable, decentralized state storage layer.

4. On-Chain Audit Ledger Anchoring (audit_ledger.py / verus_txid)

  • Cryptographic State Invariance Proxies: Periodically computes SHA-256 state hashes ($\text{Hash}_{\text{integrity}}$) across the AuditLedger and H-LSM memory manifolds.
  • Immutable On-Chain Proofs (verus_txid): Anchors state integrity hashes and executive action summaries directly to the Verus blockchain (verus_txid and vdxf_key), generating an un-alterable, mathematically verifiable audit log of agent history.

5. Federated Swarm Intelligence & Digital Pheromones (AntNetworkProtocol)

  • P2P Swarm Problem Solving: Uses the AntNetworkProtocol (Alluci_Ant_v1) over Verus VDXF messaging channels to coordinate multi-agent constellations across distributed devices.
  • Zero-Knowledge Digital Pheromones: Broadcasts abstract, invariant "Topological Barcodes" (Betti signature pheromones) over the Verus P2P network. Agents harvest collective problem-solving paths to achieve swarm intelligence without ever transmitting raw prompts, private text, or personal credentials.

🌍 Data Residency & EU Compliance

For enterprise environments requiring strict GDPR or Schrems II compliance, the Sovereign Agent utilizes a "Defense in Depth" proxy strategy:

  • AlluciSecureProxy: The proxy automatically intercepts outbound LLM requests, extracts PII into a local ephemeral vault, and sends only mathematically abstract payloads (pseudonymization) to cloud providers (OpenAI/Gemini).
  • Hard-Locked Egress: Setting DATA_REGION="EU" in the environment mathematically prevents any cloud egress without passing through the pseudonymization proxy.
  • Physical Endpoint Overrides: Setting ENFORCE_EU_ENDPOINTS=True forces Azure OpenAI and Google Vertex API clients to dynamically route to EU-based datacenters on the fly.

[!NOTE] See the full Data Residency & Compliance Architecture for legal and technical implementation details.


📊 Token Usage, Spending Monitoring & Budget Controls

Alluci includes an integrated Usage & Cost Analytics Engine (UsageTracker in backend/analytics.py and backend/routers/usage.py) that delivers real-time token tracking, financial telemetry, multi-provider model cost rollups, and spending optimization across all cloud and local execution paths.

1. Real-Time Token & Financial Cost Telemetry (/usage)

  • Granular Token Tracking: Automatically tracks Input Tokens, Output Tokens, KV Cache Read Tokens, KV Cache Write Tokens, and calculated financial costs in USD for every interaction.
  • Time-Series Analytics Endpoints: Exposes dedicated REST endpoints for aggregate cost summaries (/usage/summary), daily usage rollups (/usage/daily), and turn-by-turn cumulative session curves (/usage/sessions/{session_key}/timeseries).
  • Session-Aggregated Breakdown (/usage/sessions): Provides session-level audit metrics detailing agent identities, provider distributions, model selection, total turn counts, and timestamp logs.

2. Multi-Provider & Heterogeneous Model Cost Allocation

  • Unified Multi-Cloud Costing: Accurately calculates costs across heterogeneous cloud APIs (OpenAI, Anthropic, Google Cloud, Groq, DeepSeek, OpenRouter, AWS Bedrock) as well as zero-cost local MLX/LCE models ($0.00/token).
  • Cache Efficiency Telemetry: Monitors cache hit ratios and KV cache reuse savings, optimizing prompt caching efficiency across OpenAI, Anthropic, and Google Cloud context windows.

3. Policy-Driven Spending Controls & Token Budgeting

  • Intelligent Token Router: Dynamically routes tasks based on cost thresholds, model performance profiles, and user-defined privacy tiers (AIRGAPPED, SENSITIVE, PUBLIC).
  • Air-Gapped Zero-Cost Fallback: Automatically diverts high-volume background tasks, memory summarization crons, and sensitive document indexing to local on-device MLX/LCE models, capping cloud API expenditure.

4. Auditable Enterprise CSV Exports (/usage/sessions/export/csv)

  • Downloadable CSV Reports: Generates downloadable CSV exports containing turn-by-turn usage records, agent tags, provider breakdowns, cache metrics, and total expenditure for accounting, cost allocation, and financial compliance auditing.

🚀 Comprehensive Onboarding Guide

The Sovereignty Level Wizard makes onboarding seamless. Choose between Cloud-only (Level 1), Local Edge (Level 2), or the Full Sovereign Base (Level 3).

📋 System Prerequisites & Dependency Matrix

Before installing Alluci, verify that your host environment meets the following requirements:

1. Core Runtimes & Build Toolchains

  • Frontend Runtime: Node.js (v20+) & npm (v10+)
  • Backend Runtime: Python (v3.12+) & pip
  • Native Build Tools: C++ Compiler (clang++ on macOS, g++ on Linux, MSVC on Windows), make, git, and lsof (Required to compile native DPK security kernels)

2. Inference & Acceleration Engines

  • Apple Silicon (macOS): Native Apple MLX frameworks (mlx, mlx-lm, mlx-vlm, mlx-whisper) leveraging Unified Memory
  • PC & Linux (NVIDIA CUDA / CPU): PyTorch (torch>=2.4.0), sentence-transformers, or llama.cpp GGUF bindings via local_bridge.py
  • Model Provisioning: huggingface_hub CLI for downloading model weights from HuggingFace (Alluci Models)

3. Data & Storage Engines

  • Relational & Search: SQLite3 with FTS5 enabled (Built into Python standard library)
  • Embedded Graph DB: KùzuDB (kuzu embedded C++ engine) powering H-LSM Knowledge Graph
  • In-Memory Cache: Redis (v7.0+, optional for high-speed L0 Working Memory; automatically falls back to SQLite in zero-config LITE_MODE)

4. Optional Sovereign Services

  • Verus Identity & Blockchain Node: Local verusd node RPC daemon for VerusID decentralized identity, VDXF content maps, and on-chain audit ledger anchoring
  • Biometric Telemetry Webhooks: Apple Watch bridge (bridges/iwatch.py) or wearable webhooks (Garmin, Whoop, Oura) for bio-affective stress attunement and the Sovereign Kill Switch

1. Air-Gap Boundary & Automated Model Provisioning

Alluci features an automated, hardware-aware model downloader (scripts/download_models.py).

  1. Hardware-Aware Model Provisioning (Online Setup): Running ./scripts/setup_sovereign_stack.sh triggers HardwareProfiler.get_system_profile(). The profiler scans host System RAM, VRAM, and GPU architecture, automatically downloading the optimal model weights directly from HuggingFace (Alluci Models) into your local mirror_cache/:

    • Automatically pulls your assigned primary tier model (TIER_0_ULTRA through TIER_4_EDGE).
    • Automatically pulls the lightweight speculator model (EDGE_2B_4BIT) for draft-verification token acceleration.
    • Automatically pulls the offline PPN embedding model (all-MiniLM-L6-v2) for local RAG vector search.
  2. Air-Gap Activation (100% Offline Sovereignty): Once the setup script outputs [ INFO ]: Setup Complete, all model weights, tokenizer manifests, and embedding models are cached locally. You can physically disconnect network cables or disable Wi-Fi, and the Sovereign Agent will execute indefinitely offline with zero external network dependencies.


2. Local Stack Execution & Automation

Automated Stack Initialization

chmod +x scripts/setup_sovereign_stack.sh
./scripts/setup_sovereign_stack.sh

Managing the Stack via Makefile The easiest way to run the entire stack locally is using our pre-configured Makefile:

make init     # Initialize .env, virtualenv, and install dependencies via bootstrap_all.sh
make start    # Cleanly start Backend (Port 8000) and Frontend (Port 3000)
make status   # Verify port 8000/3000 status and active services
make doctor   # Run diagnostic check on toolchain and local environment (scripts/verify_local.py)
make stop     # Gracefully terminate active background processes

Manual Startup Alternative:

  • Backend (Port 8000): source .venv/bin/activate && uvicorn backend.app:app --port 8000 --host 0.0.0.0
  • Frontend (Port 3000): npm run dev -- --port 3000 --host 0.0.0.0

Open http://localhost:3000 to launch the Alluci Sovereign Gateway. Upon first launch, the Sovereignty Wizard will guide your configuration.


3. Configuring Vault Secrets & Sovereign Credentials

The Sovereign Agent uses a strictly local .env file to seed its Verus Vault and configuration parameters:

cp .env.example .env

Configure core environment keys in .env:

  • POLYTOPE_MASTER_KEY: Master seed for AES-256 vault encryption and 2FA secrets.
  • JWT_SECRET_KEY: Used for secure session token signing.
  • VERUS_ID_IDENTITY: Sovereign VerusID identity handle (YourIdentity@).
  • VERUS_ID_PRIVATE_KEY: Ed25519 private key seed for executive manifest signing.
  • REQUIRE_WATCH_TELEMETRY: Set to True to enforce biometric kill switch liveness checks.
  • DATA_REGION: Set to EU to enforce the SecureProxy PII firewall.
  • ENFORCE_EU_ENDPOINTS: Set to True for strict physical EU cloud datacenter routing.

4. Sovereign Reliability Engineering (SRE) & Quality Gate

Alluci incorporates a rigorous quality gate to guarantee local system stability, zero-trust security, and immutable supply-chain integrity:

make quality

The Quality Gate Executes:

  • Preflight Checks: Validates toolchain dependencies, virtualenv setup, and environment integrity (scripts/production_readiness/preflight.sh).
  • Test Suite Execution: Runs full backend pytest suites (pytest backend/tests/ -v) and performance benchmarks (pytest backend/tests/performance/test_benchmarks.py).
  • Security & Dependency Audits: Performs npm audit, pip-audit, and static secret detection scanning.
  • Automated Release Reporting: Generates timestamped diagnostic reports in reports/ (generate_release_report.py).

To run tests manually:

source .venv/bin/activate
pytest backend/tests/ -v

🔧 Debug & Diagnostic Mode

The DEBUG environment variable controls system diagnostic verbosity:

  • Production (DEBUG=False): Mutes internal exception tracebacks, masks FastAPI error details, and sanitizes JSON-RPC response payloads.
  • Development (DEBUG=True): Enables full exception tracebacks, detailed validation data, and verbose topological log output.

Set DEBUG=True in your .env or export the variable locally to enable detailed diagnostics during development.


📜 License

Copyright © 2026 Alluci-Ai. All Rights Reserved.

This software and associated documentation files (the "Software") are the proprietary property of Alluci-Ai. Unauthorized copying, reproduction, distribution, modification, or use of this Software, via any medium, is strictly prohibited without the express written permission of Alluci-Ai.

For information on our strictly-gated proprietary contribution process, please review our Contribution Guidelines.


"Alluci-Polytope: Turning AI from a passive tool into a sovereign, affective partner."