DEV Community

Cover image for Open source AI powered virtual assistant
Elvis Ansima
Elvis Ansima

Posted on

6 1 1 1 2

Open source AI powered virtual assistant

This is a submission for the Cloudflare AI Challenge.

What I Built

We built a customizable chatbot using Cloudflare AI Workers that responds to custom questions with pre-defined answers, leveraging text vectorisation and AI text generation for natural conversational interaction.

In the age of AI, it's really important to think of it as an opportunity to grow your business, not a threat. Imagine having a virtual assistant that knows everything about you and your business, that can handle multiple customers at once, that can also speak in the customer's local language, that can give them accurate information and help them understand your product in a second - yes, we've done a demo of this with AI thanks to Cloudflare's AI workers.

Demo

Please go to: https://ai-chatbot-demo.pages.dev and ask the chatbot about me 😍

⚠️Currently the site has not login, so be responsible, don't abuse

My Code

GitHub logo ElvisAns / ai-chatbot-demo

A customizable chatbot using Cloudflare AI Workers that responds to custom questions with pre-defined answers, leveraging text vectorisation and AI text generation for natural conversational interaction.

AI Chat Bot

We built a customizable chatbot using Cloudflare AI Workers that responds to custom questions with pre-defined answers, leveraging text vectorisation and AI text generation for natural conversational interaction.

66e5b2a0-e9d5-4a24-bf24-c5f4a76d4b38.mp4

Please check the Demo at : https://ai-chatbot-demo.pages.dev

⚠️ Currently the site has not login/signup, so please be responsible, don't abuse!

Technology used

We're using vector embedding to sort of train our AI to respond to users questions with predefined answers, all without having to train the AI in a formal way, which can be difficult and expensive.

On the AI backend side we are using 2 models :

The entire frontend is built with NuxtJs

We also have a D1 https://developers.cloudflare.com/d1/ database that help us store our questions and answers

How does it work

We have a database that store questions and answers, when our frontend query…

Journey

We could have gone strictly by prompting the AI, of course it can work but scarify the accuracy. Thanks to #vectorize we were able to do the search from a pre-defined QA set, then pass the data to the right AI model for text generation.
After testing many models I stuck with @cf/meta/llama-2-7b-chat-int8, it has accurate answers, it understands context well and provides more fun answers.

I also discovered that for the AI to give accurate answers, the prompt must also be accurate, a slightly unclear sentence in the prompt can lead to weird behaviour.

This can go a long way and use a translation model to talk to a user in their local language, which can be a great addition to a chatbot like this.

Multiple Models

On the AI backend side we are using 2 models :

Agent.ai Challenge image

Congrats to the Agent.ai Challenge Winners 🏆

The wait is over! We are excited to announce the winners of the Agent.ai Challenge.

From meal planners to fundraising automators to comprehensive stock analysts, our team of judges hung out with a lot of agents and had a lot to deliberate over. There were so many creative and innovative submissions, it is always so difficult to select our winners.

Read more →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay