File size: 2,230 Bytes
d7256a9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# QUS-AI Project Structure

This document outlines the modular architecture of the QUS-AI Islamic Alignment Framework (v2).

```text
QUS-AI/
β”œβ”€β”€ qusai_core/                 # [CORE PACKAGE] Main framework logic
β”‚   β”œβ”€β”€ __init__.py             # Package definition
β”‚   β”œβ”€β”€ alignment/              # [MIZAN] Alignment & Safety Logic
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   └── mizan.py            # The 5-point Salat Validation Checkpoints
β”‚   β”œβ”€β”€ ontology/               # [TAWHID] Knowledge Graph Engine
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   └── engine.py           # RDF loading, traversing, and context lookup
β”‚   β”œβ”€β”€ llm/                    # [AKL] Model Abstraction Layer
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   └── loader.py           # HuggingFace/Torch loader (CPU/GPU agnostic)
β”‚   β”œβ”€β”€ pipeline/               # [AMAL] Execution Pipeline
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   └── middleware.py       # Connects Input -> Validator -> Ontology -> Model
β”‚   └── utils/                  # Shared utilities
β”‚       β”œβ”€β”€ __init__.py
β”‚       └── constants.py        # URI Namespaces (ALIGN, QURAN, ROOT) and Paths
β”‚
β”œβ”€β”€ data/                       # [DATA] Ontologies and Rules
β”‚   β”œβ”€β”€ quran_root_ontology_v3.ttl   # The main RDF Knowledge Graph
β”‚   └── quranic_grammar_rules.json   # JSON-based grammar logic
β”‚
β”œβ”€β”€ docs/                       # Project Documentation
β”‚   β”œβ”€β”€ 00_axioms.md
β”‚   β”œβ”€β”€ README_V2.md
β”‚   └── ...
β”‚
β”œβ”€β”€ qusai_app.py                # [ENTRY] Main Gradio Application Entry Point
β”œβ”€β”€ requirements.txt            # Python dependencies
└── README.md                   # GitHub landing page & HF Metadata
```

## Key Directory Descriptions

- **`qusai_core/`**: This is the heart of the application. It is designed to be portable. You can copy this folder into any other Python project to give it "Quranic Alignment" capabilities.
- **`data/`**: specific data files loaded by `ontology/engine.py`.
- **`qusai_app.py`**: A lightweight wrapper that initializes `qusai_core.pipeline.middleware` and launches the UI.