Fast, minimal, multi-platform chatbot framework for NodeJS
var yowl = require('yowl');
var bot = yowl();
bot.name = "Echo Bot";
var local = require('yowl-platform-cli');
bot.extend(local);
bot.use(function(context, event, callback) {
var message = event.message;
event.send(message, callback);
});
bot.run();$ npm install yowl yowl-platform-cli
$ node bot.js --localReminder Bot - Leverages a combination of yowl packages to create a bot that allows users to set reminders for themselves.
$ npm install yowl --saveYowl is a chatbot framework that is structured in a similar way to express.
It is unopinionated and comes with very little out of the box. It allows you to chain together middleware that helps you do things like
- connect to chat platforms
- run classifiers on in-bound messages
- add persistentence
- structure and manage multi-message dialogs
This is not necessarily an exhaustive list but rather a good starting point for tools you can use to build your bot.
To talk to your users, bots need to integrate with outside platforms.
- yowl-platform-cli - allows you to interact with a bot via the command line by using the
--localflag - yowl-platform-facebook - quickly deploy a bot to facebook messenger
- yowl-platform-ws - provide a bot interface directly via websocket, includes javascript client library
planned middleware: telegram platform, sms platform
You will most likely want to maintain an on-going state for interactions your users have with your bot. These modules take care of that.
- yowl-session-memory - in-memory session persistence. good for getting up and running with a development environment or for testing.
- yowl-session-redis - good for bots that don't need to keep a lot of session information and need quick session access.
- yowl-session-rethink - good for deployed bots that may benefit from rethinkdb's ease of operation/scaling
Often you'll wait your bot to perform an asynchronous call to an external API or send multiple messages in reply to a user query. Locking allows you to limit a user to one active request at a time.
- yowl-lock-redis - locking backed by redis, based on the nodejs redlock implementation
planned middleware: in-memory locking
Bots aren't useful if they can't handle multi-step interactions with your users.
- yowl-dialog-manager - a structured approach for defining and chaining dialogs, making it easier to create complex workflows for your bot
Often, you'll want to schedule some processing and messaging to take place asynchronously or at some point in the future.
- yowl-jobs-kue - Job runner/scheduler that leverages kue under the hood.
You're going to need to make sense of text.
- yowl-parse-dates - Parse dates from natural language text strings
- yowl-classifier-bayes - Naive bayes classifier for assigning categories to messages
Examples can be found at brianbrunner/yowl-examples.
The author of Yowl is Brian Brunner