I am trying to create an customer support system using langchain. I am using text documents as external knowledge provider via TextLoader
In order to remember the chat I using ConversationalRetrievalChain with list of chats
My problem is, each time when I execute conv_chain({"question": prompt, "chat_history": chat_history})
,
it is creating a new ConversationalRetrievalChain that is, in the log, I get Entering new ConversationalRetrievalChain chain >
message
And the chat_history array looks like, multiple nested arrays :
[[ "Hi I am Ragesh", "Hi Ragesh, How are your"] , ["What is my name?", "Sorry, As an AI....., " ]]
So it couldn't remember my previous chat.
Why this is happening ?
I am very new to AI field. Please help me.
My code:
https://gist.github.com/RageshAntony/79a9050b76e74f5ea868888cd57c6705