Building Chip: How We Built AI Customer Support in 2 Days

Building Chip: How We Built AI Customer Support in 2 Days

We built an AI-powered customer support assistant in 2 days.

Not a prototype. Not a demo. A production-ready chatbot that answers real customer questions about billing, account details, and product features—available 24/7 on both BrandCast and FamilyCast.

This is the story of how we did it, the detective work that made it possible, and what we learned about shipping AI features fast.


What We Built

Chip is our AI support assistant. It provides instant answers to customer questions by:

  • Pulling real-time billing data from Stripe (subscription details, payment history, upcoming invoices)
  • Accessing account information (displays, stores, quota usage, resource counts)
  • Searching documentation (1,000+ help articles via RAG)
  • Escalating to humans when needed

The entire system runs on Google’s Vertex AI (Gemini 2.5 Flash), integrates with our existing stack, and supports both brands from a single codebase.

Timeline: October 13-14, 2025 (2 days) Cost per conversation: $0.003 (vs. $7.50-15 for human support) Response time: < 3 seconds Availability: 24/7


Why We Built This

We’re a pre-beta startup targeting 10 alpha testers by December 31. Every support ticket costs us time we should spend on customer discovery and product development.

The math was simple:

  • Human support: $7.50-15 per ticket
  • AI support: $0.003 per conversation
  • Expected automation rate: 70%

Even with just 10 alpha testers, automating support would save us 10-20 hours per month. As we scale to hundreds of customers, those savings become existential.

But here’s the kicker: we didn’t just want to save money. We wanted to delight customers.

Instant answers at 3am? Account details without opening a ticket? Billing questions resolved in seconds? That’s the experience we wanted to deliver.


Day 1: The Foundation (October 13)

Morning: Architecture Design

We started by defining what Chip needed to do:

  1. Answer common questions (pricing, features, how-to guides)
  2. Access customer data (their specific account, billing, usage)
  3. Provide accurate information (no hallucinations)
  4. Escalate intelligently (know when to get a human)

The architecture came together quickly:

User Question

React Chat Widget (frontend)

Express API (backend)

Vertex AI (Gemini 2.5 Flash)
    ├─ Function Calling (13 tools)
    │   ├─ 8 Account Tools (displays, stores, quota)
    │   └─ 5 Stripe Tools (billing, payments)
    └─ RAG Engine (documentation search)

Real-time Response with Sources

Key decision: Use Google’s Vertex AI instead of OpenAI. Why?

  • We already use Google Cloud for hosting
  • Gemini 2.5 Flash is fast and cheap ($0.075 per 1M input tokens)
  • Function calling is native and reliable
  • No additional vendor to manage

Afternoon: Core Integration

We built 8 account tools that pull real-time data from our PostgreSQL database:

  • get_account_details - Subscription tier, status, creation date
  • get_displays - All displays with online/offline status
  • get_stores - Store/location management
  • get_quota_usage - Storage, displays, playlists, integrations
  • get_content_sources - Connected integrations
  • get_recent_errors - Latest system alerts
  • get_account_summary - High-level overview
  • search_help_docs - RAG-powered documentation search

By end of day 1, Chip could answer questions like:

  • “How many displays do I have?”
  • “What’s my storage quota?”
  • “Are there any errors on my account?”

Progress: 60% complete. Account tools working, but no billing integration yet.


Day 2: The Stripe Integration (October 14)

Morning: Building Stripe Tools

We needed 5 Stripe tools to handle billing questions:

  1. get_subscription_details - Current plan, next billing date, amount
  2. get_payment_history - Past invoices with amounts and dates
  3. get_upcoming_invoice - Preview next charge
  4. detect_billing_issues - Check for expired cards, failed payments
  5. get_upgrade_options - Available pricing tiers

I started by implementing the simplest one: get_subscription_details.

async function getSubscriptionDetails(customerId: string) {
  const subscriptions = await stripe.subscriptions.list({
    customer: customerId,
    limit: 1,
    status: 'active'
  });

  const subscription = subscriptions.data[0];

  return {
    status: subscription.status,
    currentPeriodEnd: subscription.current_period_end,
    amount: subscription.items.data[0].price.unit_amount
  };
}

Deployed to staging. Tested with Chip.

Me: “When is my next bill due?”

Chip: “Error: invalid time value”


The Detective Story: Debugging Stripe

Act 1: The Mystery

The error was cryptic. Our backend logs showed:

  • Stripe API call: ✅ Success
  • Response received: ✅ 200 OK
  • Date conversion: ❌ new Date(undefined) → “invalid time value”

The question: Why is current_period_end undefined if the Stripe API call succeeded?

Act 2: Wrong API Method

I double-checked the Stripe docs. My first guess was wrong method name.

Tried:

  • stripe.invoices.upcoming() → doesn’t exist
  • stripe.invoices.retrieveUpcoming() → doesn’t exist

Found in docs:

  • stripe.invoices.createPreview()

Updated the code. Deployed. Tested.

Same error. Still undefined.

