Replies: 1 comment
-
🤖 Hello Jack, The issue you're experiencing seems to be related to how the memory is being managed in your code. The Here's how you can modify your code: // ... rest of your code
let chatHistory = "";
result = await chain.call({
question: message,
chat_history: chatHistory,
});
chatHistory = `${message}\n${result.text}`;
const followUpRes = await chain.call({
question: message,
chat_history: chatHistory,
});
// ... rest of your code In this updated code, after each interaction, the Also, please note that the This solution is based on the information provided in the BufferMemory class definition and a similar issue discussed in the LangChainJS repository (issue #2477). Please try this solution and let me know if it resolves your issue. If you have any further questions, feel free to ask. Best, Sources
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. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It seems like memory doesn't remember the information I gave in the previous question.
I tell the bot my name is Jack, then in follow up question I ask him my name, and the bot says it doesn't have that information... How can I fix that?
Here is the code:
Beta Was this translation helpful? Give feedback.
All reactions