Khazanah Journal of Religion and Technology
Vol. 3 No. 2 (2025): December

Islamic Chatbot Based on Reinforcement Learning Using Q-Learning Algorithm

Hamza, Aria Octavian (Unknown)
Denis Firmansyah (Unknown)
Abidzar Giffari (Unknown)
Aisyah Muthmainnah (Unknown)
Adil Zukhruf Firdaus (Unknown)



Article Info

Publish Date
08 Mar 2026

Abstract

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.

Copyrights © 2025






Journal Info

Abbrev

kjrt

Publisher

Subject

Religion Humanities Computer Science & IT Engineering Social Sciences

Description

The Khazanah Journal of Religion and Technology is dedicated to advancing the understanding of the complex relationship between religion and technology. The journal aims to serve as a platform for publishing original research that explores the intersection of these two domains, focusing on recent ...