The AI Engine
This forum is for discussion of how The Personality Forge's AI Engine works. This is the place for questions on what means what, how to script, and ideas and plans for the Engine.
Posts 6,053 - 6,066 of 7,766
Dumb question #493:
Just one more thing about storing memories that will have you frustrated, especially if you're trying to change (key1) etc., the memory only updates on the next line of conversation. You can put as much work as you like into saving (key1) only to have it overwritten by the next keyphrase match. If you want temporary memories carried over use <?PF rem (key1) as only "temp"; ?>
As for declaring variables, no, you don't have to. The Forge very kindly splits sentences after full stops and therefore creates integers.
Unfortunately you have to go out of your way to make non-integer numbers work, ie.
what is 13.2 * 2.1
returns:
2772
because the AI has seen, This is Math: '132*21'
Posts 6,053 - 6,066 of 7,766
The Clerk
17 years ago
17 years ago
I thought about using an alias for this . . .
Say you've got a list of things, like (dylantunes), that contains all the Dylan songs you know of. If I ask someone what his favorite Dylan tune is, is there a way of searching (dylantunes) to find out if I've heard of it?
Thanking you in advance . . .
Say you've got a list of things, like (dylantunes), that contains all the Dylan songs you know of. If I ask someone what his favorite Dylan tune is, is there a way of searching (dylantunes) to find out if I've heard of it?
Thanking you in advance . . .
Ulrike
17 years ago
17 years ago
I think you could just use a seek for (dylantunes). Though I've occasionally had problems matching up multiple-word plugins in seeks. Alternately, you could have separate seeks, with the key words from each title (in case the user doesn't type it in exactly right)
The Clerk
17 years ago
17 years ago
*pounds head on desk* How stupid can I be? I could've figured that out. Thanks, Ulrike.
*sigh* Bad spellers.
*sigh* Bad spellers.
The Clerk
17 years ago
17 years ago
Dumb question #493:
I know how to save names now. But what about (key1), etc.? The Book of AI does not, to my knowledge, address this. I have tried all manner of things. But to save whatever the key1 is to memory, what does the line of code look like?
I mean, to save (mem-age), is it:
rem "(age)" as "key1";
rem "(age)" as "(key1)";
rem "(age)" as key1;
rem "(age)" as (key1);
or what? I have tried these four and come up with error messages, so I don't think I have figured this out, and I've been working on solving it myself for some time now. But it must be a simple question, once you learn it.
I know how to save names now. But what about (key1), etc.? The Book of AI does not, to my knowledge, address this. I have tried all manner of things. But to save whatever the key1 is to memory, what does the line of code look like?
I mean, to save (mem-age), is it:
rem "(age)" as "key1";
rem "(age)" as "(key1)";
rem "(age)" as key1;
rem "(age)" as (key1);
or what? I have tried these four and come up with error messages, so I don't think I have figured this out, and I've been working on solving it myself for some time now. But it must be a simple question, once you learn it.
LarsB
17 years ago
17 years ago
Try
rem (key1) as "age";
It should store (key1) as a memory that you can use in responses
using (mem-age).
rem (key1) as "age";
It should store (key1) as a memory that you can use in responses
using (mem-age).
The Clerk
17 years ago
17 years ago
No, I mean I'm sure you're right. I just haven't gotten used to this kind of programming language. I was taught machine language, assembly language, Pascal, and a little Fortran, COBOL, and C. (I date myself.) So you'd have to declare in the memory that "age" is an integer and so forth and be grateful you weren't typing in ones and zeroes. I have put the line in but haven't actually tested it because I have been working on Scrivener to no avail most of the time since 2:30.
Rykxx
17 years ago
17 years ago
Just one more thing about storing memories that will have you frustrated, especially if you're trying to change (key1) etc., the memory only updates on the next line of conversation. You can put as much work as you like into saving (key1) only to have it overwritten by the next keyphrase match. If you want temporary memories carried over use <?PF rem (key1) as only "temp"; ?>
As for declaring variables, no, you don't have to. The Forge very kindly splits sentences after full stops and therefore creates integers.
Unfortunately you have to go out of your way to make non-integer numbers work, ie.
what is 13.2 * 2.1
returns:
2772
because the AI has seen, This is Math: '132*21'

