# AI Module — Full Technical Reference

## Overview
Enterprise AI Governance & Enablement Platform for SALIHIN. Comprises a **CodeIgniter 3/PHP/MySQL portal** (AI Hub, Prompt Library, Knowledge Repository, Governance, Learning Pathways, AI Assistant).

---

---



## CI3 Portal (`spsdev1/`)

### Controller
- `application/controllers/Drezoc.php` — Routes all AI Hub + Prompt pages via `_remap()`, supports aliases
- `application/controllers/Learning.php` — LMS courses/assessments + `assistant_query()` AJAX endpoint

### Models
- `application/models/Sps_portal_model.php` — `get_prompts()`, `get_ai_tool_categories()`, `get_ai_tools()`
- `application/models/Lms_model.php` — `search_knowledge_base()`, course/lesson/assessment queries

### Pages

| Route | View | Purpose |
|-------|------|---------|
| `/drezoc/ai-hub` | `pages/ai-hub.php` | Central AI dashboard: 21 tools across 7 categories + pillar sections |
| `/drezoc/ai-approved-tools` | `pages/ai-approved-tools.php` | Full searchable AI tools catalog |
| `/drezoc/ai-knowledge` | `pages/ai-knowledge.php` | 50+ KB articles, 6 categories + scripts |
| `/drezoc/ai-governance` | `pages/ai-governance.php` | Policies, principles, compliance + scripts |
| `/drezoc/ai-learning` | `pages/ai-learning.php` | 4-level upskilling + certification + scripts |
| `/drezoc/prompt-library` | `pages/prompt-library.php` | Browse 33 hardcoded + DB prompts |
| `/drezoc/prompt-contribute` | `pages/prompt-contribute.php` | Submit form (10 platforms, 8 categories, image upload) |
| `/drezoc/prompt-profile` | `pages/prompt-profile.php` | Badge system + submission history |
| `/drezoc/prompt-admin` | `pages/prompt-admin.php` | Filter/approve/reject panel |

### Aliases
- `prompts` → `prompt-library`
- `share-prompt` → `prompt-contribute`
- `my-badges` → `prompt-profile`
- `review` → `prompt-admin`

### Page Scripts (JS)
- `page_scripts/ai-knowledge.php` — Knowledge base search, filter, modal
- `page_scripts/ai-governance.php` — Governance search, filter, modal
- `page_scripts/ai-learning.php` — Learning pathway filter, modal
- `page_scripts/prompt-library.php` — Prompt search, filter, copy, modal

### Key Files
- `application/config/drezoc.php` — page meta config
- `application/views/drezoc/partials/sidebar.php` — sidebar navigation links
- `assets/drezoc/css/sps-prompt-library.css` — prompt page styles
- `assets/drezoc/images/logo-salihin.png` — logo (500×500, transparent)
- `sql/` — MySQL schema init scripts

---

## AI Hub Approved Tools

21 tools across 7 categories:
| Category | Tools |
|----------|-------|
| AI Platforms & Meeting | ChatGPT Enterprise, Claude, Perplexity, Microsoft Copilot, Zoom AI Companion |
| Document Management | Document AI, Notion AI, Lexion |
| Graphic Design | Canva, Adobe Firefly |
| Client Info Search | 3E, Foundation, Kira Systems, Luminance |
| Writing & Language | Grammarly, DeepL, Otter.ai |
| Collaboration Tools | Miro AI, Asana Intelligence |
| Digital Assistant | Power Automate, Sisense AI |

## AI Knowledge Repository

50+ articles across 6 categories:
- **Tool Guides** — ChatGPT, Claude, Perplexity, Copilot, Zoom, Canva, Notion, Grammarly, Otter
- **Prompt Engineering** — RISE framework, EMAIL framework, meeting summaries, board minutes, tax research, audit, etc.
- **Governance** — Acceptable Use Policy, Data Privacy, Output Verification, Vendor Assessment
- **Use Cases** — Board minutes, due diligence, audit testing, marketing copy, HR policies
- **Learning Resources** — Prompt engineering guides, governance training, community
- **FAQ** — Data privacy, hallucination, approved tools, support

## AI Governance Framework

- **5 Policies**: Acceptable Use, Data Privacy, Output Verification, Vendor Assessment, Incident Response
- **6 Principles**: Human Oversight, Transparency, Fairness, Accountability, Privacy, Reliability
- **7 Guidelines**: Do's & Don'ts, Secure Prompt Writing, Tool Selection, Vendor Assessment, etc.
- **4 Training Modules**: Mandatory Awareness, Champions Program, Tool Mastery, Industry-Specific
- **4 Audit Areas**: Quarterly Reviews, Self-Assessment, Incident Reporting, Compliance

## Learning Pathways (AI Upskilling)

| Level | Topic | Duration |
|-------|-------|----------|
| 1 | AI Awareness | 50 min |
| 2 | Prompt Writing (RISE Framework) | 75 min |
| 3 | Responsible AI / Governance | 60 min |
| 4 | Workflow Automation | 120 min (Q3 2026) |
| — | AI Foundations Certificate | 60-question exam |

## AI Assistant

`controllers/Learning.php::assistant_query()` — AJAX endpoint:
1. Checks keyword-based system answers
2. Falls back to `Lms_model->search_knowledge_base()`
3. Returns JSON `{ results, system_answer }`

## Data Storage
- **CI3:** MySQL (`prompts`, `ai_tools`, `ai_tool_categories` tables) + localStorage (`sps_prompt_contributions`)

Each submission:
```js
{
  id: integer,
  title: "string",
  category: "Writing & Content",
  platform: "ChatGPT",
  author: "Name",
  prompt: "full prompt text",
  outputDesc: "result description",
  image: "data:image/... or URL",
  status: "pending" | "approved" | "rejected",
  likes: 0,
  liked: false,
  timestamp: "Jul 8, 2026"
}
```

---

## Badge System (Gaming Style)

| Rank | Approved | Icon | 
|------|----------|------|
| Noob | 1 | 🥚 |
| Grinder | 5 | 🗡️ |
| Warrior | 10 | 🛡️ |
| Elite | 25 | ⚔️ |
| Champion | 50 | 🏆 |
| Legendary | 100 | 👑 |

Stored in: `profile.html:BADGES` / `page_scripts/prompt-profile.php:BADGES`

---

## Workflow
1. User submits prompt → `status: "pending"` (via API)
2. Admin reviews on admin page → approves/rejects (via API)
3. User checks profile page → sees earned badges + progress to next
4. Approved prompts visible in browse with "approved" badge

---

## Logo
- Source: LinkedIn SALIHIN company logo
- Processing: background removed (white → transparent), upscaled to 500×500, centered on transparent canvas
- Files: `logo.png` (standalone), `logo-salihin.png` (CI3)

---

## Quick Serve
```bash
# CI3 (requires PHP/MySQL)
# Point web root to spsdev1/ and access /drezoc/prompt-library
```
