Spaces:
Runtime error
Runtime error
| title: Amazon Analytics Chatbot | |
| emoji: 📦 | |
| colorFrom: blue | |
| colorTo: green | |
| sdk: docker | |
| app_port: 8501 | |
| pinned: false | |
| license: mit | |
| short_description: RAG + SQL chatbot for Amazon seller analytics (demo data) | |
| # 📦 Amazon Analytics Chatbot | |
| A Streamlit chatbot (Docker-backed) that answers questions about Amazon seller | |
| analytics using **SQL templates** for quantitative queries and **FAISS semantic | |
| search (RAG)** for qualitative ones. | |
| ## 🏗️ Architecture | |
| - **SQL Engine** — SQLite + SQLAlchemy, template-based query generation | |
| - **RAG** — `sentence-transformers/all-MiniLM-L6-v2` embeddings + FAISS index | |
| - **LLM** — Hugging Face Inference API (default: `Qwen/Qwen2.5-7B-Instruct`) | |
| - **UI** — Streamlit with a custom dark theme, served via Docker | |
| ## 📁 Files | |
| ``` | |
| Dockerfile ← Build & run instructions | |
| requirements.txt ← Python deps | |
| src/ | |
| ├── streamlit_app.py ← Streamlit UI (entry point) | |
| ├── rag_core.py ← RAG + SQL engine | |
| ├── company_data.db ← SQLite database (demo data) | |
| ├── rag.index ← FAISS vector index | |
| └── rag_chunks.parquet← Chunk metadata | |
| ``` | |
| ## 🔑 Secrets | |
| In **Settings → Variables and secrets → New secret**, add: | |
| - `HF_TOKEN` — your Hugging Face access token (read scope) | |
| Optional: | |
| - `HF_MODEL` — override default model, e.g. | |
| `meta-llama/Llama-3.2-3B-Instruct` | |
| ## 💡 Example Questions | |
| - "Total revenue in 2023 Q1" | |
| - "Monthly sessions trend last 30 days" | |
| - "Top search terms by spend" | |
| - "2024 H1 B2B revenue by state" | |
| > The included database contains **demo / synthetic data** only. | |
| ## 📝 License | |
| MIT | |