An LLM-Powered Intelligent Assistant for Learning Management Systems Using RAG and NL2SQL Pipelines
Abstract
Learning Management Systems accumulate heterogeneous data comprising unstructured course documents and structured relational databases, yet most existing tools address only one data type, limiting accessibility for non-technical users. This paper proposes a dual-pipeline large language model assistant that integrates a Retrieval-Augmented Generation pipeline for document queries with a Natural Language to SQL pipeline for database interaction. The RAG pipeline deploys Phi 3.5 and nomic-embed-text entirely on local hardware to ensure institutional data privacy, while Google Gemini generates SQL from schema metadata only. Semantic chunking based on embeddingsimilarity thresholds replaces fixed character splitting, and a lightweight generate-validate-execute-correct mechanism handles SQL failures. Evaluation using the RAGAS framework shows that semantic chunking improves answer relevancy by +0.1345 over fixed splitting. Testing on the BIRD-MINIDEV benchmark yields a $\mathbf{1 0. 5 3} \boldsymbol{\%}$ relative improvement in execution accuracy with 100% valid SQL generation. The proposed system offers a practical, privacy-compliant solution suitable for institutional deployment without large-scale infrastructure.