All case studies

DEV3 Technologies · own product

DEV3 AI Support Chat & Order Tracking Assistant: verified order lookups and answers grounded in store policy

Our own Shopify app: a storefront chat that shows order status only to the verified owner, answers from the store's own policies with cited sources, says "I don't know" rather than guessing, and hands complex cases to the merchant's helpdesk.

Industry
E-commerce (Shopify)

Live project preview

Client systems are private — screenshots shown where permitted.

DEV3 Technologies · own product — screenshots
Merchant transcript view: verified orders, sentiment, hand-off status and masked emails in form messages

Merchant transcript view: verified orders, sentiment, hand-off status and masked emails in form messages

The challenge

"Where is my order?" and policy questions make up much of a store's support inbox, so an AI assistant is an obvious fit. It is also risky. Order data is personal, and a chat that shows an order to anyone who types a plausible order number leaks it. A general-purpose model asked about returns or shipping will invent a policy the store never wrote. Refund disputes and angry customers need a person, not more automation. We wanted a Shopify app that answers the common questions instantly, treats order lookup as an authentication problem, grounds every policy answer in the merchant's own content, and passes everything else to the support team with the full context.

Our solution

The app is a Shopify embedded app on React Router 7 with Polaris, Postgres with pgvector, and a Redis-backed BullMQ worker. The storefront side is a theme app embed: a framework-free web component in a Shadow DOM that talks to the app only through the HMAC-signed Shopify App Proxy. The AI engine is the Google Gemini API.

Key design decisions

  • Order lookup as authentication. An order is shown only to the signed-in customer who owns it (the App Proxy's signed logged_in_customer_id) or to a guest whose order number and checkout email both match. Emails are compared in constant time, and an unknown order and a wrong email return the same generic message.
  • Layered rate limits. Lookups are limited per session (5 per 15 minutes), per hashed IP (15 per hour) and per order number across sessions (8 per hour). Chat itself is limited per IP and per session, and a conversation bound to one customer can't be continued by another on the same browser.
  • Retrieval that can refuse. Policies, pages and merchant-added URLs on the shop's own domain are chunked and embedded with gemini-embedding-001 at 768 dimensions into pgvector, behind a halfvec HNSW expression index. If no passage clears the similarity threshold, the assistant says it doesn't know without calling the model. If passages do clear it, a structured-output answer can still decline, and the answers it gives cite their sources.
  • Structured order cards. The model writes one or two sentences from a short factual summary. Items, tracking links and shipment history are rendered from Shopify data, not generated text.
  • Hand-off with context. Refund disputes, requests for a person, very negative sentiment and repeated misses create a ticket by email, in Zendesk or in Gorgias with the transcript attached. Failed deliveries are retried by the worker, and helpdesk credentials are encrypted at rest with AES-256-GCM.
  • Privacy by default. Order objects are fetched live and not stored, emails typed into forms are stored masked, and IPs are used only as hashed rate-limit keys. GDPR customers/data_request, customers/redact and shop/redact handlers export or delete every linked conversation.

Architecture

App Proxy routes (/apps/concierge/config, /history, /chat) verify the signature and pass to one chat orchestrator. It applies rate limits and the plan's conversation limit, then classifies intent and sentiment with a keyword fallback and routes to the verified order lookup, the knowledge-base answer or the hand-off. Admin API 2026-10 has no webhook topics for pages or policies, so the worker runs a daily staggered re-ingest per shop, and merchants can also sync on demand. The admin offers a dashboard, searchable transcripts, knowledge-base management with a test question box, widget branding with a live preview, and business hours.

Results

The app is in final QA before submission to the Shopify App Store; real-store testing is the next step. What has been built and verified so far:

  • 46 Vitest tests against real pgvector, mocked Admin GraphQL and helpdesks, and a real SMTP sink, plus 4 live tests against the Google Gemini API. Typecheck reports 0 errors.
  • Storefront widget at 26.7 kB minified (9.2 kB gzipped), passing 44/44 Puppeteer checks on desktop and mobile
  • Live retrieval check: a refund question ranked the refund policy first (0.701 similarity against about 0.58–0.60 for unrelated passages), and the answer cited it
  • Questions the store's content doesn't cover get "I don't know" without a model call. With a deliberately lowered threshold, the model still declined.
  • Order verification tests cover exact-match numbers, identical errors for unknown orders and wrong emails, input rejected before any Shopify call, and the per-session lookup limit
  • A test asserts that the similarity query uses the HNSW index

Related case studies