Saving data in real time in AIML?

Hello is there a posibility to save data in realtime in AIML?
I spend lot of time by search and write a lot of aiml but if I turn off the myrobotlab and start it again all the data is lost. 
Example:

<?xml version = "1.0" encoding = "UTF-8"?>
<aiml version = "1.0.1" encoding = "UTF-8"?>
   <category>
      <pattern>I am *</pattern>
      <template>
         Hello <set name = "username"> <star/>! </set>
      </template>  
   </category>  
   
   <category>
      <pattern>Good Night</pattern>
      <template>
         Hi <get name = "username"/> Thanks for the conversation!
      </template>  
   </category>  
   
</aiml>

In teory i tel the bot what my name is and it is ok until I don't restart AIML. After restart the username is uknown.

moz4r's picture

Hi this it what i use. maybe

Hi this it what i use. maybe it's not a good way , maybe it can help you

http://myrobotlab.org/content/bot-memory

bartcam's picture

Working in Realtime and save new aiml file but...

Hello, this works in real time, it is saving new aiml file with all the structure. But it seems that better to save file with data with ex. name and who are in xml format, and get from this file answers.
I konw it is nothing but it work!

<?xml version="1.0" encoding="ISO-8859-2"?>

<aiml>
<category>
    <pattern>*</pattern>
    <template></template>
</category>
 
 <category>
    <pattern>NEW FILE MY * NAME IS * </pattern>
    <template>
<random>
          <li>Writening</li>
          <li>OK</li>
     </random>
      <oob>
        <mrl>
          <service>python</service>
          <method>exec</method>
          <param>
import xml.etree.cElementTree as NOWY
 
aiml = NOWY.Element("aiml")
category = NOWY.SubElement(aiml, "category")
 
NOWY.SubElement(category, "pattern").text = u"WHAT NAME HAS MY <star/>"
NOWY.SubElement(category, "template").text = u"YOUR <star/> NAME IS <star index="2"/>"
 
tree = NOWY.ElementTree(aiml)
tree.write("nowy.aiml" , encoding='ISO-8859-2', xml_declaration=True)
 
 
 </param>
          </mrl>
        </oob>
      </template>   
   </category>
</aiml>