minfawang / chatter

Chatbot Starter (with RAG)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chatter

The Chatbot Starter (with RAG). This project is a demo for a chatbot with RAG functionality. The chatbot will act as George, a virtual sales agent for a coffee machine brand Bruvi to answer the user's questions with references to the pages on Bruvi website. The project also demonstrates serving with different model types: human, custom hosted model, OpenAI with RAG. The user can toggle the model from the UI.

The project is designed for educational purpose, with only the minimal and most essential dependencies. It can be used to understand how the system operates under the hood, and is easily customizable.

UI

screenshot

RAG diagram

The diagram below shows the flow of RAG. This repo only implements the online part. The offline part is in the scrapy-demo repo.

rag_diagram

Tech stack

It uses numpy to build the in-memory "vector database" for RAG.

Getting Started

First time

Update SUPABASE_PROJECT_URL and SUPABASE_ANON_KEY in supabase.tsx if necessary.

Also, create .env file. See .env.example for an example.

Dev

Run the backend server:

pipenv shell
cd api
uvicorn index:app --reload

Run the frontend development server:

npm run dev

Open http://localhost:3000 with your browser to see the result.

About

Chatbot Starter (with RAG)

License:MIT License


Languages

Language:TypeScript 72.8%Language:Python 16.8%Language:JavaScript 6.9%Language:CSS 3.5%