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.
The diagram below shows the flow of RAG. This repo only implements the online part. The offline part is in the scrapy-demo repo.
- Next.js (Frontend, SSR)
- Supabase (Database, PubSub)
- FastAPI (Backend)
- pipenv (Python virtual management)
- shadcn/ui (UI components, Tailwind CSS)
It uses numpy to build the in-memory "vector database" for RAG.
Update SUPABASE_PROJECT_URL
and SUPABASE_ANON_KEY
in supabase.tsx if necessary.
Also, create .env
file. See .env.example for an example.
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.