feat: add Gradio web UI

- app.py: Gradio Interface wrapping BoschProductRAG.query()
- Index built once at startup (not per-request)
- Markdown output: answer + linked sources + latency
- Example prompts included for quick demo
- Verified: launches on :7860, returns correct answers

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Demo User
2026-09-11 17:31:08 -03:00
parent 9c31117553
commit f9a68ee335
5 changed files with 812 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
# Bosch HVAC Product Knowledge Bot
A CLI-based **Retrieval-Augmented Generation (RAG)** system that answers sales and specification questions about Bosch HVAC products.
A **Retrieval-Augmented Generation (RAG)** system that answers sales and specification questions about Bosch HVAC products. Available as both a **web UI (Gradio)** and a **CLI**.
## What It Does
@@ -26,7 +26,16 @@ cp .env.example .env
uv sync
```
### 2. Query the Knowledge Bot
### 2. Launch the Web UI
```bash
source .venv/bin/activate
python app.py
```
Opens at `http://127.0.0.1:7860` — type a question, get an answer with sources and latency. Includes example prompts.
### 3. Or Use the CLI
```bash
# Activate the uv environment
@@ -66,7 +75,7 @@ LATENCY: 1234.5ms
============================================================
```
### 3. Evaluate Metrics
### 4. Evaluate Metrics
```bash
# Run full evaluation (latency + accuracy)
@@ -85,7 +94,9 @@ src/products_catalog.json ← Product specs (6 Bosch HVAC systems)
src/rag.py ← RAG pipeline (embeddings + retrieval)
src/cli.py ← CLI interface (Click)
┌────┴────┐
app.py src/cli.py ← Gradio web UI / CLI interface
(Web) (CLI)
User questions
```