惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
美团技术团队
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
阮一峰的网络日志
阮一峰的网络日志
S
SegmentFault 最新的问题
博客园_首页
雷峰网
雷峰网
V
V2EX
The Cloudflare Blog
博客园 - 三生石上(FineUI控件)
量子位
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 聂微东
V
Visual Studio Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
Jina AI
Jina AI
月光博客
月光博客
L
LangChain Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How I built an AU small business AI advisor with Gemini 2...
AppZ · 2026-06-18 · via DEV Community

AppZ

Most AI tools give Australian small businesses American advice. An Aussie tradie running Xero does not need to hear about QuickBooks. A cafe owner with three casual staff has Fair Work Act obligations that no generic "automate your business" tool will surface.

I built AppZ AU Business Advisor to fix this -- a free tool powered by Gemini 2.0 Flash that generates personalised automation blueprints with real Australian business context. This post covers the technical decisions, the prompt engineering approach, and why the AU-specific scaffold makes all the difference.

The Problem with Generic AI Business Advice

When you ask a general AI "how should I automate my business?", the training data skews heavily American. You get advice about QuickBooks, not Xero. About W-9 forms, not BAS lodgement. About 401k, not superannuation.

For an Australian sole trader approaching the $75k GST registration threshold, this is not just unhelpful -- it is actively misleading. The compliance obligations are different. The software ecosystem is different. The pain points are different.

The Prompt Scaffold Approach

Instead of injecting "you are talking to an Australian business" as a keyword, I built a reasoning scaffold -- a structured context block the model uses as a knowledge foundation:

AUSTRALIAN BUSINESS CONTEXT:
- GST: 10%, mandatory registration at $75k annual turnover
- BAS: lodged quarterly (or monthly for large businesses) to the ATO
- Superannuation: 11.5% employer contribution, paid per payroll from July 2026
- ATO tools: STP Phase 2 mandatory for all employers
- Dominant accounting platforms: Xero, MYOB, Reckon (not QuickBooks)
- Fair Work Act: award rates, leave entitlements, payslip requirements
- Key software by vertical: ServiceM8 (trades), Deputy (hospitality), Cliniko (health)

This is not a keyword list -- it is a reasoning foundation. When a tradesperson mentions "invoicing problems", the model now reasons about Xero integrations, GST-inclusive invoicing, and BAS categorisation, not generic invoice templates.

Gemini 2.0 Flash Structured Output

The key technical decision was using Gemini's structured JSON output mode. Instead of asking for "a recommendation in JSON format" (which requires a parsing fallback), I use responseMimeType: "application/json" with a defined schema:

const result = await model.generateContent({
  contents: [{ role: 'user', parts: [{ text: prompt }] }],
  generationConfig: {
    responseMimeType: 'application/json',
  },
});

This returns clean, schema-conforming JSON directly -- no markdown code fences to strip, no parsing errors to handle. The React components can render it immediately.

The output schema I defined:

type AdvisorOutput = {
  summary: string;          // 2-3 sentences, AU-specific
  auContext: string;        // Key AU compliance note for this business type  
  recommendations: Array<{
    product: Product;
    reason: string;
    expectedImpact: string;
    priority: 'high' | 'medium' | 'low';
  }>;
  implementationPlan: string;  // 30-day steps with AU context
  estimatedTimeSaved: string;
  dollarsPerWeekSaved: string; // Calculated from optional hourly rate input
  nextStep: string;
};

ROI Calculation

One addition that makes the output tangible: an optional hourly rate input. When provided, the model calculates dollar value of time saved rather than just "8-12 hours/week":

dollarsPerWeekSaved: "calculate: hours saved x $150/hr = $1,200-$1,800/week in recovered capacity"

This is much more compelling for a business owner than an abstract hours figure.

Stack and Deployment

  • Next.js 15 App Router with TypeScript
  • Google AI SDK (@google/generative-ai) for Gemini calls
  • Vercel for deployment (two serverless routes: /api/advisor and /api/email-capture)
  • Fully stateless -- no database, no auth, no data retained

The app is live at gemini-xprize.vercel.app and the full source is on GitHub. It is a submission to the Gemini XPRIZE (Small Business Services category) but I built it as a real, useful tool first.

What I Would Do Differently

The main shortcut for speed-to-competition: the product recommendations come from a hardcoded catalog rather than a live API. A production version would pull from Xero's App Marketplace API or MYOB's partner directory to give genuinely current recommendations. The Gemini side would stay the same -- the AU context scaffold is the core value.

If you are building something similar, the key lesson is: domain-specific reasoning scaffolds outperform keyword injection. Telling Gemini "you are talking to an Australian business" is much weaker than giving it a structured knowledge foundation about what that actually means operationally.

Happy to discuss the prompt structure or the structured output approach in the comments.