Hello everyone, today I would like to present you this AI light tool which helps us find answers to our questions. Let me give you a quick demonstration.
So, let’s quickly log in to the application. Don’t worry, just use anyone’s username and password. Here I am on the home page of my website.
Now, let’s ask, ‘What is AI?’ and then click on the search button. Let’s wait for a brief amount of time and see what it comes up with.
Okay, we are getting an answer. It says that the various fields of AI research are centered around practical courses and the use of particular tools and software. So, you get the idea, right? This tool will provide an answer related to what you ask for. However, please note that this application is currently at an experimental level, so it may not be 100% accurate.
Let me show you how I implemented this. For the front-end, I used React with the Material-UI library. I have two routes, one for the home page and one for the login page.
For the back-end, I used Node.js and a package called Puppeteer. This package helps us find the answer to our query. Here’s how it works: I get the query from the request body and then launch Puppeteer, which will run a headless browser in the background. It will go through search engines and try to find the answer to our query.
For example, here I’m querying from Bing.com. I go through each result and then visit each page to grab the relevant paragraphs. Then, I have a function that interprets the question and determines what kind of answer to give. I exclude certain words from the query to make the answer sound more human-like. Finally, I return five sentences from the paragraphs I found.
That’s basically it. Right now, the application requires login and password, and I use JWT token to authenticate the user. I hope you like it. If you’d like, I can provide you with a code example.
Thank you for watching!