LINK TO THE CHATBOT: CLICK HERE
Introduction In general, chatbots are used for information retrieval. Traditional chatbots typically work based on some predefined rules as well as keyword matching. It’s kind of a set of if-else rules predefined by the users. When a user inputs a query, the chatbot searches for specific keywords or patterns in the query to identify the appropriate response. Traditional chatbots rely on a fixed knowledge base or database of predefined responses. The responses are manually inserted into the database by the developer. When a user inserts a query, the chatbot looks for the rules that are suitable based on the question, when it finds the question then it gives the answer that is hardcoded associated with that question. It doesn’t make any paraphrasing or can’t perform any generation. Nowadays, LLM-based chatbots are in the hype. LLM-based chatbots can be of two types.
- LLM-Based Chatbots without RAG: Large Language Models (LLM) such as OpenAI, llama is trained with billions of parameters as well as with huge amounts of textual data. Some of these are open-source means that can be used without any payment and some are not. We can use the chatbot for our purpose using the API provided by the respected organization of these LLMs. But here the problem is that when a user asks any question it will directly answer from the data it has been trained on without considering any external knowledge base. It will work just as ChatGPT
- LLM-Based Chatbots with RAG: RAG stands for Retrieval-Augmented Generation. It has two main components generation and retrieval. Unlike LLM-based chatbots without the RAG concept, here external data sources such as PDF, text, and database are used as knowledge base along with the trained LLM model. So In this case, when any user asks for a query it first looks for a similar type of text chunk in the external knowledge base which is named retrieval, these text chunks are used as prompts to the LLM model. Based on the context and user query the LLM model can create a more precise and creative answer which can be referred to as generation. This is not possible with other types of chatbot. In this project, a multisource chatbot using RAG has been implemented where users can upload various types of documents like pdf, and text as an external knowledge base and ask the chatbot to answer questions referring to the knowledge base. The chatbot utilizes the knowledge base as well as the pre-trained LLM to get more reliable, relative, and organized answers.
High-Level Overview of the RAG-Based Chatbot
Special Thanks to Rendyk for a helpful article published on Analytical Bidhay