This report answers one question: the day Bryan says go, what do we build the Ask-AI assistant on, and what must already be true so Stage 1 starts that morning instead of that week. Stack is locked (Gemini on Vertex AI, data on Supabase) and is not relitigated here.
modelRouter.No agent framework, no new server, no new infrastructure. Phase 1's AI surface is one chat feature with exactly one tool call (get_exercises) plus short templated narration. That is a library-sized problem, not a framework-sized one.
Stripped to requirements, the AI layer must do five things: assemble member context from Supabase, run a deterministic injury pre-filter, make a routed Gemini call (Flash-Lite for volume turns, Pro for workout composition) with one function tool against the exercise library, post-filter the output, and stream the result into a React chat view. The internal spec already mandates a thin modelRouter so providers can be swapped per task without touching feature code. The evaluation below scores each realistic option against feature fit, cost and margin impact, maintainability by a small team, and speed to ship.
| Option | Feature fit | Cost impact | Maintainability | Speed to ship | Call |
|---|---|---|---|---|---|
| Vercel AI SDK (ai + @ai-sdk/google-vertex) in Supabase Edge Functions | Streaming, tool loop, zod tool schemas, React useChat. Covers the whole surface. | Zero added infra. Token spend unchanged. | One small TypeScript dependency; whole AI path readable in an afternoon. | Fastest | Recommended |
| Direct @google/genai SDK, hand-rolled router | Full Vertex coverage, but streaming glue, tool loop, and provider swap become custom code. | Zero added infra. | Fewest dependencies, most bespoke code to own. | Fast | Runner-up |
| Google Genkit / ADK | Native Vertex, but Node-first with a weak Deno story for Supabase functions. | May force a separate Node runtime (new hosting line item). | Pulls toward Google idioms, against the portability requirement. | Medium | Pass |
| LangChain / LangGraph JS | Graph and multi-agent orchestration Phase 1 does not have. | Zero infra, real abstraction tax. | Known API churn; hardest for a small team to audit. | Slower | Pass |
| OpenHuman (the feature reference PNG, tinyhumansai/openhuman) | Single-user desktop app. Local SQLite memory, not Supabase. Vertex support unconfirmed; bring-your-own-key currently unreliable per open issues. | GPL-3.0 core: source-disclosure obligations in a paid client product. | Rust/Tauri core, 5 months old, self-labeled early beta; skills repo already archived. | Slowest | Rejected as base |
Fallback path: if the Vertex edge auth fights Deno during the spike (checklist item 03), drop to the runner-up: direct @google/genai calls behind the same modelRouter interface. The feature code does not change, which is the point of the interface.
Phase 1 is additive to the existing Lovable-built site (Vite + React + TypeScript on Cloudflare Pages, Supabase as backend of record). No new deployment targets. The repo has zero AI code today, so the assistant lands on a clean slate inside established patterns.
| Table | Purpose | Notes |
|---|---|---|
| member_health_intake | Raw questionnaire + signed waiver | Source of truth; stores consent_ai_processing, signature, timestamp |
| member_profile | Derived profile feeding every AI call | Goals, equipment, schedule, injuries, conditions; this is the cached context block |
| activity_log | One row per session | Planned vs completed, RPE, sleep, soreness, stress; feeds streak and readiness |
| exercise_library | 1,324 seeded exercises | Plus video_url to Bryan's demos and contraindication_tags[] |
| plans / next_activity | Scheduled sessions | From onboarding schedule and calendar |
| chat_messages | Ask-AI history per member | Also the audit trail for AI output |
| Task | Model | Why |
|---|---|---|
| Chat turns, dashboard narration, readiness copy, reminder text | gemini flash-lite | Volume tier at $0.25 / $1.50 per 1M tokens |
| Ask-AI workout composition (the get_exercises tool loop) | gemini pro | Strong tier at $2 / $12; reliable function calling is the feature |
| Safety filtering | No model | Deterministic lookup, applied before the call as exclude_tags and again on output |
Expected API spend at launch volumes is on the order of a few dollars a month for the whole member base, comfortably inside the monthly plan. The pricing basis needs one correction, covered in section 4.
Everything below can be true before Bryan replies. Items tagged Zion need his hands or his accounts; Agent items can be pre-staged in a branch with zero client-facing changes.
| Severity | Risk / question | Mitigation or decision needed |
|---|---|---|
| High | Live Stripe key sitting in plaintext in DiscordStripe.txt | Rotate now and confirm the file was never pushed to a public repo. Not related to the AI build, but it is the sharpest exposure in the project folder. |
| High | Flash-Lite function-calling reliability is unverified; the research run explicitly refuted the benchmark claims it found | Checklist item 03 settles it empirically. Fallback (route Ask-AI to Pro) is already costed and keeps margins intact. |
| Medium | Pricing doc's cost model is written against Anthropic models and a single Anthropic key, but the locked stack is Gemini on Vertex | Restate the cost basis on Gemini tiers (spend drops slightly: Flash-Lite is cheaper than the modeled tier) and rewrite provisioning around a GCP project. Decide whose GCP account owns it long term. |
| Medium | Legal sign-off on state health-privacy law (WA My Health My Data, FTC breach-notification rule) is flagged internally but not yet done | Book the lawyer review to land before launch. The proposal already makes privacy promises to Bryan; this closes the gap under them. |
| Medium | Vertex context caching has minimum cacheable-size thresholds that the member-profile block may not meet | Measure in the spike. If explicit caching does not apply, implicit caching and small profile blocks keep cost fine; the estimate does not depend on it. |
| Low | Model identifiers and prices are a July 2026 snapshot | Pin exact Vertex model IDs and re-check prices on kickoff day; the research doc itself asks for this. |
| Low | Streaming UX through Supabase Edge Functions is assumed but not yet exercised in this repo | Covered by the same spike: stream one response end to end into the chat UI skeleton. |
| Low | QA and revision acceptance criteria are a promised deliverable with no internal definition | Write acceptance checks per stage gate before Stage 2 review; keeps the milestone payments clean. |
With items 01 through 08 done ahead of time, greenlight morning looks like: apply migrations, seed the exercise library, flip on the ask-ai function against the already-validated Vertex credentials, and start Stage 1 feature work in the scaffolded branch. The spike (item 03) is the only technical unknown between here and that morning, and it costs half a day.