mayooear / gpt4-pdf-chatbot-langchain

GPT4 & LangChain Chatbot for large PDF docs
https://www.youtube.com/watch?v=ih9PBGVVOO4
14.86k stars 3.01k forks source link

Chat history is not included in the prompt (model is not aware of previous interactions) #393

Closed Dlas1212 closed 2 months ago

Dlas1212 commented 1 year ago

The issue persists with this. Ticket should be re opened. When using ConversationalRetrievalQAChain the history if your message does not persist.

Detail: I am using Externally Managed Memory, which clearly states you can also pass the chat history in explicitly by omitting the memory option and supplying a chat_history string or array of HumanMessages and AIMessages directly into the chain.call method

When you pass in your history and ask it something along of lines of "My name is Joe", then AI will usually respond with "Hi Joe, how are you?" and if your follow up question is "What is my name?" Even when passing in the chat_history the AI will respond with I do not have access to that information.

The closed ticket that should be re-opened because this is not solved: https://github.com/mayooear/gpt4-pdf-chatbot-langchain/issues/65

harrycruz commented 1 year ago

Hello, I am currently facing the exact same issue. It looks chat_history is being completely ignored. When printing the chain's reponse, the only items in the chat_history are the question and answer itself. See it below:

{'question': 'Options for financing', 'chat_history': [HumanMessage(content='Options for financing', additional_kwargs={}, example=False), AIMessage(content='There is no information provided in the given context about options for car financing.', additional_kwargs={}, example=False)], 'answer': 'There is no information provided in the given context about options for car financing.'}

jklein33 commented 1 year ago

Anyone come up with a solution to this?

saud121 commented 8 months ago

anyone have a solution?

dosubot[bot] commented 5 months ago

Hi, @Dlas1212

I'm helping the gpt4-pdf-chatbot-langchain team manage their backlog and am marking this issue as stale. The issue involves the ConversationalRetrievalQAChain not persisting chat history, resulting in the AI responding with "I do not have access to that information." Several users have reported facing the same issue, and there's interest in finding a solution.

Could you please confirm if this issue is still relevant to the latest version of the gpt4-pdf-chatbot-langchain repository? If it is, please let the gpt4-pdf-chatbot-langchain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you!

Dlas1212 commented 5 months ago

@saud121 @jklein33 @harrycruz

I believe this is still active right?

dosubot[bot] commented 5 months ago

@mayooear Could you please assist with the issue involving the ConversationalRetrievalQAChain not persisting chat history, as reported by @Dlas1212? Thank you!

#### Details **About Dosu** This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

jklein33 commented 5 months ago

@Dlas1212 yeah the solution is to not use langchain bc it's trash. My system improved dramatically by removing langchain.