A Chat bot using AS 3.0?

Hi my dear friends,
I am developing a chat bot using AS 3.0 with AIR (since SQLite database work with AIR only).
I would like to get your implementation ideas.
I would like to use SQLite database.
I have a got a couple of resources. But the way the database to be organized doesn’t click my mind.

One of my reference:

http://www.codeproject.com/KB/scrapbook/robomatic.aspx 

They mentioned separate database(each database consist of 2 more: a special and a matrix ones) for emotions like angry, sad, happy and fill them with contents.
Do you think its efficient. And there will be redundancy. And should the bot search all these database to see a matching.

Another one is based on 2 stage Bayesian algorithm by Korean Professors. But its too abstract for me to get it.

http://sclab.yonsei.ac.kr/publications/Papers/IC/A%20Two-Stage%20Bayesian%20Network%20for%20Effective%20Development%20of%20Conversational%20Agent.pdf

Could any one please help provide some insight to this.
Please give your better ideas to make a chat bot in AS 3.0

Meanwhile should I get the input from the user as string datatype?
Suppose a user need to find like : what is 2+3. will I be able to do that?
Thank You.