Problem
Launching a micro-business in Quebec is legally complex — registration, food permits, tax obligations, language compliance, and municipal rules all apply simultaneously, and the requirements differ significantly by business type, location, and product. Most entrepreneurs either miss critical steps or spend hours navigating government websites in the wrong order.
Generic AI tools can't solve this reliably: a single-prompt system doesn't know that tiramisu contains dairy, which disqualifies it from Quebec's free home kitchen exemption — a mistake that could result in fines up to $62,500 under the Food Products Act. The core challenge was building a system accurate enough to actually trust, not just a plausible-looking checklist.
Solution
BZNS is a five-feature platform — conversational intake, legal roadmap, funding matcher, financial snapshot, and AI assistant — all connected through a single user profile. Intake builds the profile, the profile drives roadmap generation and funding scoring and financial calculations, and the AI assistant has full context of all user state for follow-up questions.
The legal roadmap is the core feature: a three-layer Claude API pipeline generates a sequenced checklist of legally required steps from a 25-file JSON knowledge base, then an adversarial review pass attacks the output to catch product-specific edge cases, and a confidence merging layer tags each step as verified, needs attention, or AI-recommended.
The financial snapshot is fully deterministic — no AI involved in the math. A TypeScript tax engine computes federal income tax, Quebec provincial tax, QPP (self-employed double contribution), QPIP, and GST/QST remittance using 2026 brackets. Claude is only used for situation-specific insights on top of the numbers. The key demo moment: showing a freelancer that $5K/month gross becomes ~$573/month take-home after all Quebec obligations.
Architecture
Intake — A 5-step wizard collecting business activity, work location, pricing model, free-text description, location and borough, and personal details. On submit, Claude classifies the business type and cluster from the free text and builds a structured profile stored in Supabase. All downstream features are driven by this profile.
Legal Roadmap — Three-layer pipeline: Layer 1 generates steps from KB documents selected by a cluster-based selector. Layer 2 runs an adversarial Claude Sonnet call that receives the full roadmap and complete KB and is explicitly instructed to find what's wrong or missing, not what's correct. Layer 3 merges flag output back into steps with confidence metadata. Steps are grouped into four collapsible phases (Get Legal, Get Permitted, Get Tax-Ready, Stay Compliant) and stored in Supabase so completion status persists.
Funding Matcher — A deterministic scoring engine (no AI) in scorer.ts ranks 15+ Quebec and federal funding programs against the user profile. Programs where the user hard-fails on immutable criteria (age, location, immigration status, business type) are hidden entirely. Ready-to-apply programs are separated from unlock-with-more-steps programs. Claude is only used for explain-this-program follow-ups.
Financial Snapshot — Deterministic TypeScript tax engine computing federal and Quebec income tax, QPP, QPIP, and GST/QST remittance from 2026 brackets. Additional tools include scenario projections, break-even analysis, pricing calculator, funding impact calculator, and cluster-specific guided questions. A waterfall bar visualizes the proportional breakdown of every dollar (federal tax, Quebec tax, QPP, QPIP, expenses, take-home).
AI Assistant — Exists in two forms: a dedicated chat page and a floating bubble persistent across all pages. Every response is grounded in the user's full state — profile, roadmap progress, funding matches, financial snapshot, and current page route — injected into the system prompt on every call. The service makes 8 steps per message: parallel data fetch, spending intelligence construction, KB selection, prompt assembly, Claude Haiku API call, and persistence of both messages to Supabase. Source citations are rendered as clickable badge pills derived from KB filenames.
Backend: Supabase (Postgres) stores all user state. All KB documents are versioned JSON files with a last_verified date and source URLs, making the knowledge base auditable and updatable independently of the codebase. Next.js API routes handle all service calls with typed request/response schemas validated by Zod.
What I optimized
Accuracy over coverage: The knowledge base is deliberately scoped to what we could verify — 25 files covering the most common Quebec micro-business scenarios. Rather than trying to cover everything and being wrong, we built a confidence system that surfaces uncertainty explicitly. A roadmap that tells you 'this step needs professional verification' is more trustworthy than one that presents everything with equal confidence.
Adversarial prompt engineering: The gap detection prompt is explicitly instructed to attack the roadmap, not confirm it. It instructs Claude to analyze specific product ingredients against permit eligibility criteria, not just business category. This is what makes the tiramisu/mascarpone catch possible — category-level matching would never find it.
Hybrid AI and deterministic architecture: Financial math is fully deterministic — every tax figure is computed from 2026 bracket tables in TypeScript, not estimated by Claude. AI is used only where reasoning adds value: legal classification, adversarial gap detection, and conversational follow-ups. This means the numbers are always correct and the legal reasoning is always grounded in the KB.
KB selector efficiency: Layer 1 uses a slimmed KB serialization (~10K chars) to stay within context limits. Layer 2 uses full serialization with eligibility criteria, common mistakes, and enforcement details. The selector infers alcohol content from product description text, not just an explicit serves_alcohol flag — catching cases like tiramisu containing marsala without the user flagging it.
UX honesty: The confidence badge system, phase grouping, and flag summary banner are all designed to make the tool feel trustworthy rather than authoritative. Users see exactly which steps are verified from the KB, which need a second look, and which were AI-inferred — so they know where to follow steps directly and where to verify with a professional.
Results
Built a complete five-feature full-stack product in 90 hours: conversational intake, legal roadmap with adversarial gap detection, deterministic financial snapshot with 2026 Quebec tax math, funding program matcher for 15+ programs, and a context-aware floating AI assistant.
The three-layer roadmap architecture successfully catches product-specific legal edge cases a single-prompt system would miss. In live testing, the system correctly identified that tiramisu contains dairy (mascarpone), flagged it as a high-severity wrong step, and generated a corrected path requiring a full MAPAQ food establishment permit instead of the free home kitchen exemption.
The deterministic tax engine correctly computes all Quebec and federal self-employment obligations from 2026 brackets — including the QPP double contribution that catches most first-time self-employed people off guard — with zero AI involvement in the math.
The adversarial review layer produced 8 flags for a typical food business profile (3 high, 5 medium), surfacing issues including alcohol content implications under RACJ, federal CRA registration gaps, and food labeling requirements under both Quebec and federal law.
What I'd do next
Expand the knowledge base with a tagging system so each document declares which business characteristics trigger its inclusion, rather than hardcoding business type mappings. This would let the selector handle novel business types gracefully instead of falling back to a generic 'other' category.
Add bilingual content generation — generate roadmap steps in both English and French at creation time and store both in the database, so language switching is instant with no additional API calls. Currently UI strings are translated but Claude-generated content is English-only.
Build a real transaction layer for the financial assistant so it can do genuine expense categorization, deductibility flagging at the transaction level, and anomaly detection — moving from monthly snapshot projections to actual per-transaction intelligence.
Add a knowledge base update workflow with a last_verified date check that flags documents approaching expiry and prompts a human review. Quebec regulations change, and a legal tool that silently serves outdated information is worse than no tool at all.
Productionize the confidence system with user feedback: let users mark flags as resolved or irrelevant, feed that signal back into prompt tuning, and track which flag types have the highest false positive rate by business category to continuously improve adversarial detection.