Inspiration
Small shops get the same questions all day: are you open Sunday, do you ship free, do you carry this. A chatbot would help, but most charge per message, which a small shop can't justify. On-device AI changes that math: if the answer runs on the visitor's own computer, it costs the shop nothing.
What it does
A shop owner signs in with Google, enters their store info (hours, contact, products with price and stock, FAQs, policies) and copies one <script> line into their website. Visitors get a chat helper that answers only from that store info.
Each answer runs on the best engine available, and says which one it used:
- On this device: Chrome's built-in Gemini Nano, free for the shop.
- Cloud: Gemini through Firebase AI Logic when the visitor's browser has no ready model, capped by a monthly budget the owner sets.
- Basic mode: no AI at all; the closest FAQs plus the shop's contact details. The visitor always gets help.
The helper never invents products, prices or policies. When the shop's info doesn't cover a question, it says so and points to the phone number.
The owner's dashboard turns those questions into decisions: the most-asked questions, how many answers ran free on visitors' devices, Consider stocking (products people asked for that the shop doesn't carry), and Couldn't answer, where any question becomes a new FAQ in one click. The question log is anonymous and expires after 90 days.
How we built it
- Firebase AI Logic hybrid inference is the core. One adapter (
src/ai/) is the only code that importsfirebase/ai, and a test enforces it. It uses the on-device model only when Chrome reports itavailable, so a visitor is never made to download a model. Each answer's label comes from the SDK'sinferenceSource, meaning what actually ran rather than what was requested. - Chrome structured output: the on-device model is held to the reply's JSON schema with
responseConstraint, so even a small model returns the exact shape the app reads. - Firestore holds stores, the question log and cloud usage. One cloud answer is reserved in a transaction before the cloud call, and the security rules enforce the monthly cap, the log's fields, ownership and per-minute rate limits, with no backend server at all.
- Firebase Auth (Google sign-in), App Check with reCAPTCHA Enterprise, Remote Config (cloud model, cloud on/off, default budget, question length) and Firebase Hosting.
- The widget is a single file in a shadow root, so a shop's own styles can't break it and it can't break the shop's page.
- Tests: React dashboard, TypeScript throughout, Vite, and over 1,000 tests, including the Firestore rules tested against the emulator.
Challenges we ran into
- A small model vs. a big one. Gemini Nano answered "Do you deliver to Texas?" with "Shipping is free over $50", the closest fact it had. Worked examples built from each shop's own info, plus a rule to say what's unknown before giving a related fact, closed most of that gap.
- Enforcing a budget with no server. The cap had to hold even against a visitor scripting the database directly, so the limit lives in the security rules, not just the app.
- Never surprising the visitor. A multi-gigabyte model download must never start on a shop's customer's computer, so the app treats "downloadable" as unavailable and falls back instead.
Accomplishments that we're proud of
- The everyday answer costs the shop nothing.
- Every answer is honest about where it ran.
- Even with no AI available at all, the visitor still gets the shop's FAQs and phone number instead of an error.
What we learned
On-device AI is ready for real, narrow tasks when the model is given tight instructions, examples and an output schema. And a hybrid setup has to be designed around the fallbacks, not just the happy path.
Built during the contest
Shop Helper was newly built from a written spec between Nov 11 and Nov 30, 2026, with AI coding assistants and no other pre-existing code.
What's next for Shop Helper
- More languages.
- A weekly summary for the owner ("3 people asked about ashwagandha this week").
- WordPress and Shopify install buttons instead of a pasted script.
Who built it
Shop Helper is built by P MAJ LABS LLC, a software company in McKinney, Texas.
Built With
- chrome-built-in-ai
- firebase
- firebase-ai-logic
- firebase-app-check
- firebase-authentication
- firebase-hosting
- firebase-remote-config
- firestore
- gemini
- gemini-nano
- react
- recaptcha-enterprise
- typescript
- vite
- vitest