Published on

Project: Corvo AI Chatbot Builder

Authors

Corvo Project


Introduction

Corvo is a platform for creating embeddable Chatbots capable of learning about your business through documentation texts and links.

Motivation

I've been studying RAG (Retrieval-Augmented Generation) techniques for some time and unfortunately ended up falling into "tutorial hell". Don't get me wrong, I discovered new interesting channels on Youtube about AI as well as some open-source projects related to the subject, but after some time just consuming content, I felt that I wasn't fully understanding the subject and needed to put it into practice. This was the beginning of the Corvo project.

How it Works

Corvo Project

The process of creating a chatbot follows these steps:

  1. The user logs in to the admin panel
  2. Accesses the "Agents" tab
  3. Clicks "Create agent"
  4. Inserts the name of the chatbot, text or website that the user wants the chatbot to learn
  5. Clicks "Save Agent"
  6. The /api/agent/mutate endpoint is called, creating a new agent in the database and generating the chatbot's knowledge embeddings based on the text and website provided
  7. The user can now copy the chatbot's script and embed it in their site

The Project

The Corvo project is organized into two main repositories:

  1. Corvo Chatbot - Embeddable Chatbot
  2. Corvo Admin - Control panel for creating and managing chatbots

Corvo Chatbot

The Corvo Chatbot project is an embeddable chatbot that can be easily added to any website. It is built with Vite and Rollup, making it easy to create a custom script to be embedded in any site.

Corvo Admin

The Corvo Admin project is a control panel for creating and managing chatbots. It is built with Next.js, Shadcn, Tailwind, and Lucide.

Technologies

The project is based on these three main technologies:

  1. Langchain
  2. Google Gemini
  3. Supabase

Langchain

Langchain is an open-source framework for developing AI applications. It streamlines the process of creating RAG applications and has extensive documentation on the subject.

Google Gemini

Google Gemini is a proprietary language model developed by Google. It can be used to generate and translate texts, answer questions, etc. At the time of writing this article, the project uses the text-embedding-004 model to generate the chatbot's knowledge embeddings and the gemini-1.5-flash model to generate the chatbot's responses.

Supabase

Supabase is a cloud database that can be used to store chatbot data. In this project, it is used both to store user authentication data and to store the chatbot's indexed RAG knowledge (embeddings).

Why this name? 🤔

Ravens (Corvos in Portuguese) are among the most intelligent birds. They are capable of learning to imitate human voice (just like parrots), count out loud and some even use tools to obtain food.

In other words, they:

  • Are capable of generating sounds similar to what they heard from other animals
  • Are capable of learning through trial and error
  • Use external tools to achieve their goals

These points can be compared with the following AI characteristics/techniques:

Fun fact: Initially I thought about naming the project Toth, referencing the Egyptian god of knowledge (called Thoth in English). However, I discovered that there's already an AI project with a very similar name: Thoth AI

Mentions

Youtube Channels

Some channels that helped with these studies:

  1. @ColeMedin
  2. @AIJasonZ

Open-source Projects

Open-source projects that served as a base or inspiration for Corvo:

  1. Makerkit - Next.js Supabase SaaS Starter Kit
  2. Makerkit - React Embeddable Widget Starter
  3. Newoaks AI React Chat Bubble