File size: 2,924 Bytes
0d113e0 265040a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | ---
title: Moops CRM Assistant
emoji: 📊
colorFrom: purple
colorTo: purple
sdk: gradio
sdk_version: 5.38.2
app_file: app.py
pinned: false
license: mit
short_description: Moops CRM Assistant
---
# 🛍️ Moops CRM Assistant — All‑in‑One
A full‑featured **Gradio‑based CRM web application** with built‑in LLM (Zephyr 7B), Markdown FAQ support, SQLite order tracking, multiple export formats, and email notifications.
---
## ✅ Key Features
| Category | Details |
|----------|---------|
| 🤖 LLM Assistant | Uses **`HuggingFaceH4/zephyr‑7b‑beta`** with streaming via `huggingface_hub`. |
| 🧠 Customizable Prompt | Free‑text “Assistant Strategy” plus **auto‑reply templates** (Greeting, Pricing, etc.). |
| 📄 FAQ Injection | Upload any `*.md` file or rely on the bundled `faq.md`; content is appended to the system prompt. |
| 🗄️ Order Log | Orders are saved to **SQLite `orders.db`** and can be previewed in the UI. |
| 💾 Export | One‑click export to **JSON / CSV / XLSX** or flush in‑memory logs to SQLite. |
| ✉️ Email Notifications | Gmail SMTP automatically notifies the manager; optional client copy; extra “Notify manager” button. |
| 🖥️ Gradio 4 UI | Dark‑mode friendly, supports markdown rendering in the chatbot. |
---
## 📦 Requirements
```bash
uv pip install -r requirements.txt
````
> Requires **Python 3.11+** and [`uv`](https://github.com/astral-sh/uv) for fast dependency installs.
---
## 🔐 Environment Variables
Create a `.env` file **(not committed to Git)**:
```ini
HF_TOKEN=hf_XXXXXXXXXXXXXXXXXXXXXXXXXXXX
GMAIL_LOGIN=your_gmail@gmail.com
GMAIL_APP_PASS=16_char_app_password
MANAGER_EMAIL=manager@example.com
```
> On Hugging Face Spaces, set the same variables under **Settings ➜ Secrets** instead of using a file.
---
## 🚀 Running Locally
```bash
uv run app_all_in_one.py
```
Open your browser at **[http://localhost:7860](http://localhost:7860)**.
---
## 📤 Deploying to Hugging Face Spaces
```bash
git remote set-url origin https://<USERNAME>:<HF_TOKEN>@huggingface.co/spaces/<USERNAME>/Moops
git add .
git commit -m "🚀 Initial release"
git push origin main
```
The Space will rebuild automatically and expose the Gradio interface.
---
## 🗂️ Project Layout
```
.
├── app_all_in_one.py # Main Gradio application
├── faq.md # Default FAQ (markdown)
├── orders.db # SQLite database (auto‑created)
├── requirements.txt # Python dependencies
└── README.md # This document
```
---
## 🪪 License
Licensed under the **MIT License**.
<br>
---
<br>
An example chatbot using [Gradio](https://gradio.app), [`huggingface_hub`](https://huggingface.co/docs/huggingface_hub/v0.22.2/en/index), and the [Hugging Face Inference API](https://huggingface.co/docs/api-inference/index). |