Internal · SevenStar AI · Prepared for Zion · Not for client distribution

Phase 1 Framework Evaluation and Build Readiness

Session: sevenstar-eval Date: 2026-07-11 Status: Awaiting Bryan's greenlight. No client build started, no client contact made.

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.

Recommendation

Thin custom orchestration inside the existing repo, using the Vercel AI SDK with its Google Vertex provider, running in Supabase Edge Functions behind the spec's 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.

1Framework decision

What Phase 1 actually demands

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.

OptionFeature fitCost impactMaintainabilitySpeed to shipCall
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

Why the Vercel AI SDK wins

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.

On the feature reference PNG OpenHuman is the right thing to steal ideas from and the wrong thing to build on. Its memory tree, messaging-channel reach (Telegram, WhatsApp, email), and trigger-driven workflows map neatly onto Phase 2 and 3 ambitions (weekly reflections, smart nudges, wearable-driven coaching). Keep it as a feature compass. As a foundation it fails every locked constraint: SQLite not Supabase, single-user not multi-member, GPL-3.0 not client-friendly, and no confirmed Vertex path.

2Architecture sketch

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.

Client · Cloudflare Pages
Onboarding wizard4-step intake, react-hook-form + zod, e-sign consent
Dashboardgreeting, streak, Today's Plan, readiness, next activity
Ask AI chatuseChat streaming UI, workout cards with video links
Deep Diverecharts trends, AI notes
Admin viewintake review, member engagement
Supabase Auth JWT on every call
Supabase
ask-ai edge functioncontext assembly, safety pre-filter, tool loop, post-filter, chat log
generate-sessionToday's Plan and workout composition
compute-readinessnightly pg_cron scoring
remindersrules engine, max 1/day, reuses existing email functions
_shared/modelRouter.tstask-to-model map, provider swap point
Postgres + RLSper-member row security on every new table
service account, key held as Supabase function secret
Vertex AI (GCP)
Gemini Flash-Litevolume tier: chat turns, narration, nudge copy
Gemini Prostrong tier: workout composition via get_exercises tool
Context cachingmember-profile block, validate minimum size in spike

Data model on Supabase (per spec, all with per-member RLS)

TablePurposeNotes
member_health_intakeRaw questionnaire + signed waiverSource of truth; stores consent_ai_processing, signature, timestamp
member_profileDerived profile feeding every AI callGoals, equipment, schedule, injuries, conditions; this is the cached context block
activity_logOne row per sessionPlanned vs completed, RPE, sleep, soreness, stress; feeds streak and readiness
exercise_library1,324 seeded exercisesPlus video_url to Bryan's demos and contraindication_tags[]
plans / next_activityScheduled sessionsFrom onboarding schedule and calendar
chat_messagesAsk-AI history per memberAlso the audit trail for AI output

Model routing

TaskModelWhy
Chat turns, dashboard narration, readiness copy, reminder textgemini flash-liteVolume tier at $0.25 / $1.50 per 1M tokens
Ask-AI workout composition (the get_exercises tool loop)gemini proStrong tier at $2 / $12; reliable function calling is the feature
Safety filteringNo modelDeterministic 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.

3Build-readiness checklist

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.

  1. GCP project for SevenStarCreate or designate the project, attach billing, enable the Vertex AI API. Nothing downstream starts without this.
    Zion
  2. Service account and key in Supabase secretsVertex AI User role, JSON key stored as an edge-function secret. Never a VITE_ variable: those bundle into the public client.
    Zion creates · agent wires
  3. Tool-use spike on Flash-LiteThe spec's own flagged validation: confirm cheap-tier function calling is reliable, confirm the Vertex edge auth path from Deno, and check context-caching minimums against the profile block size. Half a day, a few cents of tokens. If Flash-Lite fails, Ask-AI routes to Pro and margins still hold.
    Agent
  4. Supabase plan headroom and pg_cronConfirm the existing project handles six new tables and a nightly job without a plan bump.
    Agent
  5. Migrations and RLS draftedAll six tables plus row-level security policies, written and reviewed in a branch, applied only at kickoff.
    Agent
  6. Exercise dataset stagedDownload the 1,324-exercise dataset, verify its license permits commercial use, and draft the contraindication tag taxonomy (condition to excluded-tags lookup).
    Agent
  7. Video mapping planExercises need Bryan's Level Up / Build / Perform demo links. Inventory what is public on his YouTube now; the gaps become a kickoff question for Bryan, not a blocker.
    Agent inventories · Zion confirms
  8. Repo scaffold in a branchmodelRouter, ask-ai function stub, chat route skeleton. No deploy, no client visibility.
    Agent
  9. Rotate the exposed Stripe keyDiscordStripe.txt holds a live Stripe key in plaintext. Rotate regardless of greenlight; independent of this build but flagged during pricing work.
    Zion · urgent
  10. Consent and privacy copyOnboarding consent checkbox text, privacy policy update, and the not-medical-advice line on every AI response. Lawyer review of state health-privacy applicability (WA MHMD) is flagged internally for before launch, not before build.
    Zion
  11. Port the provisioning plan to GCPThe internal pricing doc still assumes a single Anthropic API key. Locked stack means a GCP project instead: decide account ownership and restate the cost basis on Gemini prices (section 4).
    Agent drafts · Zion decides
  12. Define the monthly plan's support scopeThe proposal promises hosting, AI platform, updates, and support in one monthly fee, but no response times or update cadence are defined anywhere. Write the one-pager before Bryan asks.
    Zion
  13. Admin-view mini-specPromised to Bryan (scope item 8) but absent from the internal build spec. Half a page: intake review, member list, engagement columns.
    Agent drafts · Zion approves

4Risks and open questions for Zion

SeverityRisk / questionMitigation 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.

The one-day kickoff picture

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.