Melissa-AI / Melissa-Core

A lovely virtual assistant for OS X, Windows and Linux systems.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How are chatbots made in a scalable fashion? And suggestions on how do we pull that in

vedmathai opened this issue · comments

If we want to get all chatbot-ty in our conversations there has to be some scalable method of doing it. In the sense we can't be writing if-else code as proxies for decision tree based chatbots. That is simply not scalable.
Ideally we should be writing python code that doesn't semantically understand what is being said and the actual meanings are dealt with through a service or database etc (or simply text files) that contain all content.
Now in the limited search that I did I found this to implement what I am saying: AIML
All the chats should be stored here. (XML, JSON, storage structure of your choice)
And conversations functionality act upon that.
Of the top of my head there can be the issue of making function calls based on the chat, which means the python code isn't fully oblivious to what is being said... so what that calls for is a hybrid version where conversation flow is handled separately and function calls alone to API's etc are done somehow.
I am opening it up for discussion.
Why I am saying this is, is in #116 while making something that could feel real I ended up writing so many lines of if-else statements that breaks all rules of coding and makes it feel wieldy and heavy.

Interesting @vedmathai! I did some research on AIML. My take on the subject of implementing AIML:

  • I really like the idea of taking all the responses that we have hard-coded into the general_conversations.py and storing them separately from the python code.
  • I had a look at AIML and the pattern matching system with makes use of <pattern> is not very sleek and not better than the mechanism that we use in the form of WORDS.
  • A solution might to be tweak the aiml library that python uses to parse the <pattern> tag in a better way that suits our requirements.

Observations and thoughts:

  • This would be useful for general_conversations.py which is essentially the chatbot module and not all the action modules.
  • Wouldn't it be better to also include the things that users say and store them in memory.db for future usage (say, Melissa quoting the user or machine learning)?
  • Should we choose such a markup syntax instead of instead of using the existing SQLite DB?

A new repo might be soon opened for solving this under https://github.com/Melissa-AI/.