File size: 1,510 Bytes
841cf8a
b5d2527
 
92872cb
841cf8a
b5d2527
 
841cf8a
 
 
b5d2527
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92872cb
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
---
title: PolicyBridge
emoji: 🏠
colorFrom: yellow
colorTo: blue
sdk: docker
app_port: 7860
pinned: false
---

# PolicyBridge β€” P&C Insurance Multi-Agent Pipeline

Bronze β†’ Silver β†’ Gold Β· 5 XGBoost Agents Β· Flask API Β· Clever Cloud MySQL

## Endpoints

| Method | Route | Description |
|--------|-------|-------------|
| GET | `/status` | DB connectivity + agent model check |
| GET | `/submissions/recent?limit=10` | Latest Bronze submissions |
| POST | `/submit` | Ingest new submission into Bronze layer |
| POST | `/agent/kyc` | Run Agent 1 β€” SSN / KYC |
| POST | `/agent/property` | Run Agent 2 β€” Property Risk |
| POST | `/agent/underwriting` | Run Agent 3 β€” Underwriting |
| POST | `/agent/pricing` | Run Agent 4 β€” ML Pricing |
| POST | `/agent/issuance` | Run Agent 5 β€” Policy Issuance |
| GET | `/debug/tables` | List all DB tables (dev) |
| GET | `/debug/submission` | Inspect latest submission (dev) |

## HuggingFace Secrets Required

Add these in **Settings β†’ Variables and Secrets**:

```
MYSQL_ADDON_HOST      = btvbbpqhvnttzvptguj3-mysql.services.clever-cloud.com
MYSQL_ADDON_PORT      = 3306
MYSQL_ADDON_USER      = utenclk29u394u1j
MYSQL_ADDON_PASSWORD  = QXFZTmUtPnXrKFqZKpLQ
MYSQL_ADDON_DB        = btvbbpqhvnttzvptguj3
```

## Model Files (Git LFS)

`.pkl` files in `models/` must be tracked with Git LFS before pushing:

```bash
git lfs install
git lfs track "*.pkl"
git add .gitattributes
git add models/*.pkl
git commit -m "add model files via LFS"
git push
```