I am going to change gears a little bit here by switching from Python to Node.js, because I really want to test drive Hubot from Github. I am following the instructions from their site, so will quickly run through those and then get more into the claims processing after I get Hubot up and running.
D:\development\projects\chatbot\hubot>npm install -g yo generator-hubot
[...]
Everything looks all right!
+ yo@3.1.0
+ generator-hubot@0.4.0
added 855 packages from 312 contributors in 75.888s
D:\development\projects\chatbot\hubot>mkdir myhubot
D:\development\projects\chatbot\hubot>cd myhubot
D:\development\projects\chatbot\hubot\myhubot>yo hubot
? ==========================================================================
We're constantly looking for ways to make yo better!
May we anonymously report usage statistics to improve the tool over time?
More info: https://github.com/yeoman/insight & http://yeoman.io
========================================================================== Yes
_____________________________
/ \
//\ | Extracting input for |
////\ _____ | self-replication process |
//////\ /_____\ \ /
======= |[^_/\_]| /----------------------------
| | _|___@@__|__
+===+/ /// \_\
| |_\ /// HUBOT/\\
|___/\// / \\
\ / +---+
\____/ | |
| //| +===+
\// |xx|
? Owner (Biskilicious )
? Bot name myhubot
? Description An insurance bot for processing claims
? Bot adapter campfire
create bin\hubot
create bin\hubot.cmd
create Procfile
create README.md
create external-scripts.json
create hubot-scripts.json
create .gitignore
create package.json
create scripts\example.coffee
create .editorconfig
_____________________________
_____ / \
\ \ | Self-replication process |
| | _____ | complete... |
|__\\| /_____\ \ Good luck with that. /
|//+ |[^_/\_]| /----------------------------
| | _|___@@__|__
+===+/ /// \_\
| |_\ /// HUBOT/\\
|___/\// / \\
\ / +---+
\____/ | |
| //| +===+
\// |xx|
npm notice created a lockfile as package-lock.json. You should commit this file.
+ hubot-heroku-keepalive@1.0.3
+ hubot-google-images@0.2.7
+ hubot-maps@0.0.3
+ hubot-google-translate@0.2.1
+ hubot-help@1.0.1
+ hubot-redis-brain@1.0.0
+ hubot-pugme@0.1.1
+ hubot-scripts@2.17.2
+ hubot@3.3.2
+ hubot-diagnostics@1.0.0
+ hubot-rules@1.0.0
+ hubot-shipit@0.2.1
added 92 packages from 53 contributors and audited 183 packages in 7.426s
found 0 vulnerabilities
D:\development\projects\chatbot\hubot\myhubot>
And we're done with step 1. Let's start Hubot and feed in a few canned basic commands:
D:\bin\hubot
audited 183 packages in 1.182s
found 0 vulnerabilities
No history available
myhubot> [Mon Jul 15 2019 11:43:40 GMT-0700 (Pacific Daylight Time)] WARNING Loading scripts from hubot-scripts.json is deprecated and will be removed in 3.0 (https://github.com/github/hubot-scripts/issues/1113) in favor of packages for each script.
Your hubot-scripts.json is empty, so you just need to remove it.
[Mon Jul 15 2019 11:43:40 GMT-0700 (Pacific Daylight Time)] INFO hubot-redis-brain: Using default redis on localhost:6379
[Mon Jul 15 2019 11:43:40 GMT-0700 (Pacific Daylight Time)] ERROR hubot-heroku-keepalive included, but missing HUBOT_HEROKU_KEEPALIVE_URL. `heroku config:set HUBOT_HEROKU_KEEPALIVE_URL=$(heroku apps:info -s | grep web.url | cut -d= -f2)`
myhubot> help
usage:
history
exit, \q - close shell and exit
help, \? - print this usage
clear, \c - clear the terminal screen
myhubot> \q
We now have Hubot up and running. It's time to find some scripts to help build out Hubot's vocabulary:
npm search hubot-scripts *

A quick search through NPM yields that there are no Insurance or Claims related scripts, which is unfortunate, but expected. I instead opted for a Greetings module to test importing an external script module:
npm install --save hubot-greetings
Which gives us:

And, you need to add it to the external-scripts.json:
[
[...],
"hubot-greetings"
]
Now, if we fire up Hubot and test some of the canned commands, we get the following:

and to give you the idea of what a "Pug Bomb" is...

So, all is working well...now onto building something resembling a Claims Processor for insurance. If you open the myhubot/scripts directory, there is an example.coffee file that can be used as a template. I copied it into claims.coffee and deleted all of the commented out examples. Which should look like this when empty:
module.exports = (robot) ->
Because I am following a bit of template throughout these articles, we'll start with the same phrasings as before. In my claims.coffee script, I added the following:
module.exports = (robot) ->
robot.hear /submit a claim/i, (res) ->
res.send "OK. I can help you with that. May I have your full name (first_name last_name)?"
Which basically states that when Myhubot hears the phrase "submit a claim", it will reply with "OK. I can help you with that. May I have your full name (first_name last_name)?"

Perfect. Now, we want to add a little logic so that when myhubot receives the name, it will distinguish between the first name and the last name, and respond accordingly. It will be able to use the name to later actually look up a policy by the name:
robot.hear /My name is (.) (.)/i, (res) ->
first_name = res.match[1]
last_name = res.match[2]
res.reply "Thank you #{first_name}"
Now that we have captured the first and last name, we can add a placeholder for looking up the policy:
res.reply "Give me a moment while I look up your policy."
POLICY_FOUND = true #this is where the lookup will be
if POLICY_FOUND is true
res.reply "I found your policy."
res.reply "When did the accident occur?"
else
res.reply "I am unable to find your policy. Do you have your policy number available?"
Now, we want to capture the date. Here's the issue, we can't use one word responses from the user to get Hubot to record as one thing versus the other, so we have to give it markers on which to latch onto and perform the logic for that particular step. For example, "It happened on {the incident date}." Now, if the user types "It happened on ... ", Hubot will know that the next value will be the date of the incident. For example:
robot.hear /It happened on (.*)/i, (res) ->
incident_date = res.match[1]
res.reply "OK. Now tell me what happened on #{incident_date}. Start with 'The accident'."

Now, if we code some logic for the phrase "The accident...", hubot will record everything after "The accident" as the incident_details:
robot.hear /the accident (.*)/i, (res) ->
incident_details = res.match[1]
res.reply "OK. The incident was as follows: #{incident_details}."

Finally, we need to add a bit of logic to test whether we captured the information correct:
res.reply "If this is correct, type CORRECT. If this is incorrect, type INCORRECT."
robot.hear /correct/i, (res) ->
claim_number = Math.random()
res.reply "Thank you. Your claim number is #{claim_number}. We will send you an update as soon as it is processed."
robot.hear /incorrect/i, (res) ->
res.reply "OK. Please tell me again what happened."

Putting it all together, we have a basic chatbot that can capture the name, the date of the incident and the incident details. I know my policy number isn't up to par, but this could easily be changed adding a little range to the random call. If I wasn't writing this article, the entire project would have take about 20-30 minutes to complete.
With Hubot, we can use JSON, coffee script, and XML as sources, and we have all of the power of javascript with the simplicity of coffee scripting. It's really quite amazing at how flexible and extendable this module is. With Rasa, you have the power of using natural language, but you were required to "train" your chatbot to use the language in the correct syntax. Here, we have a fairly straight-forward process in submitting a claim, so we don't need the rigor of natural language to support us. We can program in a few key phrases like "incident" or "accident". I am thoroughly impressed with this little gem and am glad I stumbled across it!
Let me know your thoughts on Twitter.