AqlHR: Saudi Arabia's First
Agentic RAG AI Platform
for Human Resources
A comprehensive technical overview of the architecture, capabilities, and compliance features that make AqlHR the most advanced HR management platform designed specifically for the Saudi Arabian market.
Executive Summary
AqlHR represents a paradigm shift in human resources management for Saudi Arabian enterprises. Built from the ground up with Saudi Labor Law compliance at its core, AqlHR combines cutting-edge Retrieval-Augmented Generation (RAG) artificial intelligence with comprehensive HR workflow automation to deliver an intelligent, compliant, and efficient HR management experience.
The platform addresses the unique challenges faced by HR professionals in Saudi Arabia, including Saudization requirements (Nitaqat), Wage Protection System (WPS) compliance, GOSI calculations, and seamless integration with government portals such as Qiwa, Mudad, and Absher.
With over 883 features implemented across 28 development phases, AqlHR provides end-to-end HR management capabilities including employee lifecycle management, payroll processing, attendance tracking, document generation, and AI-powered HR assistance.
Platform Architecture
Technology Stack
Frontend
- React 19 with TypeScript
- Tailwind CSS 4 with RTL Support
- shadcn/ui Component Library
- Wouter for Client-Side Routing
- TanStack Query for Data Fetching
Backend
- Express.js 4 with Node.js 22
- tRPC 11 for Type-Safe APIs
- Drizzle ORM with MySQL/TiDB
- JWT-Based Authentication
- S3-Compatible File Storage
System Architecture Diagram
┌─────────────────────────────────────────────────────────────────────┐
│ CLIENT LAYER │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ React 19 │ │ Tailwind 4 │ │ shadcn/ui │ │ Wouter │ │
│ │ TypeScript │ │ RTL/Arabic │ │ Components │ │ Router │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
│
tRPC Client
│
┌─────────────────────────────────────────────────────────────────────┐
│ API LAYER │
│ ┌─────────────────────────────────────────────────────────────────┐│
│ │ tRPC Router (Type-Safe) ││
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ││
│ │ │ Auth │ │ Employee │ │ Payroll │ │ Chat │ ... ││
│ │ │ Router │ │ Router │ │ Router │ │ Router │ ││
│ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ ││
│ └─────────────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────────────┘
│
┌─────────────────────────────────────────────────────────────────────┐
│ SERVICE LAYER │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ LLM/RAG │ │ Document │ │ Notification│ │ Storage │ │
│ │ Service │ │ Generator │ │ Service │ │ Service │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
│
┌─────────────────────────────────────────────────────────────────────┐
│ DATA LAYER │
│ ┌─────────────────────┐ ┌─────────────────────┐ │
│ │ MySQL / TiDB │ │ S3 Storage │ │
│ │ (Drizzle ORM) │ │ (Documents) │ │
│ └─────────────────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
Agentic RAG AI Technology
What is Agentic RAG?
Retrieval-Augmented Generation (RAG) is an AI architecture that combines the power of large language models with domain-specific knowledge retrieval. AqlHR's implementation goes beyond traditional RAG by incorporating "agentic" capabilities, meaning the AI can autonomously decide which knowledge sources to query, how to synthesize information, and when to escalate to human experts.
This approach ensures that every response from the AqlHR AI Assistant is grounded in authoritative Saudi labor law sources, HRSD regulations, and company-specific policies, eliminating the hallucination problems common in general-purpose AI systems.
Knowledge Sources
- Saudi Labor Law - Royal Decree M/51, all 245 articles with amendments
- HRSD Regulations - 2025 leave policies, Nitaqat rules, WPS requirements
- GOSI Guidelines - Social insurance calculations, contribution rates
- 44+ Official Sources - Qiwa, Mudad, Absher documentation
AI Capabilities
- Legal Q&A - Instant answers to labor law questions with article citations
- Document Generation - AI-assisted creation of HR documents
- Policy Analysis - Compare company policies against regulations
- Bilingual Support - Full Arabic and English language support
Example AI Response
User: "ما هي مدة الإجازة السنوية حسب نظام العمل السعودي؟"
AI Response: تُحدد مدة الإجازة السنوية في نظام العمل السعودي (الصادر بالمرسوم الملكي رقم م/51) في المادة (109). يستحق العامل إجازة سنوية مدتها 21 يوماً بأجر كامل، وتزداد إلى 30 يوماً إذا أمضى العامل خمس سنوات متصلة في خدمة صاحب العمل.
Saudi Labor Law Compliance
AqlHR is designed from the ground up to ensure full compliance with Saudi Arabian labor regulations. Every feature, calculation, and workflow has been validated against the official Saudi Labor Law (Royal Decree M/51) and HRSD guidelines.
| Regulation | AqlHR Implementation | Status |
|---|---|---|
| Article 109 - Annual Leave | 21 days (basic), 30 days (5+ years) | ✓ Compliant |
| Article 117 - Medical Leave | 30 days 100%, 60 days 75%, 30 days unpaid | ✓ Compliant |
| GOSI Contributions | Employee 10%, Employer 12% | ✓ Compliant |
| Nitaqat (Saudization) | Real-time tracking and reporting | ✓ Compliant |
| WPS (Wage Protection) | Bank file export, payment tracking | ✓ Compliant |
| Work Week | Sunday-Thursday, 48 hours max | ✓ Compliant |
| Ramadan Hours | 6 hours/day for Muslim employees | ✓ Compliant |
Government Portal Integrations
قوى (Qiwa)
Ministry of Human Resources electronic services portal for labor market management
- Work permits
- Contract management
- Labor disputes
- Establishment services
مدد (Mudad)
Wage Protection System for salary payment compliance and tracking
- Salary file upload
- Payment verification
- Compliance reports
- Bank integration
التأمينات الاجتماعية (GOSI)
General Organization for Social Insurance contribution management
- Employee registration
- Contribution calculation
- Certificate requests
- Pension tracking
أبشر (Absher)
Government services platform for visa and residency management
- Iqama services
- Exit/re-entry
- Visa applications
- Status verification
Core Platform Modules
Employee Management
Complete employee lifecycle management with Saudi-specific fields including Iqama number, GOSI registration, nationality, and Saudization tracking.
Payroll Processing
Automated payroll calculation with GOSI deductions, allowances, overtime, and WPS-compliant bank file generation.
Attendance & Time
Daily attendance tracking with support for Saudi work week (Sunday-Thursday), overtime calculation, and Ramadan hours.
Document Generation
AI-powered generation of official HR documents with company letterhead and digital signatures.
Compliance & Governance
Real-time compliance monitoring for Nitaqat, WPS, GOSI, and other regulatory requirements.
AI Assistant
Intelligent HR assistant powered by RAG technology with comprehensive Saudi labor law knowledge.
Security & Data Privacy
Data Protection
- End-to-end encryption for all data in transit (TLS 1.3)
- AES-256 encryption for data at rest
- PDPL (Saudi Personal Data Protection Law) compliant
- Regular security audits and penetration testing
Access Control
- Role-Based Access Control (RBAC) with 5 role levels
- JWT-based authentication with secure session management
- Complete audit logging for all user actions
- IP-based access restrictions available
Tawasul E-Services System
The Tawasul (تواصل) system provides a comprehensive employee self-service portal with 58 different HR services organized into 10 categories. Each service follows a structured workflow with SLA tracking, multi-level approvals, and complete audit trails.
| Category | Services | Description |
|---|---|---|
| الإجازات (Leave) | 7 | Annual, sick, emergency, Haj, exam leave requests |
| شؤون الموظفين (Personnel) | 8 | Letters, certificates, contract amendments |
| المغادرة النهائية (Final Exit) | 4 | Resignation, termination, clearance |
| الإقامة والجواز (Iqama) | 4 | Iqama renewal, exit/re-entry, family visa |
| التنقلات (Transfers) | 4 | Site transfers, project assignments |
| إخلاء الطرف (Clearance) | 4 | Asset return, loan settlement, IT clearance |
| السلف والقروض (Loans) | 3 | Salary advance, loan requests |
| السكن (Housing) | 3 | Accommodation requests and maintenance |
| النقل (Transport) | 2 | Vehicle requests, transport allowance |
| التدريب (Training) | 2 | Training requests, certification |
Future Roadmap
- Complete Tawasul vacation workflows
- Loans & advances module
- Enhanced notification system
- Iqama & passport tracking
- Performance management cycles
- Mobile app (React Native)
- HRSD baseline data integration
- Advanced analytics dashboard
- Multi-company support
- Talent-Apex full integration
- AI-powered recruitment
- Predictive HR analytics
Conclusion
AqlHR represents the future of HR management in Saudi Arabia. By combining deep regulatory expertise with cutting-edge AI technology, the platform empowers HR professionals to focus on strategic initiatives while ensuring complete compliance with Saudi labor laws and government requirements.
With 883+ features already implemented and a clear roadmap for continued development, AqlHR is positioned to become the standard for HR management in the Kingdom, supporting Saudi Vision 2030's goals for workforce development and digital transformation.