kashishgupta/Crowd_sourced_FAQ_Project
0
1---2title: CSFAQ Project3emoji: ๐ป4colorFrom: purple5colorTo: red6sdk: docker7app_port: 78608pinned: false9---10 11# FAQ RAG Chatbot12 13RAG chatbot for a FAQ knowledge base. Uses FAISS for vector search with dense embeddings and a BM25 hybrid retriever.14 15## Requirements16- Python 3.11+ (this repo uses 3.13 in the dev environment)17- Virtualenv with dependencies in `requirements.txt`18 19## Quick setup201. Activate virtualenv:21```powershell22cd C:\Users\gupta\Desktop\faq-ai-chatbot23myenv\Scripts\Activate.ps124```252. Install packages:26```powershell27pip install -r requirements.txt28```293. Copy `.env` and add keys:30```powershell31copy .env.example .env32```33 34## Environment variables (`.env`)35- `GOOGLE_GENAI_API_KEY` โ API key for the Google GenAI LLM36- `HF_TOKEN` โ Hugging Face token to avoid unauthenticated download slowdowns37 38## Build the vectorstore39Run once to compute embeddings and persist the FAISS index:40 41```powershell42myenv\Scripts\python.exe build_index.py43```44 45On first run this can take ~15โ25s depending on hardware and network.46 47## Run CLI48```powershell49myenv\Scripts\python.exe cli.py50```51 52## Run API53```powershell54myenv\Scripts\python.exe -m uvicorn app:app --reload55```56 57Then POST JSON to `http://127.0.0.1:8000/chat`:58```json59{ "question": "What is VINS?" }60```61 62## Notes63- The first run must compute embeddings if the index does not exist.64- To avoid repeated downloads and speed up startup: set `HF_TOKEN` and run `build_index.py` once.65- Do not commit `vectorstore/`, `myenv/`, or `.env`.66 