I am currently working on an AI chatbot that uses RAG to answer questions from a PDF. Here’s what I have done so far:
user_message
is the message the user sends to the bot. It uses RAG to retrieve relevant topics and send a response back to the user.- For tracking message history for continuous conversation, I have added conversation history to a list.
- Since the system was using only the user’s message to retrieve relevant information, I thought it would be better to use both the chat history and the user’s message to retrieve relevant chunks.
- However, now there is an issue: If the conversation continues for a while, and I try to change the topic, the system still follows the previous conversation. The RAG pipeline continues fetching relevant information based on the previous conversation.
Is there a way to fix this issue?