A multi-platform, serverless chatbot skeleton, with support for Natural Language Processing services, Sentiment Analysis and Analytics.
Available integrations:
- Chatbase (analytics)
- Dialogflow (Natural Language Processing)
Upcoming integrations:
- Amazon Comprehend (analytics) + Amazon Translate (translation)
- Amazon Lex (Natural Language Processing)
- Runs on
AWS Lambda, based onclaudia-bot-builder - Supports multiple messaging platforms: Facebook, Skype, Slack, Telegram, Viber
- Supports Amazon Echo (Alexa)
- Built-in Chatbase integration for usage analytics
- Built-in Dialogflow integration for Natural Language Processing
Node.js 6.10(depends on availableAWS Lambdaruntimes)
- An
Amazon Web Servicesaccount
- Create a new
agent - Zip the
/config/dialogflowdirectory (zip the whole directory from "outside") - Open the
agentsettings - Go to
Export and Import - Choose
Restore from zip - Select the
.zipfile created at step #2
Being based on Claudia.JS tools and bot framework, deploying the bot is a simple and straightforward operation. Please refer to the official claudia-bot-builder tutorial, paragraph: Deploying the bot.
It's also worth reading the tutorial on managing multiple environments in Lambda.
Please note that claudia commands MUST be ran from the /src directory. If is not installed "globally", you can use the local copy packaged with the sources: $ ./node_modules/.bin/claudia.
Set the following environment variables in the AWS Lambda function created with claudia:
| VARIABLE NAME | DESCRIPTION |
|---|---|
DIALOGFLOW_CLIENT_ACCESS_KEY |
Dialogflow Client Access Token |
CHATBASE_API_KEY |
Chatbase API Key |
Environment variables can also be set with claudia, using the --set-env and --set-env-from-json option switches.
Run: $ ./node_modules/.bin/claudia create --help from the /src directory for info.
claudia also supports AWS KMS to encrypt environment variables values, see the "help" for the --env-kms-key-arn option switch.
This project includes a local copy of its dependencies, stored in the /src/node_modules directory. This practice is known as "vendoring" and is not generally considered a best practice, but an annoying and dangerous incident happened not even long ago in the Node.JS community made me re-evaluate it. You can find good coverage of the incident searching for: "node.js broke the internet", such as:
- http://www.businessinsider.com/npm-left-pad-controversy-explained-2016-3
- http://www.zdnet.com/article/disgruntled-developer-breaks-thousands-of-javascript-node-js-apps/
- https://medium.com/@Rich_Harris/how-to-not-break-the-internet-with-this-one-weird-trick-e3e2d57fee28
To perform a fresh installation of all the dependencies, just remove all files from the /src/node_modules directory and run: $ npm install from the /src directory.