fossasia/chat.susi.ai

Name: chat.susi.ai

Owner: FOSSASIA

Description: SUSI AI web client at https://chat.susi.ai/

Created: 2016-07-17 09:56:00.0

Updated: 2018-05-24 15:03:10.0

Pushed: 2018-05-24 16:32:05.0

Homepage:

Size: 260187

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

chat.susi.ai

Weblate Codacy Badge Build Status Gitter Twitter Follow

Susi is an artificial intelligence system, combining pattern matching, internet data, data flow-, and inference engine principles. Through some abilities to reflect, it can remember the user input to produce deductions and personalized feedback. Its purpose is to explore the abilities of an artificial companion and to answer the remaining unanswered questions. The SUSI.AI web chat is a front-end developed for web access of SUSI.

Deploy to Docker Cloud

Communication

Please join our mailing list to discuss questions regarding the project: https://groups.google.com/group/susiai/

Our chat channel is to be found on Gitter: https://gitter.im/fossasia/susi_webchat

Technology Stack
Components
Requirements
How to deploy?
Running on localhost
How to connect to Susi Hardware?
Running on Surge

Click this picture to see video about deploy! Watch the video

Still having problems? Watch this video to clear your doubts How to setup SUSI web-chat with surge

Deploying on Firebase

Click Here to read the set up guide

Click this picture to see a video for deploying on Firebase

Speech Recognition and Synthesis

The SUSI WebChat uses Web Speech API for speech recognition and synthesis. To test whether your browser supports Text To Speech, open your browser console and run the following:

msg = new SpeechSynthesisUtterance('Hello World');
ow.speechSynthesis.speak(msg)

If you get speech output, then the Web API Speech Synthesis is supported by your browser and the text-to-speech features of SUSI Web Chat will work. The Web Speech API has support for all latest Chrome/-ium browsers as mentioned in the Web Speech API Mozilla docs. However there are a few bugs with some Chromium versions please check this link on how to fix them locally.

Accounting, Anonymous User, Logged in Users

SUSI.AI can be used anomymously or as a logged in user by using the account features. The advantage logged in users is, that they the interaction history is synced across devices. More about accounting here.

Development
Retrieving User Chat History

Whenever a user logs in he must be able to view his chat history in the chat client. A user might also be using multiple chat clients, so the history across all platforms must be in sync.

A memory servlet is used to retrieve the user history.

api.susi.ai/susi/memory.json?access_token=ACCESS_TOKEN

When the client makes a call to the server to the above endpoint with the `ACCESS_TOKEN` of the logged in user, the server returns a list of cognitions which contain susi responses to the queries in the history.

The response from the memory servlet is of the form:


"cognitions" : [],
"session" : {},

A sample susi response is of the form :


"query" : 
"answers" : [ {
    "data" : [],
    "actions" : []
}],

So each cognition has `queryas well as ``answer ``` and thus we get a conversation message pair in the chat history.

The cognitions contain a list of SUSI responses of the above form using which chat history is rendered.

All the user messages are stored in a log file. The memory servlet digs out the history of the required user from the log file. The log uses the identity of the user and accesses only that information which has been stored for the user. If the user is not logged on, no information is available. The conversation log is NOT stored for a particular IP. It?s stored for an Identity within the AAA system. That identity can be represented with an email address, or there can be others.

Thus the synchronization of history across all chat platforms is maintained.

Folder Structure

After creation and a successful build, your project should have the following file structure:

.susi.ai/
ADME.md
de_modules/
ckage.json
blic/
index.html
c/
__tests__/
actions/
components/
constants/
dispatcher/
images/
stores/
utils/
App.test.js
ChatDataServer.js
history.js
index.css
index.js
setupTests.js
slintrc
ravis.yml
ploy.sh
CENSE
Translations
How to add translations in new languages for SUSI Web Chat Components using Weblate

Note

Colors and Fonts
Component Colors of Light theme
Component Colors of Dark theme
License

This repository is under a GNU LESSER GENERAL PUBLIC LICENSE 2.1.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.