Submitted:
05 July 2024
Posted:
05 July 2024
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. LLM Intelligent Chatbot with RAG
3. RAG Agent and VectorStore
4. Chatbot Features and Functionalities
4.1. Processing the Documents and Creating the Vector Store
- doc_store.json—this file contains the raw documents that have been loaded into the system. It serves as a repository of the original educational content, preserving the text and metadata associated with each document.
- index_store.json—it maintains the indexing information for the documents stored in the system. It includes the structures and mappings that allow for efficient searching and retrieval of documents based on their content.
- vector_store.json stores the high-dimensional vectors generated from the indexed documents. These vectors are created using an embedding technique, and they capture the semantic meaning of the documents. They are used for tasks such as similarity search and clustering.
4.2. Utilizing RAG to Augment the LLM
- Creation of the Chat Engine—this first step involves the creation of a chat engine using the createChatEngine() function. This engine is built with an OpenAI GPT-4 LLM, which forms the backbone of the chat system.
- User Message Processing—upon receiving a user message, the content is converted into a format that is compatible with the LlamaIndex and OpenAI. This conversion is crucial for ensuring that the input is appropriately structured for both the retrieval and generation processes. The formatted message serves as the basis for querying the vector store and generating relevant responses.
- Retrieving and generating responses—the core functionality of the chatbot is realized through the invocation of LlamaIndex’s chatEngine.chat() function. This method leverages the RAG approach by first retrieving relevant information from the vector store based on the user’s query. The retrieved information is then used to generate a coherent and contextually appropriate response using the GPT-4 model. This function is designed to stream the response in real-time, enhancing the interactivity of the Chatbot.
- Streaming the response—the stream generated by the chat engine is consumed by the front-end client. This allows for real-time interaction with the user, providing them with immediate feedback and responses.
- Piping the LlamaIndexStream to Response—finally, the LlamaIndexStream is piped to the response using the stream.pipeThrough() function. The use of this method allows for efficient handling of the streamed data, maintaining the integrity and coherence of the response as it is displayed to the user.
- Virtual Instrumentation: Laboratory Guide [14]—this document provides comprehensive laboratory exercises and practical guidance on virtual instrumentation, serving as a foundational resource for hands-on learning and experimentation.
- Introduction to LabVIEW Graphic Programming with Applications in Electronics, Telecommunications, and Information Technologies [15]—it covers fundamental concepts and practical applications in electronics, telecommunications, and IT, making it a critical resource for understanding the software tools used in virtual instrumentation.
5. Discussions and Conclusions
References
- Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., Goyal, N., Küttler, H., Lewis, M., Yih, W., Rocktäschel, T., Riedel, S., Kiela, D.: Retrieval-augmented generation for knowledge-intensive NLP tasks. In Proceedings of the 34th International Conference on Neural Information Processing Systems (NIPS ‘20). Curran Associates Inc., Red Hook, NY, USA, Article 793, 9459–9474. (2020). [CrossRef]
- Ashfaque, M. W., Tharewal, S., Iqhbal, S., Kayte, C. N.: A Review on Techniques, Characteristics and approaches of an intelligent tutoring Chatbot system, 2020 International Conference on Smart Innovations in Design, Environment, Management, Planning and Computing (ICSIDEMPC), Aurangabad, India, 2020, pp. 258-262. [CrossRef]
- Carbonel, H., Jullien, J.-M.: Emerging tensions around learning with LLM-based chatbots: A CHAT approach, Networked Learning Conference, 14(1). https://journals.aau.dk/index.php/nlc/article/view/8084.
- Bratić, D., Šapina, M., Jurečić, D., Žiljak Gršić, J.: Centralized Database Access: Transformer Framework and LLM/Chatbot Integration-Based Hybrid Model. Appl. Syst. Innov. 2024, 7, 17. [CrossRef]
- Makharia, R. et al.: AI Tutor Enhanced with Prompt Engineering and Deep Knowledge Tracing,” 2024 IEEE International Conference on Interdisciplinary Approaches in Technology and Management for Social Innovation (IATMSI), Gwalior, India, 2024, pp. 1-6. [CrossRef]
- Martinez-Araneda, C., Gutiérrez, M., Maldonado, D., Gómez, P., Segura, A., Vidal-Castro, C.: Designing a Chatbot to support problem-solving in a programming course, INTED2024 Proceedings, pp. 966-975. (2024). [CrossRef]
- Bakas, N.P., Papadaki, M., Vagianou, E., Christou, I., Chatzichristofis, S.A.: Integrating LLMs in Higher Education, Through Interactive Problem Solving and Tutoring: Algorithmic Approach and Use Cases, In: Information Systems. EMCIS 2023. Lecture Notes in Business Information Processing, vol 501. Springer, Cham. [CrossRef]
- Lieb, A., Goel, T.: Student Interaction with NewtBot: An LLM-as-tutor Chatbot for Secondary Physics Education. In Extended Abstracts of the CHI Conference on Human Factors in Computing Systems (CHI EA ‘24), Association for Computing Machinery, New York, NY, USA, Article 614, pp. 1–8. [CrossRef]
- Siriwardhana, S., Weerasekera, R., Wen, E., Kaluarachchi, T., Rana, R., Nanayakkara, S.: Improving the Domain Adaptation of Retrieval Augmented Generation (RAG) Models for Open Domain Question Answering. Transactions of the Association for Computational Linguistics 2023; 11 1–17. [CrossRef]
- Modran, H.A., Ursutiu, D., Samoila, C., Chamunorwa, T.: Learning Methods Based on Artificial Intelligence in Educating Engineers for the New Jobs of the 5th Industrial Revolution. In: Educating Engineers for Future Industrial Revolutions. ICL 2020. Advances in Intelligent Systems and Computing, vol 1329. Springer, Cham. (2021). [CrossRef]
- Modran, H.A., Chamunorwa, T., Ursuțiu, D., Samoilă, C.: Integrating Artificial Intelligence and ChatGPT into Higher Engineering Education. In: Towards a Hybrid, Flexible and Socially Engaged Higher Education. ICL 2023. Lecture Notes in Networks and Systems, vol 899. Springer, Cham. [CrossRef]
- ChatGPT API Reference. https://platform.openai.com/docs/api-reference/introduction, last accessed 2024/05/25.
- LLamaIndex Documentation. https://www.llamaindex.ai/, last accessed 2024/05/28.
- Modran, H. A., Ursuțiu, D.: Instrumentație Virtuală: Îndrumar de laborator, Transilvania University of Brasov Publishing House, ISBN 9786061915460 (2022).
- Modran, H. A., Bogdan, I. C., Ursuțiu, D., Samoilă, C.: Introducere în Programarea Grafică LabVIEW cu Aplicații în Electronică, Telecomunicații și Tehnologii Informaționale, Transilvania University of Brasov Publishing House, ISBN 978-606-19-1709-9 (2024).





Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).