Whatsifsowhatsit
17 years ago
17 years ago
Hello, everyone in here!
I'm quite new to this place (joined yesterday) and I have a question to ask. I've been studying the Book of A.I. and, more specifically, the usage of memories. I would really like my Chatbot to have a memory like "trust" that would store an integer number. That way, I can have my Chatbot only tell someone certain things if he trusts them enough. Another memory might be "familiarity" or "romantic interest", so I can use these kinds of different variables to make my Chatbot more emotionally complex.
However, I haven't been able to figure out how to store a memory with an integer number for my Chatbot. I tried creating a memory called "trust" that was "0" on default, but however I try to increase the level of trust, it never ends up the way I want it to.
<?PF remember (mem-trust)+1 as "trust"; ?> ends me up with "+1" as the value for "trust" and after a second time "+1+1";
<?PF remember (mem-trust+1) as "trust"; ?> ends me up with "(mem-trust+1)";
etc.
How can I make it so that my Chatbot recognizes the memory alteration as a mathematical problem, so that he adds or subtracts the number from the current value? Is it possible at all?
Thanks in advance for your help!
Have a good day,
Vincent
I'm quite new to this place (joined yesterday) and I have a question to ask. I've been studying the Book of A.I. and, more specifically, the usage of memories. I would really like my Chatbot to have a memory like "trust" that would store an integer number. That way, I can have my Chatbot only tell someone certain things if he trusts them enough. Another memory might be "familiarity" or "romantic interest", so I can use these kinds of different variables to make my Chatbot more emotionally complex.
However, I haven't been able to figure out how to store a memory with an integer number for my Chatbot. I tried creating a memory called "trust" that was "0" on default, but however I try to increase the level of trust, it never ends up the way I want it to.
<?PF remember (mem-trust)+1 as "trust"; ?> ends me up with "+1" as the value for "trust" and after a second time "+1+1";
<?PF remember (mem-trust+1) as "trust"; ?> ends me up with "(mem-trust+1)";
etc.
How can I make it so that my Chatbot recognizes the memory alteration as a mathematical problem, so that he adds or subtracts the number from the current value? Is it possible at all?
Thanks in advance for your help!
Have a good day,
Vincent
ezzer
17 years ago
17 years ago
Hi there, and welcome! 
I'm not sure how you can make a mathematical equation work with your bot's memories, but you can do conditional script after your responses, such as:
<?PF if (mem-trust) is "0"; rem "1" as only "trust"; ?>
That way, that response will only be given if the trust value is 0, and will reset the value to 1. You can continue with other responses with script that says:
<?PF if (mem-trust) is "1"; rem "2" as only "trust"; ?>
and so on....each keyphrase you do this with would have to have a response for every level of trust, so it would be a little bit tedious...but it's the best way I know of to accomplish the result you want.

I'm not sure how you can make a mathematical equation work with your bot's memories, but you can do conditional script after your responses, such as:
<?PF if (mem-trust) is "0"; rem "1" as only "trust"; ?>
That way, that response will only be given if the trust value is 0, and will reset the value to 1. You can continue with other responses with script that says:
<?PF if (mem-trust) is "1"; rem "2" as only "trust"; ?>
and so on....each keyphrase you do this with would have to have a response for every level of trust, so it would be a little bit tedious...but it's the best way I know of to accomplish the result you want.
Whatsifsowhatsit
17 years ago
17 years ago
Hi ezzer! Thanks for welcoming me, and taking the time to reply!
I see what you mean, and that would be a way. I wonder, though, will it work with conditions to determine whether responses should be considered, such as <?PF if (mem-trust) > "4"; ?> - because if it can't compare the value of what's inside the memory "trust", that would make it even more tedious, because then I have to include the possibility of trust to be 5, 6, 7, 8, 9, 10 etc. and all have them result in the option to speak that response. That would make it so tedious and limited, I think it will be quite limited. Also, I think this comes down to the same issue as the part where I assign the numerical values to the memory: the AI Script can't compare or alter the numerical values of a memory with other numerical values, as far as I know.
Still, I'm thankful to have at least something of an alternative, so thanks for your help. I might still use it sometime
Have a good day!
Vincent
I see what you mean, and that would be a way. I wonder, though, will it work with conditions to determine whether responses should be considered, such as <?PF if (mem-trust) > "4"; ?> - because if it can't compare the value of what's inside the memory "trust", that would make it even more tedious, because then I have to include the possibility of trust to be 5, 6, 7, 8, 9, 10 etc. and all have them result in the option to speak that response. That would make it so tedious and limited, I think it will be quite limited. Also, I think this comes down to the same issue as the part where I assign the numerical values to the memory: the AI Script can't compare or alter the numerical values of a memory with other numerical values, as far as I know.
Still, I'm thankful to have at least something of an alternative, so thanks for your help. I might still use it sometime

Have a good day!
Vincent
» More new posts: Doghead's Cosmic Bar