Two-pass grounded retrieval + AI price-fairness verifier + Darija fine-tune scaffolding for a Moroccan home-services marketplace.
Every chat response is checked by a grounding verifier before users see it; this dashboard is live production telemetry from eval_logs.
user query in Darija
│
▼
┌──────────────────────────────────────────────────┐
│ Pass 0 — regex pre-filter (deterministic, ~0ms) │
│ lib/text-classifier.js │
└──────────────────────────────────────────────────┘
│ regex hit │ regex miss
▼ ▼
skip Pass 1 ┌──────────────────────┐
│ Pass 1 — Grok-3-mini │
│ JSON mode, ≤4s budget│
└──────────────────────┘
│ │
└─────────────┬──────────────┘
▼
┌──────────────────────────────────────────────────┐
│ Retrieval — MongoDB composite filter │
│ (category|secondary) × city × approved │
│ sort: featured > verified > rating │
└──────────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────┐
│ Pass 2 — constrained streaming │
│ model CAN ONLY reference candidates by _id │
│ emits <> at end │
└──────────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────┐
│ Verifier — grounding check │
│ cited IDs ∈ candidate set? │
│ prices ∈ [30, 50_000] MAD? │
│ unverified proper nouns flagged │
└──────────────────────────────────────────────────┘
│
▼
SSE → chat drawer
eval_logs ← persisted
Hit the chat API directly. The grounded retrieval response includes a verifier field with ok / score / violations_count — that's the smoking gun that retrieval is grounded: