Islamic Chatbot Based on Reinforcement Learning Using Q-Learning Algorithm - Aria Octavian Hamza; Denis Firmansyah; Abidzar Giffari; Aisyah Muthmainnah; Adil Zukhruf Firdaus (Asosiasi Khazanah Cendekia, 2025)
This study develops a retrieval-based chatbot using a Reinforcement Learning (RL) approach with a Q-Learning algorithm combined with a Sentence-Transformer (SBERT) model to understand the semantic context of user questions. The system is designed to map questions into vector representations, calculate meaning similarity with training data, and select answers based on learned Q-values. The dataset used consists of question-answer pairs in JSON format. The training process is carried out in a question-and-answer simulation environment, where the RL agent is rewarded based on the suitability of the selected answer. Test results show that the chatbot is able to provide relevant and contextual responses even though the sentence structure differs from the training data. To improve accessibility, the system is packaged as a REST API using Flask and integrated into a Flutter-based mobile application as a user interface. This approach has proven to be efficient and computationally lightweight, and offers a promising alternative for developing responsive retrieval-based educational chatbots.