In aiml how to get multiple learnf facts instead of only one? For example
<category>
<pattern>Learn * means *</pattern>
<template>Aight
<learnf>
<category>
<pattern>What is <eval><star/></eval></pattern>
<template>It means <eval><star index="2"/></eval></template>
</category>
</learnf>
</template>
</category>
Human: Learn life means to pursue something.
Robot:aight
Human:what is life?
Robot:it means to pursue something
But what if if I taught the same question with different response?
Human: Learn life means to live at fullest
Robot:aight
Human: what is life?
Robot:It means to live at fullest.
The fact taught previously for same question gets replaced by new one. How to retrieve the previously learned fact as well as the new one for same question?
You can do this by setting a predicate called <star/>
and appending the value of each interaction to it, like this.
<category>
<pattern>LEARN * MEANS *</pattern>
<template>
Aight
<think>
<condition><name><star/></name>
<li value="unknown"><set><name><star/></name><star index="2"/></set></li>
<li><set><name><star/></name><get><name><star/></name></get>, <star index="2"/></set></li>
</condition>
</think>
<learnf>
<category>
<pattern>What is <eval><star/></eval></pattern>
<template>It means <eval><get><name><star/></name></get></eval></template>
</category>
</learnf>
</template>
</category>
The condition checks that the predicate exists and if it does, append <star index="2"/>
to it. Otherwise, create a new predicate called <star/>
with a value of <star index="2"/>
This will produce a conversation as follows: