Skip to content
/ loobot Public

👽 Chatbot interface for UWaterloo Open Data API with Natural Language Processing of course 😉

License

Notifications You must be signed in to change notification settings

lpan/loobot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loobot

Chatbot interface for university of Waterloo Open Data API with Natural Language Processing!

How does it work?

Overall

  1. User sends a message to Mr. Goose on Facebook
  2. Facebook POSTs our /webhook/ endpoint with the message and an unique User ID.
  3. We extract the message and the User ID from the payload (logics in /src/server.js)
  4. We feed the message and the User ID to the respond function (/src/response/respond) then the respond function returns a smart response.
  5. We send the response along with the User ID back to Facebook
  6. Message shows up on Facebook Messenger

It seems that the respond function has a bunch of responsability! Let's break it down

Respond :: id -> message -> response

Note: We need sessions or maybe even a DB to track each user's activity. For example, we only want to ask our user's name once.

  1. A singleton that represents our chatbot's state will be instantiated when the server starts
  2. When respond function is called with an id and a message, we use the id to find if there already exits a session. Else we create a new session. Each session will be an object that stores the information of this particular user
  3. Along with information from session, we use natural, a nodejs natural language processing library to find out what does the user want. We will have this logics in a seperate function, let's call it decide for now. decide will dispatch an action (similar to flux right 😉)
  4. Our action (can be async. eg. make a call to uwaterloo endpoint) will get necessary data, format message then send it back to Facebook (essentially another action).

Think it is confusing af? I totally agree

Credits

Inspired by icechen1's uwgoosebot

Why this project? Why duplicate the effort?

  • Loobot does not use any proprietary third-party SaaS platform for AI or NLP.

About

👽 Chatbot interface for UWaterloo Open Data API with Natural Language Processing of course 😉

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published