Downloads · 30 days
0
ShahadAljohani/ALLAM-based-Retrieval-Augmented-Generation-Arabic-Conversational-Alzheimer-Assistance
ALLAM-based-Retrieval-Augmented-Generation-Arabic-Conversational-Alzheimer-Assistance is a machine learning model from ShahadAljohani. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as cc-by-4.0.
Downloads · 30 days
0
Access
Public
Updated Oct 13, 2026
Repo size
2.6 MB
Likes
15
Trending 2
Click a slice to open those files.
.png2.7 MB · 77%
From the Hugging Face model README

ALLaM-RAG is a Saudi Arabic conversational AI system that combines Retrieval-Augmented Generation (RAG) with the ALLaM Large Language Model to provide context-aware assistance for Alzheimer's patients and caregivers.
The system retrieves relevant information from specialized knowledge bases using hybrid vector search and reranking before generating accurate, personalized responses through the ALLaM language model.
The system supports two knowledge domains: Alzheimer's patient support and general Saudi Arabic knowledge.
User Query
│
▼
Arabic Text Normalization
│
▼
Query Classification
│
▼
Knowledge Base Selection
│
▼
Weaviate Hybrid Search
│
▼
Cohere Reranker
│
▼
Relevant Context
│
▼
ALLaM Language Model
│
▼
Generated Response
The system utilizes two specialized knowledge bases.
The Alzheimer's knowledge base is built from a Saudi Arabic conversational dataset focused on patient-oriented interactions and support.
It contains information related to:
The original source dataset is the Saudi-Arabic-Alzheimers-Conversational-Dataset-Parameterized, containing parameterized Saudi Arabic question-answer examples. The dataset was a part of the graduation project: AlzCare in Taibah University.
The GeneralQA knowledge base provides Saudi Arabic information across general domains, including:
Separating the knowledge bases allows the system to retrieve information from the domain most relevant to the user's query.
The retrieval pipeline consists of:
The retrieval stage combines semantic and keyword-based search before reranking the retrieved candidates to identify the most relevant context for generation.
The system was evaluated using question-answer examples from both the AlzheimerQA and GeneralQA datasets.
The evaluation measures both retrieval quality and the quality of the final generated answers.
| Metric | Score |
|---|---|
| Recall@3 | 79.4% |
| Recall@5 | 86.8% |
| Precision@5 | 81.2% |
| MRR | 77.9% |
| nDCG@5 | 83.5% |
These metrics evaluate how effectively the retrieval pipeline identifies relevant information and ranks it among the retrieved results.
The generated responses were evaluated using RAGAS-based metrics:
| Metric | Score |
|---|---|
| Answer Relevance | 87.3% |
| Faithfulness | 91.1% |
| Context Precision | 84.6% |
| Context Recall | 88.2% |
| Overall RAG Evaluation | 82.7% |
The results indicate that the retrieved context generally provides relevant and sufficiently grounded information for response generation.
The RAG-based system was also compared with alternative configurations:
| Configuration | Overall Score |
|---|---|
| ALLaM-RAG | 82.7% |
| GPT Baseline | 75.2% |
| Baseline Retriever | 68.9% |
| ALLaM without RAG | 61.4% |
The comparison demonstrates the contribution of retrieval to the overall system performance, with the ALLaM-RAG configuration achieving the highest evaluation score among the tested configurations.
The query classification component was evaluated separately to determine whether incoming questions were correctly classified before selecting the corresponding knowledge base.
The classifier achieved:
This classification step supports routing between the Alzheimer's and GeneralQA knowledge bases.
The evaluation data contains examples from both system domains:
Evaluation Dataset
│
├── AlzheimerQA
│ └── alz_* question IDs
│
└── GeneralQA
└── GeneralQA examples
The evaluation covers both retrieval and answer generation rather than evaluating only the final generated response.
The system can also respond to general Saudi Arabic questions using the GeneralQA knowledge base.
app.py
chatbot.py
rag_pipeline.py
weaviate_server.py
requirements.txt
README.md
Install dependencies:
pip install -r requirements.txt
Configure the required environment variables:
Launch the application:
python app.py

The project is designed for deployment using:
The model and project resources are hosted through Hugging Face, while Weaviate provides the retrieval infrastructure and Cohere provides multilingual reranking.

The evaluation demonstrates the effectiveness of combining retrieval with ALLaM generation:
The ALLaM-RAG configuration achieved 82.7%, compared with 61.4% for ALLaM without RAG.
Shahad Aljohani
Computer Science Graduate
This repository contains a public research version.
Private implementation details, API keys, deployment configurations, and some internal pipeline components are excluded.
The complete implementation is maintained privately.