Create a RAG AI chatbot from scraped data of any website, leveraging the simplicity of OpenAI, low-code tools, background processing and Ruby on Rails.
- App:
Ruby 3.3.5
,Ruby on Rails 7.2
,Hotwire
,ActiveJob
,ActiveAdmin 4
,Docker
,Faraday
. - Low-Code LLM:
FlowiseAI
,OpenAI
. - Vector Database:
ChromaDB
. - Relational Database:
PostgreSQL
. - Scraper:
FastAPI
,Python
. - Screenshoter:
Puppeteer
,Node.js
.
This project enables you to create a RAG (Retrieval-Augmented Generation) AI chatbot from any website's data in just seconds!
-
Instant Website Integration:
Simply provide the website's URL via a parameter or through the admin panel. -
Automated Pipeline:
Once the URL is provided, the app triggers the following processes:- Scrape Website Data: Extracts relevant content from the provided website.
- Create Document Store: Stores the data in FlowiseAI for seamless retrieval.
- Generate Embeddings: Converts the scraped content into embeddings and uploads them to ChromaDB.
- Set Up Chatflow: Automatically creates a chatflow in FlowiseAI for conversational interactions.
- Website Screenshot: Captures a high-quality screenshot of the website.
-
Embedded Chatbot Interface: The chatbot is displayed beautifully with the scraped website as the background. Users can ask questions about the website's content and get accurate AI-powered answers in real-time.
- Input a URL.
- Watch the magic happen as the app processes the website in the background (builds the chatbot, and integrates it seamlessly).
- Start asking questions and receiving contextually accurate answers based on the website's data.
- Simplifies chatbot creation with minimal effort.
- Provides a visually appealing and user-friendly experience.
- Leverages the power of AI to answer questions directly from website data.
Home Page:
The home page of the app where you can input the URL of the website you want to create a chatbot for or login to the admin panel.
Admin Panel:
Manage the companies added to the system, from which the chatbots are created.
You can also view the chatbot creation history and manage the chatbot creation process, with the ability to view the chatbot's details (like the chatflow ID, document store ID, errors, scraped data, screenshots, etc.).
FlowiseAI Integration:
The app leverages the power of FlowiseAI to create a seamless chatbot experience. The chatbot is trained on the scraped website data and can answer questions accurately using upserted vector store with embeddings.
The chatflow is very simple and only connects the chatbot to the document store.
Clone the whole monorepository before starting the setup and navigate to the root directory of the project.
- Go to
llm
directory. - Run
docker compose up -d --remove-orphans
to start the FlowiseAI, ChromaDB and PostgreSQL. - Enter the FlowiseAI by opening the URL
http://localhost:3020/
- Login with
admin:admin
credentials. - Go to
Credentials
and create a new credential with the following details:- Name:
OpenAI
- API Key:
<your-openai-api-key>
- API Key:
- Name:
Postgres
- user:
postgres
- password:
postgres
- user:
- Name:
- Go to the
scraper
directory. - Create a new virtual environment with
python -m venv env
. - Activate the virtual environment with
source env/bin/activate
. - Install dependencies with
pip install -r requirements.txt
. - Run the scraper with
fastapi dev main.py --port 3002
.
- Go to the
screenshoter
directory. - Install dependencies with
pnpm install
. - Run the screenshoter with
pnpm start
.
- Go to the
app
directory. - Install gems with
bundle install
. - Setup the database with
./bin/setup
. - Run the Rails app with
./bin/dev
and open the URLhttp://localhost:3000/
.