Skip to content

richtan/MomTestStudio

Repository files navigation

Voice Customer Coach

A greenfield Next.js app for practicing Mom Test-style customer interviews with realtime Gemini voice personas, a silent visual coach, and an exportable post-session debrief.

What is built

  • Apple-inspired setup flow where a website URL alone is enough; optional text, images, pitch deck PDFs, and audio memos enrich the context.
  • Context synthesis route using Gemini 3.5 Flash, with Managed Agent notes attempted for URL/image context and graceful local fallback when no API key is present.
  • Curated customer personas plus a Custom persona text box, all with voice names for gemini-3.1-flash-live-preview and grounded by content/customer-speech.md so they sound like real humans instead of assistants.
  • Ephemeral Live API token route that keeps GEMINI_API_KEY server-side.
  • Browser Live session hook with AudioWorklet PCM capture, typed text input, PCM playback, input/output transcription accumulation, silence nudges, and teardown.
  • Synced text transcript for both spoken and typed founder turns plus customer voice output transcription.
  • Live customer persona attempts Google Search grounding for public facts, competitors, pricing, docs, reviews, and websites mentioned during roleplay.
  • Parallel Mom Test coach evaluators on gemini-3.5-flash with explicit thinking levels and deterministic fallback heuristics.
  • Session report generation, markdown copy, and .md download.

Models

Layer Model
Voice persona gemini-3.1-flash-live-preview
Context synthesis gemini-3.5-flash + Managed Agent notes where available
Live coach gemini-3.5-flash
Session report gemini-3.5-flash

Environment

Copy .env.example to .env.local:

GEMINI_API_KEY=your_google_gemini_api_key_here
NEXT_PUBLIC_APP_URL=http://localhost:3000

Without GEMINI_API_KEY, the app still demos setup, fallback context synthesis, heuristic coaching, and report export. Live voice requires the key.

Development

npm install
npm run dev

Open http://localhost:3000.

Verification

npm run typecheck
npm run lint
npm test
npm run build

A local smoke test was also run against the dev server for:

  1. / page load
  2. POST /api/context/synthesize fallback response
  3. POST /api/coach/evaluate heuristic Mom Test flagging

Project structure

  • app/ — App Router pages and API routes
  • components/setup/ — context intake and persona picker
  • components/session/ — live practice studio, transcript, coach rail
  • components/report/ — debrief UI and export actions
  • hooks/useCustomerLiveSession.ts — Live API client lifecycle and audio handling
  • lib/coach/parallel-evaluate.ts — parallel rubric evaluators
  • lib/personas.ts — curated v1 personas
  • content/mom-test.md — editable coaching reference read by coach/report agents
  • content/customer-speech.md — editable persona speech guide read by the Live customer token route
  • agents/context-synthesizer/AGENTS.md — Managed Agent instructions

Deployment notes

Deploy to Vercel and set GEMINI_API_KEY for Production and Preview. The API routes are dynamic server routes and return Cache-Control: no-store for token/coaching/report responses.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors