Skip to content

Grar00t/haven-niyah-engine

Repository files navigation

🛡️ HAVEN — The Sovereign Algorithm

Saudi Arabia's First Sovereign AI Development Environment

License: AGPL v3 TypeScript React 19 Ollama Zero Telemetry Made in Riyadh

الخوارزمية دائماً تعود للوطن The Algorithm Always Returns Home

Live Demo · Website · YouTube · X/Twitter


🧠 Architecture: Three-Lobe Engine

                    ┌─────────────────────┐
                    │   USER INPUT        │
                    └──────────┬──────────┘
                               │
                    ┌──────────▼──────────┐
                    │   SENSORY LOBE      │
                    │   ─────────────     │
                    │   • Arabic NLP      │
                    │   • 2,976 word forms │
                    │   • Dialect detect  │
                    │   • Intent scoring  │
                    └──────────┬──────────┘
                               │
              ┌────────────────┼────────────────┐
              │                │                │
    ┌─────────▼─────┐  ┌──────▼──────┐  ┌──────▼──────┐
    │ EXECUTIVE     │  │ COGNITIVE   │  │ OLLAMA      │
    │ ────────      │  │ ─────────   │  │ (Local)     │
    │ Model routing │  │ Anti-halluc │  │ niyah:v3    │
    │ Tier select   │  │ Confidence  │  │ deepseek-r1 │
    │ Fallback chain│  │ Memory      │  │ llama3.2    │
    └───────────────┘  └─────────────┘  └─────────────┘

⚡ Quick Start

# Clone
git clone https://github.com/Grar00t/haven-sovereign.git
cd haven-sovereign

# Install
npm install

# Run (development)
npm run dev
# → http://localhost:5173

# Build (production)
npm run build

🏗️ Components

Component Lines Description
NiyahEngine v3 949 Core AI orchestration — Three-Lobe Architecture
SovereignBridge 953 QEMU sandboxing, process isolation, IPC
SovereignSessionCleaner 534 AES-256-GCM encrypted session management
CacheAndGraphImprovements 988 LRU Cache (256) + Intent Graph (100 sessions)
arabic-roots-expanded 1,548 2,976 Arabic word forms, 283 roots
useNiyah.tsx 305 React hook with SSE streaming
niyah-route.ts 164 Next.js/Express API handlers
i18n.ts 1,744 10-language support (Arabic-first)
Tests 1,211 102 tests across 15 suites

Total: 8,395+ lines of production TypeScript

🆚 Comparison

Feature HAVEN VSCode Cursor Copilot
Zero Telemetry
Local AI (Ollama)
Arabic NLP
Gulf Dialect
Multi-Model (11)
Offline Mode
Open Source Partial
Fraud Detection
Sovereign OS
PDPL Compliant

🇸🇦 بالعربي

خوارزم هو أول نظام بيئي سيادي للذكاء الاصطناعي من السعودية.

  • HAVEN IDE — بيئة تطوير متكاملة تعمل محلياً بالكامل
  • محرك النية (NiyahEngine) — معمارية ثلاثية الفصوص للذكاء الاصطناعي
  • KhawrizmOS — نظام تشغيل سيادي ARM64

صفر تتبع. صفر سحابة. سيادة كاملة.

🔒 Security

  • AES-256-GCM session encryption
  • Zero telemetry (no data leaves your machine)
  • Phalanx Gate zero-trust firewall
  • QEMU sandboxing for untrusted processes
  • PDPL (Saudi Data Protection) compliant
  • NCA-ECC compatible

📜 License

AGPL-3.0 — see LICENSE

Commercial license available for enterprises: contact@khawrizm.com

🔗 Links


Built by Sulaiman Alshammari (Dragon403) in Riyadh, Saudi Arabia

From Baghdad's House of Wisdom (820 AD) to Riyadh's Sovereign AI (2026)

الخوارزمية دائماً تعود للوطن 🇸🇦

About

NIYAH Engine v3 — Sovereign AI Engine for HAVEN IDE. Three-Lobe Architecture, Arabic NLP, Multi-Model Orchestration. Built by Sulaiman Alshammari (Dragon403). الخوارزمية دائماً تعود للوطن

Topics

Resources

License

Stars

Watchers

Forks

Packages