What it does

ReplyForge Hybrid is a support-reply studio for small product teams. Paste or pick a customer ticket: it is classified and drafted on-device by Gemini Nano when available (otherwise in the cloud), personal data (emails, phone numbers, order IDs, addresses, names) is masked by deterministic checks on the device, and a deterministic routing engine decides whether the on-device draft is enough or the ticket escalates — angry, long, multi-issue, refund/legal, or low-confidence tickets go to a cloud model that receives ONLY the redacted summary (the escalation payload type has no field that could carry the raw ticket). A 'What the cloud sees' preview shows the exact payload before anything is sent; if the model's own PII count exceeds what redaction caught, the payload is Held for review until a human confirms. Privacy Mode refuses any cloud processing outright. Every finished task displays its actual route from Firebase AI Logic's inferenceSource, and a scorecard computed from stored route events reports measured accuracy, redactions, latencies and cloud calls avoided — no claimed numbers.

How I built it

All AI inference goes through Firebase AI Logic (JS SDK): hybrid inference prefers the on-device Gemini Nano model and falls back to the cloud model gemini-3.5-flash-lite; the code reads response.inferenceSource to display and record the route that actually ran. Firebase App Check is enforced for AI Logic. Firebase Auth (Google + email/password), Firestore (per-user partitions, counts-and-labels-only route events), Remote Config (routing thresholds and prompts, tunable without deploys), and Firebase Hosting complete the stack. Frontend: React + TypeScript + Vite. The deterministic redaction and routing engine are plain TypeScript with 114 automated tests.

Challenges I ran into

Gemini Nano is unavailable in headless CI browsers and on machines without the hardware path, so on-device behaviour had to be verified on a real user machine while the cloud path was verified in automation — the app never claims a route, it displays the measured one. Free-tier cloud quotas shaped the evaluation runner's pacing.

Accomplishments that I'm proud of

A full 30-ticket evaluation ran entirely on-device on the reference machine (30 of 30 triages, median 9,662 ms on a CPU-only machine); routing accuracy measured at 27–28 of 30 (90–93%) across four live runs; 27 of 27 labelled personal-data items redacted with 0 surviving into any cloud payload.

What's next for ReplyForge Hybrid

Real email ingestion, team inboxes, and additional languages for on-device triage.

Built With

  • cloud-firestore
  • firebase-ai-logic
  • firebase-app-check
  • firebase-remote-config
  • gemini-nano
  • react
  • typescript
  • vite
Share this project:

Updates

Submission history