Implementation of Retrieval-Augmented Generation (RAG) and Large Language Models (LLM) for a Document and Tabular-Based Chatbot System

Main Article Content

Imam Chalish Rafidhul Haque

Abstract

The challenge of accessing information from disparate sources—unstructured documents and structured tabular data—hinders efficiency in enterprise information systems. This study addresses this challenge by presenting the design, implementation, and validation of a unified chatbot system powered by Retrieval-Augmented Generation (RAG) and Large Language Models (LLM). For unstructured documents, the system implements a RAG pipeline utilizing ChromaDB for vector indexing and OpenAI embeddings. Meanwhile, for structured data, it leverages a Text-to-SQL engine to translate natural language queries into SQL commands, with results visualized via QuickChart. The architecture is built upon a modular FastAPI backend with role-based access control and was rigorously validated through blackbox functional testing. Results demonstrate 100% functional success across all endpoints, confirming the architecture's reliability. This study confirms the viability of a unified RAG and Text-to-SQL architecture, offering a practical blueprint for creating more intelligent and integrated data interaction systems in enterprise environments.

Article Details

How to Cite
Rafidhul Haque, I. C. (2025). Implementation of Retrieval-Augmented Generation (RAG) and Large Language Models (LLM) for a Document and Tabular-Based Chatbot System. Journal of Electronics Technology Exploration, 3(1), 19 - 23. https://doi.org/10.52465/joetex.v3i1.588
Section
Articles

References

A. Vaswani and others, “Attention is all you need,” in Advances in Neural Information Processing Systems, 2017, pp. 5998–6008.

T. B. Brown and others, “Language models are few-shot learners,” in Advances in Neural Information Processing Systems, 2020, pp. 1877–1901.

J. Ji and others, “Survey of hallucination in natural language generation,” ACM Comput. Surv., vol. 55, no. 12, pp. 1–38, 2023, doi: 10.1145/3571730.

P. Lewis and others, “Retrieval-augmented generation for knowledge-intensive NLP tasks,” in Advances in Neural Information Processing Systems, 2020, pp. 9459–9474.

K. Guu and others, “Retrieval augmented language model pre-training,” in Proceedings of the 37th International Conference on Machine Learning, 2020, pp. 3929–3938.

A. Asai and others, “Self-RAG: Learning to retrieve, generate, and critique through self-reflection,” in Proceedings of the International Conference on Learning Representations, 2024.

T. Yu and others, “Spider: A large-scale human-labeled dataset for complex and cross-domain text-to-SQL task,” in Proceedings of the Conference on Empirical Methods in Natural Language Processing, 2018, pp. 3911–3921.

B. Li and others, “A survey on text-to-SQL: Concepts, methods, and future directions,” in Proceedings of the 29th International Conference on Computational Linguistics, 2022, pp. 6876–6888.

A. D. Dwivedi, G. Srivastava, S. Dhar, and R. Singh, “A decentralized privacy-preserving healthcare blockchain for IoT,” Sensors (Switzerland), vol. 19, no. 2, pp. 1–17, 2019, doi: 10.3390/s19020326.

J. Scholak and others, “Picard: Parsing incrementally for constrained auto-regressive decoding from language models,” in Proceedings of the Conference on Empirical Methods in Natural Language Processing, 2021, pp. 9546–9559.

R. Vinayakumar, M. Alazab, K. P. Soman, P. Poornachandran, A. Al-Nemrat, and S. Venkatraman, “Deep Learning Approach for Intelligent Intrusion Detection System,” IEEE Access, vol. 7, pp. 41525–41550, 2019, doi: 10.1109/ACCESS.2019.2895334.

G. Nguyen et al., “Machine Learning and Deep Learning frameworks and libraries for large-scale data mining: a survey,” Artif. Intell. Rev., vol. 52, no. 1, pp. 77–124, 2019, doi: 10.1007/s10462-018-09679-z.

J. R. Saura, B. R. Herraez, and A. Reyes-Menendez, “Comparing a traditional approach for financial brand communication analysis with a big data analytics technique,” IEEE Access, vol. 7, pp. 37100–37108, 2019, doi: 10.1109/ACCESS.2019.2905301.

A. Følstad and P. B. Brandtzæg, “Chatbots and the new world of HCI,” Interactions, vol. 24, no. 4, pp. 38–42, 2017, doi: 10.1145/3085558.

C. Shang and F. You, “Data Analytics and Machine Learning for Smart Process Manufacturing: Recent Advances and Perspectives in the Big Data Era,” Engineering, vol. 5, no. 6, pp. 1010–1016, 2019, doi: 10.1016/j.eng.2019.01.019.

ChromaDB, “Chroma - The AI-native open-source embedding database.” 2023.

S. R. Montoliu, “FastAPI Documentation.” 2023.

OpenAI, “New and improved embedding model.” 2022.

G. J. Myers, C. Sandler, and T. Badgett, The Art of Software Testing, 3rd ed. Hoboken, NJ, USA: John Wiley & Sons, 2012.

Abstract viewed = 261 times