AI Zone Admin Forum Add your forum

NEWS: survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Short-term memory for a chatbot?

Hi everyone,

I’m making a chatbot in PHP. I’m not using any existing bots, because I want to know how to make one myself.
I made a simple bot that uses supervised learning method. Basically, a visitor can tell anything to the bot and in admin panel I can set an answer to that question(like in Pandora bots), or I can pick an existing answer.
What I’m really interested in, is: how do you make a short-term memory for a bot?

Also, I see many topics here covering knowledge databases and I don’t understand why are they needed? As far as I know, it’s for unsupervised learning.

Please excuse any grammar mistakes as it is very late and I am tired.
Looking forward to hear your opinions and tips!


  [ # 1 ]

Hi, Stephan, and welcome to! smile

There’s certainly nothing wrong with “re-inventing the wheel”; Lord knows I’ve done it countless times. That you want to create something that is all your own, and therefore unique speaks of a “can do” spirit, and is to be commended. There are several people here who are doing the same thing, though generally using different approaches, so don’t feel alone. smile

I have a couple of questions regarding your post, and the answers to these questions will help me to better answer yours:

1.) Exactly what do you mean by “short term”? Are we talking about remembering something that was “said” a few vollies back, or maybe the current browser session? Or did you have a longer time frame in mind (like, say, a week or so)?

2.) Do you have access to any sort of database (even if it’s just a “flat file” database)? If so, that offers more opportunities and options for storing “short term” data.

As far as the notion of knowledge databases is concerned, they can be very useful if handled properly. Access to some sort of knowledge base, whether it’s a grammar ontology, a list of songs, the SIMBAD Astronomical Database, or just about any other means of retrieving “knowledge data” can significantly improve the quality of a chatbot’s responses. the key is to know what you want your chatbot to “know”, and to find an effective means of translating database entries from your chosen source(s) into something that makes for good conversation. More often than not, the information stored in nearly all types of knowledge base is nothing more than a collection of facts, and unless some care is taken to transform those facts into engaging conversation, your chatbot’s responses won’t be satisfying. To my way of thinking, this has little to nothing to do with “supervised learning”, where just about any Tom, dick or Harriette can instruct your chatbot how to spel rong, use bad %&^$ing words, or talk about sex (can you tell that I have misgivings about letting visitors tell my chatbot how to converse?). The use of knowledge base style information sources is generally used more with expert systems (though not always), where specific, often very specialized information needs to be imparted to the visitor.


  [ # 2 ]

Thanks for the elaborate answer!

When I say short term, I’m talking about the current browser session.
I use MySQL database.

Could you give me a simple example of how a knowledge DB could be used? Just an example of a bot conversation.

Thank you again for the answer!


  [ # 3 ]

Ok, this is going to be a bit odd, because I’m going to point you to a page on my site that is NOT a chatbot. Not to worry, though, it’s relevant. smile

Late last year, I decided to create a Virtual Telescope because I wanted to expand on a smaller, less feature rich version that I had created for my chatbot, Morti a few years ago. The PHP script that runs the telescope uses not one, but three different “knowledge base” databases to obtain the data necessary to serve the visitor’s needs. They are:

1.) The SIMBAD Astronomical Database
2.) NASA’s APOD image Database
3.) The Wikipedia API

When a visitor searches for a celestial object (the Eagle Nebula, for example) the telescope script first searches a “local” DB for the necessary information, such as the object’s coordinates, basic information of the object (e.g. description, history, attributes or any other useful or interesting data), and other pertinent details. If an entry is found, then the script “points” the Google Earth plugin to the correct coordinates, and loads a special file that presents the information found in the database, all “on the fly”.

However, if the object is not found in the local database, the script searches SIMBAD for coordinate data, and Wikipedia for descriptive information. If SIMBAD can’t find coordinates, a search of NASA’s APOD image database is made, and the script randomly selects an image from a list returned by APOD.

Now you’re probably thinking, “That’s all well and good, but how does this apply to a chatbot?”

That’s a valid question, and worth asking. Simply put, while my virtual telescope is certainly not a chatbot, it DOES perform similar tasks, in that an input is given by a user, and a response is given back. The difference is that the telescope doesn’t entirely rely on a locally stored set of data, but can request information from outside sources, in order to fulfill the user’s request. It’s no different with a chatbot, really. At least, it ~SHOULDN’T~ be. smile


  login or register to react