A lightweight and explainable conversational AI framework for natural language SQL learning without large language models
Natural language interfaces are increasingly used to support programming education and database interaction. However, many recent Text-to-SQL systems rely heavily on Large Language Models (LLMs), which require substantial computational resources and often operate as opaque black-box models. This paper presents a lightweight conversational AI system that helps beginners learn SQL through interactive, natural language conversations. The proposed chatbot uses natural language to create and execute SQL database queries without using Large Language Models (LLMs). The proposed system is a blend of rule-based dialogue management and machine learning that provides interpretability in natural language to SQL translation. The proposed chatbot was developed using the Rasa framework that employs a Dual Intent and Entity Transformer (DIET) as an intent recognition classifier and a hybrid entity extraction pipeline that merges statistical modeling with regex-based pattern matching. The proposed system facilitates create, read, update, and delete (CRUD) database interactions using natural language and integrates multilayer error management. The proposed system consumes fewer resources in contrast to the LLM-based methods that require powerful computing resources. An experimental test that used more than 500 labeled examples reported that the system has 92.68% intent recognition and 98.30% entity extraction accuracy. Similarly, SQL query generation accuracy was evaluated using 100 natural language queries, and the system achieved 90.0% overall accuracy. These results reveal that lightweight interpretable systems can be as effective or more effective at SQL query generation.
Authors
- Kaneeka Vidanage (ORCID: https://orcid.org/0000-0002-1923-9084)
- Dr.Smita Nirkhi
- Bahasuru Nayanakantha
- Sabyasachi Bhattacharyya
Institutions
- Indian Institute of Technology Guwahati (IN)
- General Sir John Kotelawala Defence University (LK)
- Symbiosis International University (IN)
Publication Details
- Journal
- Scientific Reports
- Published
- 2026-09-12
- DOI
- https://doi.org/10.1038/s41598-026-70120-5
- Primary Topic
- Topic Modeling
- Type
- article
- Field-Weighted Citation Impact
- 0.00