[OutSystems.AI Chatbot] How can we get the chatbot to remember the conversation? Via variables?

Forge Component
(14)
Published on 26 May by Rui Parente
14 votes
Published on 26 May by Rui Parente

Hi (:


I guess many people may face this problem>>>


Bot: (welcome message) You want to talk about A, B, or C?

User: B

Bot: (returning the response message for user message "B") Okay. You want to talk about B1, B2, or B3?

***At this point, bot forgets that user chose "B", so it's impossible to continue the conversation about "B"!***

User: B1

Bot: (unable to respond because the first-stage options are "A", "B", "C")


I tried to store user input "B" as a local variable, but the value got erased upon sending the response message. Same happened to a session variable. Is it because variable values are always erased in APIs? How can we solve this?


Thanks!


Solution

YS wrote:

Hi (:


I guess many people may face this problem>>>


Bot: (welcome message) You want to talk about A, B, or C?

User: B

Bot: (returning the response message for user message "B") Okay. You want to talk about B1, B2, or B3?

***At this point, bot forgets that user chose "B", so it's impossible to continue the conversation about "B"!***

User: B1

Bot: (unable to respond because the first-stage options are "A", "B", "C")


I tried to store user input "B" as a local variable, but the value got erased upon sending the response message. Same happened to a session variable. Is it because variable values are always erased in APIs? How can we solve this?


Thanks!



Hello YS,


The only to way to have persistent data in OutSystems.AI Chatbot is by creating an Entity and store the needed values in the database for your conversational flow. A suggestion I can give you is that a conversation that is started has a unique ConversationId associated (is in the Message) so you can store it in your Entity this ConversationId and the variables you want to store so they correlate to a certain conversation.


Best regards,

Félix Barros

Solution