https://discord.gg/botpress logo
#📖tutorials
Guide: ChatGPT Style Memory in Botpress
# 📖tutorials
s

straight-wolf-37371

07/25/2023, 12:59 AM
Link: https://www.loom.com/share/2b6b2440c1094f66bbc1a057e07fc464?sid=8e7df506-8da4-43dd-8fee-d0f4e28d91b3 It covers: Using Summary Agent in AI Task to achieve ChatGPT style memory Help support these tutorials buy supporting me 🙂 https://www.buymeacoffee.com/simplygreatgames
Want to test it yourself? Import the bot into a blank project under Import / Export when you click on the top left logo in the botpress studio
For a more sophisticated test see images.
r

rich-battery-69172

07/25/2023, 3:14 AM
you're awesome @straight-wolf-37371 !
c

curved-traffic-50479

07/25/2023, 9:41 AM
You are legend @straight-wolf-37371 this works as good as chatgpt ❤️ It can remmeber covnersation. I think many in community will love this, this can solve the reptead questions that many face here includes me. 🔥
s

straight-wolf-37371

07/25/2023, 12:40 PM
💡 I think it would be great to have a toggle on the AI Task that automatically does this for the user. It seems to be as common misunderstanding. Something like "Send Summary Transcript" or something would be a great easy fix! I'll put it in the feature request section
r

rich-battery-69172

07/25/2023, 4:29 PM
Yes that;s a good idea
c

crooked-van-25152

07/25/2023, 10:15 PM
That's amazing @straight-wolf-37371 - thank you so much for sharing this video with the Community! Do you think you could also share your bot in the #1120796649686573086 channel?
s

straight-wolf-37371

07/26/2023, 4:13 AM
b

brief-secretary-69236

07/26/2023, 9:24 AM
Hi, I appreciate your help, but look at your bot. Do you have the problem that one day everything is ok and the next it doesn't work? Add to Knowledge Agent: Provide Context to KBs: {{conversation.SummaryAgent.summary}} {{ conversation.SummaryAgent.transcript }} And remove Latest Response - {{event.preview}} Works ok, today. Of course, many thanks botpress for the development.
s

straight-wolf-37371

07/26/2023, 2:08 PM
I think there have been some stability issues happening in the past couple days. This is just a starting point for memory, work with the AI Task prompts for your specific use case and add cases to control for different situations. If you were to put the messages you provided to the bot directly in to chat gpt it will do something similar and jsut provide the convo back to you. Based on your response to the bot, I'm not sure what you are expecting back from it.
b

brief-secretary-69236

07/26/2023, 2:14 PM
I do not expect this
c

curved-traffic-50479

07/26/2023, 6:21 PM
try to mention in your ai task "If a user mentions 'goodbye' or wishes to conclude the conversation, kindly wish them a good day. Whenever someone expresses gratitude with 'thank you' or similar, reply with 'you're welcome! "
i had similer issue
c

careful-keyboard-68830

07/27/2023, 5:33 AM
Thanks for sharing this guide! However, I'm not really sure what is the purpose of the execute code card when you have the transcript in the AI Task 🤔
s

straight-wolf-37371

07/27/2023, 12:15 PM
The execute card is just printing the transcript out the console so that you can see what is being passed into AI Task. For the user, it doens't do anything. As a developer, its great to print things out to the console so you can easily debug/see what is going on. So you are right, for the user using the bot, the execute card is not doing anything
a

adamant-agent-88924

07/27/2023, 12:53 PM
what about using {{event.state.session.fullHistory}} instead of {{event.preview}}?
is there any difference?
s

straight-wolf-37371

07/27/2023, 1:29 PM
event.preview is the latest message from the user. I'm not really sure what the fullhistory one is that you have listed there. It may be more similar to the conversation.SummaryAgent.transcript
a

adamant-agent-88924

07/27/2023, 1:33 PM
I'm using event state session fullHistory actually and it seems like it does the same thing
c

careful-keyboard-68830

07/27/2023, 1:33 PM
Ah makes sense
a

adamant-agent-88924

07/27/2023, 1:33 PM
As remembering the convo
Maybe u can try swapping event preview with it and see how it goes
f

fierce-terabyte-74126

07/27/2023, 4:03 PM
I have it too and it works like ChatGPT... I believe that was used before the introduction to agents
r

rich-battery-69172

07/27/2023, 4:11 PM
fullHistory comes from a custom hook (probably from a template – this is not an official BP feature/variable)
a

adamant-agent-88924

07/29/2023, 3:10 AM
Yea it comes from a template but it basically works like chatgpt
w

wooden-family-22572

08/03/2023, 12:46 PM
@straight-wolf-37371 thanks for this! How could I work with this same memory similar to ChatGPT using the Stack AI API? Bringing Stack AI into Botpress with this same memory is proving to be my major challenge. That would be the perfect world for my business.
s

straight-wolf-37371

