A Cross-Platform Multilingual LLM & Retrieval-Augmented Generation System for Drug Addiction Awareness, Prevention, and Recovery Support in Algeria.
Amal (Arabic for "Hope") is an AI-powered platform providing:
- Multilingual support (Arabic, French, Darija, English)
- Intent classification using MarBERT
- RAG-based scientific information retrieval
- Crisis intervention with 3033 hotline integration
- Web and mobile applications
┌─────────────────────────────────────────────────────────────────┐
│ User Interface │
│ ┌──────────────────┐ ┌──────────────────────────┐ │
│ │ Web Frontend │ │ Mobile Application │ │
│ │ React + Vite │ │ React Native + Expo │ │
│ │ TypeScript │ │ TypeScript │ │
│ │ Tailwind CSS │ │ React Navigation │ │
│ │ Zustand │ │ Zustand + AsyncStorage │ │
│ └────────┬─────────┘ └───────────┬──────────────┘ │
└───────────┼────────────────────────────────────┼────────────────┘
│ REST API │
└──────────────────┬─────────────────┘
│
┌──────────────────────────────▼──────────────────────────────────┐
│ Backend API (FastAPI) │
│ Port: 8000 │
│ ┌────────────────────────────────────────────────────────────┐ │
│ │ Amal Orchestrator │ │
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ │ │
│ │ │ Intent │ │ RAG │ │ Support │ │ │
│ │ │ Classifier │ │ Scientific │ │ Model │ │ │
│ │ │ MarBERT │ │ ChromaDB │ │ Qwen2.5-7B │ │ │
│ │ │ + OOD Det. │ │ + Gemini │ │ + LoRA │ │ │
│ │ └──────────────┘ └──────────────┘ └──────────────────┘ │ │
│ └────────────────────────────────────────────────────────────┘ │
│ ┌────────────────────────────────────────────────────────────┐ │
│ │ Authentication (JWT) │ │
│ └────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
│
┌──────────────────────────────▼──────────────────────────────────┐
│ Database (PostgreSQL) │
│ Users, Conversations, Messages │
└─────────────────────────────────────────────────────────────────┘
This repository is organized into separate branches for each component:
| Branch | Description | Tech Stack |
|---|---|---|
main |
Complete project with all components | - |
frontend |
React web application | React, TypeScript, Vite, Tailwind |
mobile |
React Native mobile app | React Native, Expo, TypeScript |
backend |
FastAPI server | Python, FastAPI, JWT |
intent_model |
Intent classification | MarBERT, PyTorch, Transformers |
rag_scientific |
RAG system | ChromaDB, Gemini, Sentence Transformers |
model_support |
Support model | Qwen2.5-7B, LoRA, PEFT |
database |
PostgreSQL schema | PostgreSQL, Docker |
- Python >= 3.10
- Node.js >= 18.0
- npm >= 9.0
- (Optional) GPU with 8GB+ VRAM for support model
git clone https://github.com/Samir-Guenchi/Amal.git
cd Amal# Install Python dependencies
pip install -r requirements.txt
# Set up environment variables
cp backend/.env.example backend/.env
# Edit .env with your API keys
# Start the backend server
cd backend
python server.pyBackend runs at http://localhost:8000
cd frontend
npm install
npm run devFrontend runs at http://localhost:3000
cd mobile
npm install
# Update API URL in src/services/api.ts with your computer's IP
npx expo startScan QR code with Expo Go app on your phone.
Each component has its own README and LaTeX technical report:
- README.md - Installation and usage guide
- docs/report.tex - Framework selection justification (React, Vite, Tailwind, Zustand)
- requirements.txt - Dependencies
- README.md - API documentation
- docs/report.tex - Architecture report (FastAPI, JWT, Orchestrator pattern)
- requirements.txt - Python dependencies
- README.md - Setup guide for Android/iOS
- docs/report.tex - React Native + Expo justification
- requirements.txt - Dependencies
- README.md - Model architecture and usage
- docs/report.tex - MarBERT + OOD detection methodology
- requirements.txt - ML dependencies
- README.md - RAG system documentation
- docs/report.tex - ChromaDB + Gemini architecture
- requirements.txt - Dependencies
- README.md - Qwen2.5 + LoRA setup
- docs/report.tex - Fine-tuning methodology
- requirements.txt - GPU requirements
- README.md - Schema documentation
- docs/report.tex - PostgreSQL design decisions
- docker-compose.yml - Docker setup
| Feature | Status | Description |
|---|---|---|
| Intent Classification | ✅ | MarBERT + OOD detection |
| RAG Scientific | ✅ | ChromaDB + Gemini |
| Support Model | 🔄 | Qwen2.5-7B (in development) |
| Web Frontend | ✅ | React + TypeScript |
| Mobile App | ✅ | React Native + Expo |
| Authentication | ✅ | JWT-based auth |
| Multilingual | ✅ | AR, FR, DZ, EN |
| Database | ✅ | PostgreSQL schema |
| Endpoint | Method | Description |
|---|---|---|
/chat |
POST | Send message to AI |
/health |
GET | Check server status |
| Endpoint | Method | Description |
|---|---|---|
/auth/signup |
POST | Register user |
/auth/login |
POST | User login |
/auth/forgot-password |
POST | Password reset request |
/auth/reset-password |
POST | Reset password |
/auth/refresh |
POST | Refresh access token |
/auth/me |
GET | Get current user |
User Query
│
▼
┌─────────────────┐
│ Language Detect │ → ar, fr, en, dz
└────────┬────────┘
│
▼
┌─────────────────┐
│ OOD Detection │ → Out of context?
└────────┬────────┘
│
┌────┴────┬────────────┬──────────────┐
▼ ▼ ▼ ▼
Out of Harm Exact Fact Looking for
Context │ │ Support
│ │ │ │
▼ ▼ ▼ ▼
Polite Crisis RAG Support
Rejection Response Scientific Model
(3033) (Gemini) (Qwen2.5)
| Code | Language | Script |
|---|---|---|
ar |
Arabic | العربية |
fr |
French | Français |
dz |
Darija | الدارجة الجزائرية |
en |
English | English |
If you or someone you know is struggling with addiction:
📞 3033 - Free, confidential helpline available 24/7
Each component includes a LaTeX technical report suitable for academic publication:
frontend/docs/report.tex- Web Frontend Architecturebackend/docs/report.tex- API Server Designmobile/docs/report.tex- Mobile Application Developmentintent_model/docs/report.tex- Intent Classification with MarBERTrag_scientific/docs/report.tex- RAG for Drug Informationmodel_support/docs/report.tex- Empathetic Support Modeldatabase/docs/report.tex- Database Schema Design
Compile with: pdflatex report.tex
- Fork the repository
- Create a feature branch from the relevant component branch
- Make your changes
- Submit a pull request
MIT License - See LICENSE file for details.
Samir Guenchi
Amal - Bringing hope through technology