Vex is an AI to talk to anyone, including lonely people.
This system is simple for now, does not have neural networks and is just a logical system.
The project is open source and licensed with MIT LICENSE to receive future contributions and improvements from the community, the icons under CC-BY-NC 2.0 license, check out Vex Reactions. This version of Vex(html5) has been discontinued and now has a version made in React, check out
The goal of this project is to one day have an AI capable of talking normally to a person, without errors or with minimal errors and who knows... be a conscious AI
Feature | Support |
---|---|
Database | Not for now |
Api | Not for now |
Synonyms | Yes |
React | Yes |
Check if a word in a sentence exists | Yes |
Machine learning | Not for now |
- This code instances a new database class where you pass an object with keys and values as your database
//Sample data
const sample_data = [{
message: [
"hi",
"hello",
"hola",
"oi",
"hola"],
answer: [
"hiii ╰(*´︶`*)╯♡",
"alright?",
"こんばんは",
"oi",
"hola"
]}]
//Create database
const vex = new Database(sample_data)
- Add a message with an answer to your database, if the message does not exist then it will be written and will return true
- If the third parameter is true and the recorded value exists, it writes the passed value asswer, otherwise it returns false
const message = "john"
const answer = "is cool"
Database.putData(message, answer, false)
- Remove a message from your database if that value exists. If the message is removed, it returns true and returns false whenever the message does not exist (delete something that does not exist)
const message = "hi"
vex.removeData(message)
- Checks whether each index exists in the database and returns an answer. otherwise returns null. The system also automatically checks for synonyms (that's why the messages are in an array)
const message_array = ["hello","world","!!!"]
vex.getAnswer(message_array)
//["hello", world", "!!!"]
// check hello, world and !!!
vex.getAnswer([message_array.join(" ")])
// ["hello world !!!"]
// put the sentence together and check it only
- Checks if the message passed has variants and returns an array with all of them, if not, returns null. works similarly to the previous method but returns all synonyms instead of an answer
const word = "hi"
const synons = Database.getSynons(word)
//["hi","hello","hola","oi","hola"]
- This code instantiates a new "Answer" class so we can easily write and retrieve sentences
//Sample data
const no_answer_list = [
"Não entendi",
"i didnt understand",
"うるさい",
"Silencio"
]
const noAnswer = new Answer(no_answer_list)
- Add a phrase to our catalog of phrases that Vex will say when it doesn't know an answer
const ph = "I didn't understand"
noAnswer.addAnswer(ph)
- Get a random phrase for our array
const anything = noAnswer.getAnswer()
//random value
- Remove a phrase by an index
const index = 0
noAnswer.removeAnswer(index)
- Change all the contents of the class
const newData = ["no","..."]
noAnswer.setData(newData)
- Save the database, messages etc
- Load and show all database, messages etc
- Add synonyms and answers
- Remove synonyms, answer, messages etc
- Change name and profile
- Delete all answers, synonyms etc
- Export data(messages, database, etc)
- Customize the chat
- Customize the background
Feature | Use |
---|---|
Custom animations | Customize animations in chat itens, database etc |
Machine learning | Make Vex learn on its own |
API | Make some resources available through an api |
"Global user" | A chat where people talk to vex (no interactions or global messages) but this serves as global training and not local (in the client) |
RPG story | Able to tell stories or run an rpg |
Library |
---|
Eva icons |
Octicons |