08/03/2023, 1:17 PM
Sorry, I haven't worked with Stack API. What do you pass in? Anyway to provide the conversation.SummaryAgent.summary?
s

square-magazine-33326

08/03/2023, 4:41 PM
@straight-wolf-37371 Hello, it seems it doesn't work if the bot is answering from knowledge base? When looking at my logs I can see there is a prompt with the whole conversation, but the bot still is confused and gives answer that is not connected to a conversation history. I ask about product X with follow-up questions "how much" and it gives answer with price of a very different product, never mentioned in conversation. The only differnce from your bot is that it answers from KB.
s

straight-wolf-37371

08/03/2023, 5:24 PM
Correct. This is just supplying memory to Chat GPT in AI Task cards. It doesn't supply memory to Knowledge Base. You can set up knowledge base to use summaries as well doing a similar approach. But you may not even need to do it yourself anymore. Recently, there was a "Provide Context to KBs" added to the Knowledge Agent. You can pass the summary in there
s

square-magazine-33326

08/03/2023, 5:45 PM
oh thanks! It worked for a sec, but unfortunately I encounter problems with providing Context to KBs which is: errorError generating answer for KB [AxiosError: Request failed with status code 500]. Happened to me before when providing other things in this field.
f

freezing-printer-49373

08/04/2023, 7:47 PM
fix incoming very soon, issue was found for this.
q

quiet-lawyer-35837

08/12/2023, 9:55 AM
Good tutorial, thank you but not working as expected, did you have a fix for that ?
s

steep-bird-24487

08/14/2023, 4:21 AM
Any fix available for this? @freezing-printer-49373 @straight-wolf-37371
t

tall-petabyte-27156

08/23/2023, 12:56 AM
hi @straight-wolf-37371 is there anyway to escape the conversation? when the context is getting mix up , anyway to start over? thankssss
s

straight-wolf-37371

08/23/2023, 2:48 PM
Look into Intents, you coudl create an intent to where the user can say cancel, restart, etc to end the conversation
b

brief-accountant-68119

08/23/2023, 6:10 PM
@brief-accountant-68119
t

tall-petabyte-27156

08/29/2023, 3:31 PM
what about if user dont know it should say "restart" , we just create option for them to choose to restart over ? but if it goes near the ending and it restart, it might be annoying to the user. @straight-wolf-37371 thanks a lot!!!
s

straight-wolf-37371

08/29/2023, 4:03 PM
This is getting a little bit into design flow and architecture. How you need to set it up can be really different depending on what your bot is trying to achieve. You can explore creating different workflows and seeing how you like it. This is just a starting point to build on to.
t

tall-petabyte-27156

08/31/2023, 5:32 AM
thankss
f

few-van-11889

09/11/2023, 3:05 PM
How to train chatgpt plugin to give real time information of 2023
c

crooked-van-25152

09/11/2023, 3:20 PM
I would advise posting this in the general or the #1111009377525186570 channel.
n

narrow-agent-91470

09/11/2023, 4:39 PM
As soon that I gain money, I will buy you some coffee 🙌
Thanks a lot for all your Tutorials
They are great
i

important-agent-75345

09/25/2023, 8:58 AM
I have tried various ways to make the bot act like a chatbot, looping in the same node using the transcript history of the summarizer agent. I added Personality Agent. I put the history in the AI Task Input card of the AI Task and asked it to read the entire
{{ conversation.SummaryAgent.transcript }}
before. I changed and put everything in the AI Generate Text card. I also mixed all of this for testing purposes. None of these worked consistently. Most of the time, the bot repeats its last question indefinitely in the loop. Sometimes it writes the command I gave it instead of the result. Has it been working perfectly for you all? I don't know what I might be doing wrong.
b

brief-accountant-68119

09/27/2023, 3:36 PM
this method works perfectly. you just need to learn how to prompt engineer. it's the harders part about building Ai
j

jolly-policeman-82775

10/24/2023, 7:07 AM
hey man
it deos not work for me
i think im doing it wrong
i did it exactly like you did in your file
guys c
can someone help me ?
s

straight-artist-27096

10/24/2023, 6:23 PM
Damn this is sick
b
Do exactly as he did
Basically, you need to pass the conversation history to your AI Task
f

fresh-cricket-89011

10/24/2023, 7:35 PM
Does anyone know how to integrate into fb and ig. I got it working with fb but not ig. And also how to restart the convos?
b

bitter-apartment-83769

10/24/2023, 8:22 PM
To reset the conversation type //state/reset
j

jolly-policeman-82775

10/26/2023, 6:17 AM
hi
can we do it without ai task ?
becuase im using KB
can someone help me please
it does not work for me
b

bitter-apartment-83769

10/26/2023, 10:55 AM
Do you want to reset the conversation within your workflow? The command I mentioned can be typed in chat
j

jolly-policeman-82775

10/26/2023, 11:30 AM
huih me ?
What am i doing wrong ?
11 Views