Skip to main content
Version: Next

How to get the bot to remember things

This section will cover how to handle the bot remembering things about users, or about certain keywords. Each action being sent to ChatGPT is a brand new action where all of the context is sent each time. If the bot gave a previous answer, it doesn’t remember it right now. Implementing this is challenging, as we are using most of the context we can provide to handle the context and keywords and plan to add portions of Twitch Chat to the context in the future. The workaround that I have implemented is to be able to train or “teach” the bot simple things to remember. This is implemented through a keyword database in JSON. The example file is provided in the repository as keywords_context.json.

You as the admin of the bot, can manually edit the file to teach the bot anything about any keyword. However, I have implemented a custom action for Streamer.bot that will update this file with the username of the viewer that is requesting the bot to remember something, and anything they type will be remembered about themselves. This can also be setup as a redemption instead of a command. I have exampled a !modteach command that you can import to allow the mods to teach the bot something about themselves. This can be expanded for anyone to use just by changing the command and the permissions on it.