metadata
title: CSFAQ Project
emoji: 💻
colorFrom: purple
colorTo: red
sdk: docker
app_port: 7860
pinned: false
FAQ RAG Chatbot
RAG chatbot for a FAQ knowledge base. Uses FAISS for vector search with dense embeddings and a BM25 hybrid retriever.
Requirements
- Python 3.11+ (this repo uses 3.13 in the dev environment)
- Virtualenv with dependencies in
requirements.txt
Quick setup
- Activate virtualenv:
cd C:\Users\gupta\Desktop\faq-ai-chatbot
myenv\Scripts\Activate.ps1
- Install packages:
pip install -r requirements.txt
- Copy
.envand add keys:
copy .env.example .env
Environment variables (.env)
GOOGLE_GENAI_API_KEY— API key for the Google GenAI LLMHF_TOKEN— Hugging Face token to avoid unauthenticated download slowdowns
Build the vectorstore
Run once to compute embeddings and persist the FAISS index:
myenv\Scripts\python.exe build_index.py
On first run this can take ~15–25s depending on hardware and network.
Run CLI
myenv\Scripts\python.exe cli.py
Run API
myenv\Scripts\python.exe -m uvicorn app:app --reload
Then POST JSON to http://127.0.0.1:8000/chat:
{ "question": "What is VINS?" }
Notes
- The first run must compute embeddings if the index does not exist.
- To avoid repeated downloads and speed up startup: set
HF_TOKENand runbuild_index.pyonce. - Do not commit
vectorstore/,myenv/, or.env.