How phuchuwu/cellphones_chatbot works
Project type and purpose
• This is a full-stack web application (CellphoneS Chatbot) that uses a Retrieval-Augmented Generation (RAG) pattern to power a customer-support chatbot.
• Purpose: scrape product/policy/FAQ data from CellphoneS, index it via FAISS + Sentence Transformers, query it at runtime, augment LLM (via Groq API) responses, and expose a web chat UI.
File structure
• Top-level:
• app.py: Flask server & API endpoints
• rag_pipeline.py: Orchestrates RAG (search + LLM call)
• crawldata/: Selenium scripts to scrape CellphoneS website
• data/: scraped JSON artifacts
• embeddings/: FAISS index + metadata
• utils/: chunking & embedding helpers
• frontend/: static web UI (HTML/CSS/JS)
• Config & deps:
• requirements.txt, .env (Groq API key), .gitignore
• Patterns:
• One monolithic backend with clear separation:
– Data ingestion layer (crawldata + utils)
– Indexing layer (utils.embedding + rag_pipeline building index)
– Serving layer (Flask + rag_pipeline query)
• RAG pattern: split → embed → index → search → LLM
README for additional insights
Frontend ↔ Flask Backend ↔ LLM + FAISS RAG
• Technology stack: Python 3.10+, Flask, Selenium, Sentence Transformers, FAISS, Groq LLM, scikit-learn, pickle, CORS.