Status: In development (local spike, disabled in staging and production)
Tier: Pro
Rollout: Local dev only until the Phase 4 measurement gate passes
Overview
Today, Ask AI in High IQ is a stateless chat. Every conversation starts from scratch. The AI doesn’t remember that you said last Tuesday you don’t like peppery strains, or that you have three Wedding Cake cartridges in your stash, or that you’ve been looking at sativas on Sunnyside for the last twenty minutes. Every time you open it, you explain yourself all over again. Cannabis Coach fixes that. It’s a persistent AI companion powered by Claude Managed Agents — Anthropic’s new agent runtime that gives each user a dedicated container with a file system that survives across conversations. Every Coach session reads a workspace of notes the agent has written about you: your preferences, your tasting log, your goals, and a live snapshot of what you’re shopping. The agent updates those notes as it learns. It’s the difference between asking a stranger for a strain recommendation and asking a friend who’s been with you through every dispensary visit.What it does
- Remembers across conversations — Preferences, tasting notes, goals, and things that didn’t work are stored in the agent’s persistent workspace and loaded on every interaction
- Knows what you’re shopping in real time — When you browse Sunnyside (or any supported dispensary) in the Safari or Chrome extension, the extension pushes your shopping context to Convex and Coach reads it during your next question
- Uses the web for live research — Coach can search papers, read forum threads, look up new releases, and cite its sources
- Queries your High IQ data — Coach has access to your stash, favorites, orders, Daily Stories history, and the full TIWIH strain database through a dedicated MCP server
- Learns over time — As you correct, reject, or confirm its suggestions, it updates its internal notes about you so future answers get better
- Future: proactive notifications — A scheduled v2 agent runs daily per Pro user, scans their state, and decides whether to push a proactive notification (“You’ve been looking at 3 sativas on Sunnyside — want me to compare them to your stash?”)
User value
Coach replaces the current Ask AI entry point in the mobile app for Pro users. Free users lose Ask AI entirely and see an upgrade prompt.How it works
Coach is built on three Anthropic / TIWIH primitives working together:- A Claude Managed Agents session is created once per Pro user and resumed across conversations. Each session has a container with a
/workspace/directory where the agent stores its notes about that user. The session’s file system is the memory store — Claude’s nativeread,write, andedittools work directly against it. - An MCP server (
coach-context) exposes four tools to the agent:get_user_context,get_shopping_context,get_strain_details, andfind_similar_strains. These proxy to Convex and Supabase so Coach has live access to the user’s data and the strain database. - The browser extension pushes shopping context to a dedicated Hono endpoint (
POST /api/v1/shopping/context), which upserts into a ConvexshoppingContexttable. The MCP server reads from this table at the start of each turn, and the agent writes the latest snapshot to/workspace/shopping-context.md.
Local testing guide
Prerequisites
Before you can test Coach locally, you need:- Anthropic API key with Managed Agents beta access — The beta header
managed-agents-2026-04-01must be allowed on your org. Check with:A 200 response (even with an empty list) means you have access. A 403 means you need to request beta access from Anthropic. - A running Convex dev deployment —
pnpm turbo dev --filter=@highiq/mobileorcd apps/mobile && npx convex dev. The coach-context MCP server proxies user data through Convex, so the dev deployment must be reachable. - Clerk test user with Pro tier — Use
testuser+clerk_test@example.comwith verification code424242. SetsubscriptionTier: 'pro'on the user row in Convex via the dashboard or a manual mutation. Without this, the Pro gate will return a 402 and you’ll never reach Coach. - Environment variables set in
apps/api/.env.local: - Feature flag enabled — In
apps/mobile/src/_config/featureFlags.ts, setcoach_enabled: truefor thedevenvironment. This flag is off by default and should stay off in staging and production builds.
Phase 1: Infrastructure smoke test (curl only)
Before touching the mobile app or the API routes, confirm Coach’s infrastructure is reachable directly.Create the Coach agent
One-time setup. Creates the Agent definition that every session will reference.Save the returned
id into COACH_AGENT_ID.Create the Coach environment
Also one-time. Defines the container template the agent runs in.Save the returned
id into COACH_ENV_ID.Phase 2: API integration test
With infrastructure confirmed, test the Hono API routes that the mobile client will hit.Start a session for the Clerk test user
{ "sessionId": "session_...", "isNew": true }.If you get a 402 pro_required response, the Clerk user doesn’t have subscriptionTier: 'pro' in Convex. Fix that first.Send a message and stream the response
Phase 3: Mobile UI test flow
With the API confirmed, test the end-to-end mobile experience.Verify the Pro gate
Navigate to the Ask AI entry point.
- If the Clerk user is on
subscriptionTier: 'free', you should see theCoachUpgradePromptwith “Upgrade to Pro — $12.99/mo” as the only CTA - If the user is on
subscriptionTier: 'pro', you should see the Coach chat UI
Conversation round-trip
Send: “I tried Blue Dream last night. It was too heady for me.” Wait for the response. In the debug sidebar (visible in
__DEV__ builds only), verify that /workspace/tasting-log.md now contains a Blue Dream entry.Shopping context injection
In a separate terminal, simulate a browser extension push:Now in the mobile app, ask: “What do you think about what I’m looking at?” Coach should reference Gelato 41 specifically.
Phase 4: Measurement
The whole point of the spike is to collect data on whether Coach is viable. Capture these numbers:| Metric | Where to find it | Target |
|---|---|---|
| Active CPU seconds per interaction | session.stats.active_seconds from GET /v1/sessions/{id} | < 20s per typical question |
| Input tokens per turn | session.usage.input_tokens | < 30k (benefits from caching after turn 2) |
| Cache hit rate | cache_read_input_tokens / total_input_tokens | > 60% after the first turn |
| Session resumption latency | Time from /coach/resume to first agent.message event | < 3s |
| Cost per “heavy user day” | 5 interactions × measured cost | < $0.10/day |
| Cost per Pro user per month | Heavy day cost × 30 | < $3.00/month |
docs/superpowers/specs/2026-04-08-cannabis-coach-spike-results.md. If the monthly cost is under 3–6, iterate (try Sonnet 4.6 instead of Opus, tighten the tool surface). If it’s over $6, kill the spike.
Enabling and disabling
Coach is gated by thecoach_enabled feature flag in apps/mobile/src/_config/featureFlags.ts.
dev value to false. The Ask AI entry point will fall back to the existing Deep Research implementation for all users, Pro or free, and no Managed Agents sessions will be created.
This flag is also the production kill switch. If Coach ships and we need to roll it back fast, flipping
production: false is enough — the mobile app will stop creating new sessions and stop routing Ask AI to the /coach/message endpoint. Existing sessions stay alive in Anthropic’s infrastructure but will idle out on their own schedule.Known limitations
- Beta API — Claude Managed Agents is in beta (
managed-agents-2026-04-01). The API surface can change between releases. Isolate all Coach-related code behind theapps/api/src/services/coach/boundary so a swap is localized. - Vendor lock-in — Coach bypasses Vercel AI Gateway and calls Anthropic directly. No multi-provider fallback for this feature.
- Cold start latency — Session resumption reads the container’s file system. First turn after a long idle may be slower than subsequent turns.
- Session eviction — Anthropic may terminate idle sessions on their own schedule. When that happens,
/api/v1/coach/resumecreates a new session and returnswasReset: true. The mobile UI shows a toast: “Your Coach started fresh — previous history is not available.” Workspace files from the terminated session are NOT recovered in v1. - Privacy — Learned preferences and shopping context are stored on Anthropic’s infrastructure. Pro tier is explicit opt-in; a privacy notice should appear at enrollment (not yet implemented).
- No proactive notifications — v1 is reactive only. The v2 design note for scheduled proactive notifications is in the spike plan but not implemented.
Related
- Spike plan:
~/.claude-personal/plans/whimsical-twirling-hippo.md(local to development machines) - Product stance: What’s in Pro
- Current Ask AI backing feature: Professor High
- Shopping extension: Safari Extension
- Related planned feature: Shopping Agent