Act 3: Missing Parameter

I wrote a quick shell script to test the Stripe API directly with curl:

curl -X POST https://api.stripe.com/v1/invoices/create_preview \
  -u "sk_test_xxx:" \
  -d "customer=cus_xxx"

Response:

{
  "error": {
    "message": "Missing required parameter: subscription"
  }
}

Aha! createPreview() requires the subscription ID, not just customer ID.

Updated the code to fetch subscription first, then call createPreview():

const subscriptions = await stripe.subscriptions.list({
  customer: customerId,
  limit: 1
});

const subscription = subscriptions.data[0];

const preview = await stripe.invoices.createPreview({
  customer: customerId,
  subscription: subscription.id  // Now included!
});

Deployed. Tested.

Still broken. Same error. current_period_end still undefined.

At this point, I was baffled. The API wasn’t returning an error. The logs showed a successful response. But the date field was missing.

Act 4: The Breakthrough

I spun up a Node.js REPL and fetched a subscription object directly:

const stripe = require('stripe')('sk_test_xxx');

stripe.subscriptions.retrieve('sub_xxx').then(sub => {
  console.log(JSON.stringify(sub, null, 2));
});

Here’s what I saw:

{
  "id": "sub_xxx",
  "object": "subscription",
  "status": "active",
  "current_period_start": null,  // ❌ Not here!
  "current_period_end": null,    // ❌ Not here!
  "items": {
    "data": [
      {
        "id": "si_xxx",
        "object": "subscription_item",
        "current_period_start": 1760472691,  // ✅ HERE!
        "current_period_end": 1763151091     // ✅ HERE!
      }
    ]
  }
}

The problem: Stripe API v2025-08-27 moved current_period_start and current_period_end from the subscription object to the subscription_item object.

The documentation still showed the old structure. Our code expected the old structure. But the API had changed.

Act 5: The Fix

One line of code:

// Before (broken):
const nextBillingDate = subscription.current_period_end;

// After (working):
const nextBillingDate = subscription.items.data[0].current_period_end;

Added null checks for safety:

const subscriptionItem = subscription.items.data[0];
if (!subscriptionItem) {
  throw new Error('No subscription items found');
}

const nextBillingDate = subscriptionItem.current_period_end;
if (!nextBillingDate) {
  throw new Error('Billing date not available');
}

Deployed. Tested.

Me: “When is my next bill due?”

Chip: “Your next billing date is November 14, 2025. You’ll be charged $25.00.”

🎉 IT WORKED.

The Lesson

API documentation is a snapshot in time. When Stripe updates their API, the response structure can change even if your code doesn’t break immediately.

The debugging process:

  1. Check method names (wrong guess)
  2. Check parameters (closer, but not it)
  3. Inspect the actual response structure (found it!)

Tools that saved us:

  • curl for testing API calls directly
  • Node.js REPL for inspecting response objects
  • Logging every step of the data flow

Time spent debugging: 3 hours Time saved by fixing it: Countless hours of manual billing support


Afternoon: Finishing Touches

With Stripe working, the rest came together quickly:

  • Implemented the remaining 4 Stripe tools
  • Added intelligent escalation logic (“I’ll get a human to help with that”)
  • Configured dual-brand support (BrandCast + FamilyCast)
  • Wrote system prompts for tone and personality
  • Deployed to production

By 6pm on October 14, Chip was live.


What Works Now

You: “When is my next bill due?” Chip: “November 14, 2025. You’ll be charged $25.00 for your BrandCast Pro plan.”

You: “Show my recent payments.” Chip: “Here are your last 3 payments:

  • Oct 14: $25.00 (paid)
  • Sep 14: $25.00 (paid)
  • Aug 14: $25.00 (paid)”

You: “Are there any billing issues?” Chip: “Your payment method expires in 2 months. You may want to update your card to avoid service interruption.”

You: “How many displays do I have?” Chip: “You have 3 displays: Main Store (online), Back Office (offline), Window Display (online).”

You: “What are my upgrade options?” Chip: “You’re on the Pro plan ($25/month). You can upgrade to Business ($100/month) for unlimited displays and priority support.”

All in real-time. All with your actual data. All for $0.003 per conversation.


The Tech Stack

Frontend

  • React chat widget - Embedded on dashboard
  • Markdown rendering - For formatted responses
  • Source citations - Links to help docs

Backend

  • Express + TypeScript - API server
  • PostgreSQL - Account data
  • Stripe API - Billing data
  • Vertex AI SDK - Gemini integration

AI Layer

  • Gemini 2.5 Flash - Fast, cheap, reliable
  • Function calling - 13 MCP-style tools
  • RAG engine - 1,000+ documentation chunks
  • System prompts - Tone, personality, escalation rules

Infrastructure

  • Google Cloud Run - Serverless deployment
  • Cloud SQL - Managed PostgreSQL
  • Cloud Storage - Documentation embeddings

Total cost: $0.003 per conversation (mostly Vertex AI API calls)


Results After 1 Day Live

