Whatsapp memory for chatbot

Hi everyone, i need to know how can put memory in chats with customers, someone tell me that need use Thread ID, but i dont know how to do that. Please help,

PS: I only set webhook to listen to messages, process the messages with Asistant through chatGPT and then respond to the client, but every time he writes, it asks his name again, that is, he does not remember who he is or what they talked about before.

Thanks all!

Hi @Jonathan_Valle,

the guy who told you that you need to use Thread ID is correct. I guess that every WhatsApp Chat has some unique ID.

You want to have some kind of database (e.g. Google Sheets or Data Store within make) where you match the WhatsApp Chat ID to the OpenAI Thread ID.

When a new message is received, you want to check the Database if that Chat ID already has an entry with a corresponding Thread ID.
If that is the case, you want to add the thread ID to the OpenAI module so that it knows the history.
If no entry has been found in the database, you want to create a new thread, save the Chat ID together with the new Thread ID in the database and then send a first message to that thread.

If you message an assistant, and you leave the “Thread ID” input empty, you will get a new one with the response.

For all subsequent messages, you want to input this thread ID in the input field of the “message an assistant” module.

I hope I could help. If you want, I could build the automation for that real quick. Should I?

Edit: Unfortunately, I can’t use the WhatsApp module as I am not signed up for their business platform. If you could send the output you get from the WhatsApp module, I could set up the scenario and send over the blueprint :smiley:

Hi @Jonathan_Valle,

just made a video for you showcasing the scenario I’ve built you:

It works really well btw!

Here is the blueprint:
blueprint (3).json (63.9 KB)

1 Like

Please see Struggling with “Thread” logic for OpenAI Assistant in Telegram bot - #2 by samliew, similar logic (replace Telegram with WhatsApp).

Hope this helps! Let me know if there are any further questions or issues.

— @samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.