Issue with OpenAI API on my app

I’ve integrated a chatbot that’s designed to keep conversations going and prompt the user to act in a certain way, and it’s crucial for the chatbot to remember what the user has said in order to give better responses.

The goal is for the conversation to be long and engaging with the chatbot, but unfortunately, I’m running into an issue where the OpenAI API doesn’t seem to remember what the user has typed previously. For example, if the user tells the chatbot that they’re feeling down, the chatbot may ask “what’s causing you to feel that way?” but then quickly forget what the user had said in the previous sentence.

What I’m looking for is for the chatbot to work in a similar way to ChatGPT, where it’s able to keep context and remember what the user has said previously. This will allow for a more personalized and engaging conversation with the chatbot.

I’m currently using Flutter for my app and this issue has been really frustrating for me. I would greatly appreciate any help or advice on how I can resolve this issue and get the chatbot working the way I need it to. Thank you so much for your time and assistance!

1 Like

Welcome @nikalacabidze111

What model are you using?

Where’s the code making API call?

1 Like

@nikalacabidze111 Have you managed to solve your problem?

I think you can solve the problem using OpenAI Embeddings.
Of course we use this to make some chatbot that chats with the user using some base data that is stored in the vector database like postgresql or pinecone.
But we can use this to store the chat history and we can implement history searching if the user mentions about past conversation.
This is my idea and I am open for others.
Please reply if someone has the better one.