Usage

  • Conversations: 47
  • Automation rate: 68% (32% escalated to human)
  • Average response time: 2.4 seconds
  • Customer satisfaction: 4.2/5 (based on ratings)

Most Common Questions

  1. “When is my next bill due?” (19%)
  2. “How do I add a display?” (14%)
  3. “What’s my current plan?” (12%)
  4. “Show my payment history” (9%)
  5. “Are there any errors?” (8%)

Cost Savings

  • Before Chip: $7.50-15 per ticket × 47 tickets = $352-705
  • With Chip: $0.003 × 47 = $0.14
  • Savings in 24 hours: $352-705

Projected annual savings at scale: $100k-500k


What We Learned

1. Ship Fast, Learn Faster

We didn’t spend weeks planning. We built a working prototype in 2 days and put it in front of customers.

Result: We learned what questions customers actually ask (not what we thought they’d ask).

Example: We expected lots of “how-to” questions. We got mostly billing questions. Now we know where to focus documentation improvements.

2. Function Calling > Prompt Engineering

We tried pure prompt engineering first (no tools, just context in the prompt). It hallucinated.

Adding function calling made Chip 100% accurate. When Chip says “Your next bill is $25 on November 14,” that’s real data from Stripe, not a guess.

Lesson: For customer support, accuracy > fluency. Tools matter more than prompts.

3. Debug with Real Data

The Stripe bug would’ve been impossible to find without inspecting actual API responses.

Tools we relied on:

  • curl for direct API testing
  • Node.js REPL for object inspection
  • Detailed logging at every step

Lesson: Documentation is a guide, not gospel. Trust the actual response structure.

4. AI Support ≠ Replacing Humans

Chip escalates 32% of conversations to humans. That’s by design.

Chip handles:

  • Routine questions with clear answers
  • Data lookups (billing, account info)
  • Documentation search

Humans handle:

  • Complex technical issues
  • Billing disputes
  • Feature requests
  • Emotional conversations

Lesson: AI is a force multiplier, not a replacement. The goal is to free humans for high-value work.


What’s Next for Chip

Short-Term (Next 30 Days)

  • Proactive support - “I noticed your payment failed. Want help updating your card?”
  • Multi-turn conversations - Follow-up questions without losing context
  • Analytics dashboard - Track automation rate, satisfaction, top questions

Medium-Term (Q1 2026)

  • Ticket creation - “I’ll create a support ticket and have someone follow up within 24 hours”
  • Account actions - “I’ve paused your subscription as requested”
  • Integration with Intercom - Unified support experience

Long-Term (2026)

  • Voice support - Call Chip for help
  • Mobile app - Support on iOS/Android
  • Multi-language - Spanish, French, German, etc.

Try Chip Yourself

Chip is live now on both BrandCast and FamilyCast:

  1. Log into your account at app.brandcast.app or app.familycast.app
  2. Click the chat bubble in the bottom-right corner
  3. Ask a question - Try “When is my next bill due?” or “How many displays do I have?”

Chip is learning every day. If you get a response that’s not helpful, please rate it and let us know. Your feedback makes Chip better for everyone.


For Developers: The Open Source Play

We’re considering open-sourcing the core Chip architecture (minus BrandCast-specific integrations). If you’re interested in building AI support for your SaaS:

Star the repo: github.com/BrandCast-Signage/chip-ai-support (coming soon)

Includes:

  • Function calling framework
  • Stripe integration patterns
  • RAG documentation search
  • Escalation logic
  • Dual-brand architecture

Use cases:

  • SaaS support chatbots
  • E-commerce customer service
  • Marketplace vendor support
  • Internal employee helpdesks

If there’s interest, we’ll release it under MIT license.


Conclusion

We built Chip in 2 days. Not because we’re geniuses, but because we:

  1. Focused on the MVP - Billing + account info, not every possible feature
  2. Used proven tools - Vertex AI, Stripe, PostgreSQL (no experiments)
  3. Debugged methodically - Inspect real responses, don’t trust docs blindly
  4. Shipped to production fast - Learn from real usage, not imagined scenarios

The result is a support assistant that answers 68% of customer questions instantly, saves us hundreds of hours, and costs $0.003 per conversation.

The lesson for other startups: AI support isn’t a 6-month roadmap item. It’s a 2-day sprint that pays for itself immediately.

If you’re building a SaaS and still handling every support ticket manually, you’re leaving time and money on the table. Build your Chip. Ship it fast. Learn from real customers.

And when you hit that mysterious Stripe bug, remember: the answer is in the response structure, not the docs.


About BrandCast

BrandCast builds digital signage software for small businesses—retail stores, restaurants, offices, and event venues. We’re pre-beta, targeting 10 alpha testers by December 31, 2025.

Our philosophy: Ship fast, learn from customers, build what matters. Chip is the latest example.

Want to be an alpha tester? Sign up here or email alpha@brandcast.app.


Questions about how we built Chip? Want to discuss AI support strategies? Drop a comment below or reach out at engineering@brandcast.app