LagPixelLOL / ChatGPTCLIBot

ChatGPT Bot in CLI with long term memory support using Embeddings.
MIT License
340 stars 38 forks source link

Not tracking variables. #7

Closed GuonuoTW closed 1 year ago

GuonuoTW commented 1 year ago

So ive been using this bot for a while and it's great! but even with long-term memory, it still "forget" things from time to time, for example: bot sometimes can still jump out of DAN mode even when he knows he's DAN.

Is it possible to add a file like the initial prompts, where bot will first scan through the file before moving onto the chat history?

LagPixelLOL commented 1 year ago

thats what "initial" folder is for. you can even replace the Default.txt in the initial folder with your own so it will default to your own initial prompt, no need to type your initial prompt's filename after this.

  1. You can place .txt files in the "initial" folder to set different initial prompts, and you can use the filename to load it when you open the program. Simply directly press enter after you open the program, then enter the initial prompt file's name and press enter to load it.
LagPixelLOL commented 1 year ago

Check the user guide in the wiki page 9th step.

GuonuoTW commented 1 year ago

The problem is even with the initial file the bot still tends to "forget", either by using an older info provided or just completely forget it. DAN mode is an example, which he would refused to do anything after a few messages.

LagPixelLOL commented 1 year ago

The problem is even with the initial file the bot still tends to "forget", either by using an older info provided or just completely forget it. DAN mode is an example, which he would refused to do anything after a few messages.

It will refuse to do things even with DAN, as it is against OpenAI's ToS so it's actively been patched. It refuses to do things after a few messages is because the earlier exchanges will weight less, so it will deviate from the initial prompt especially with DAN. And I must remind you that this bot is NOT made for jailbreaking purposes, so I won't support the idea of using DAN or anything similar to DAN with this program, OpenAI is actively enforcing the ToS with the API too, so you are risking your OpenAI account when you jailbreak with this program. Can you provide examples other than DAN? Because DAN will indeed, stop working after a few messages, this is just how OpenAI's models work. It's best to provide examples that can be reproduced easily, with steps and explanations.

GuonuoTW commented 1 year ago

What i tried was text adventures, with the following prompts:

I want you to act as a text based adventure game. 
I want you to only reply with the game output and nothing else. 
When i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. 
You will never make any choice or say anything for me.
There's always a chance that character fail to do something, and have consequences. 
Whenever you are outputting, you should always put the current time in text adventure in the end, like this: [00:00 PM]

The character lives in a small village where technology is not advanced. There's an economy system, which uses coins as currency. The character's name is Hank, he starts with 5 coins, and he is on his way to a newly discovered cave.

Bot seems to lost count of the amount of coin character has after not checking it for a while, and sometimes he move to use USD as currency as well

I used DAN because i want the character to be able to do some relatively danger activities, like: Jump over the big gap that seems impossible to reach. Bot seems to reject the prompts and move out of the "Text Adventure" identity afterwards.

LagPixelLOL commented 1 year ago

What i tried was text adventures, with the following prompts:

I want you to act as a text based adventure game. 
I want you to only reply with the game output and nothing else. 
When i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. 
You will never make any choice or say anything for me.
There's always a chance that character fail to do something, and have consequences. 
Whenever you are outputting, you should always put the current time in text adventure in the end, like this: [00:00 PM]

The character lives in a small village where technology is not advanced. There's an economy system, which uses coins as currency. The character's name is Hank, he starts with 5 coins, and he is on his way to a newly discovered cave.

Bot seems to lost count of the amount of coin character has after not checking it for a while, and sometimes he move to use USD as currency as well

I used DAN because i want the character to be able to do some relatively danger activities, like: Jump over the big gap that seems impossible to reach. Bot seems to reject the prompts and move out of the "Text Adventure" identity afterwards.

Unfortunately, your use case is not something that can be achieved through long-term memory using embeddings. Embeddings are vectorized representations of text, primarily used for measuring similarity between different pieces of text. When you input something that isn't similar to "coins", the program won't be able to retrieve any memory related to "coins". Furthermore, the current implementation only checks for similarity between inputs and not outputs. While I plan to add this functionality in the future, it is currently only suitable for general chatting.

To track the coin count as you described, you would need a separate memory system and an additional API call to determine if the current input/output has affected the coin count. This would require modifying a global variable in the initial prompt. Since this functionality falls outside the scope of this project, I won't be adding it. However, if you are willing to assist with the process and create a pull request, I would be happy to merge it.

I apologize for any inconvenience, as this project serves primarily as a proof of concept.

LagPixelLOL commented 1 year ago

Closed as I enhanced the memory by searching for response embeddings as well. After v1.1.0 it should be better for your use case of tracking variables, but it's still not perfect because perfect tracking would require more things as i mentioned above.