Cravli
AI / RAG2024

CRAVLI

LiveKit voice onboarding, GPT-4o seven-day meal plans, Clerk + Stripe, Python agent on GCP + Next.js 14 on Vercel.

7
Days per AI meal plan
2
Production deploy surfaces
<5s
Target voice round-trip
SCROLL
Client
Domain
AI / Health
Platform
Next.js + Python
Duration
Core Stack
Next.js · LiveKit · OpenAI · Prisma
The Brief

THE
PROBLEM

Built an AI-powered nutrition and meal-planning platform with real-time voice onboarding. The Next.js 14 App Router uses Clerk and Stripe with webhook-driven lifecycle tracking. Users join a LiveKit room where a Python agent (Deepgram STT, GPT-4o, OpenAI TTS, Silero VAD, Krisp) collects preferences and writes profiles to PostgreSQL via Prisma — then GPT-4o generates seven-day plans with nutrition, recipes, and images persisted across relational tables.

Browser → Next.js 14 (Clerk, Stripe, server actions, shadcn, R3F landing) ↔ LiveKit ↔ Python agent → Prisma/Supabase | LangGraph + Tavily for recipe enrichment | Bull/ioredis for background jobs | Stripe webhooks for subscriptions.

Core Engineering Challenge

Coordinating LiveKit token creation, agent join, and Prisma write-back from Python; a fallback voice pipeline on Next.js API routes for clients without LiveKit; Stripe webhook idempotency; structuring GPT-4o output into MealPlan → DailyMeal → NutritionValue → Recipe; split deploy (Vercel + GCP Compute Engine).

2
Surfaces
LiveKit
Voice
Extended stack
frontend
Next.js
backend
Python
backend
LiveKit
ai
OpenAI
database
Prisma
Voice meal planning
Voice meal planning
How we built it

THE ARCHITECTURE

01
Clerk & Stripe lifecycle

Auth with webhook-driven user sync to Prisma; subscription gating and payment-intent creation via server actions.

ClerkStripePrisma
02
LiveKit voice onboarding

Python agent collects allergies, goals, cuisines; profile persisted through Prisma from the agent runtime.

LiveKitDeepgramGPT-4o
03
Seven-day meal generation

GPT-4o structured output mapped to MealPlan, DailyMeal, NutritionValue, and Recipe rows with Recharts on the dashboard.

OpenAIPrismaRecharts
04
LangGraph + Tavily enrichment

Secondary agent searches the web to enrich recipes and keep plans varied beyond a single prompt.

LangGraphTavily
05
Fallback & background work

Next API routes for STT → GPT-4o → TTS when needed; Bull/ioredis for async jobs; R3F landing for marketing craft.

Next.jsBullThree.js
System Data Flow
Ingestion
CrawlerContent Hash10K+ pages
Processing
ChunkerDeduplicatorEmbedding API
Storage
pgvectorPostgreSQLRedis Cache
Auth
Identity ProviderJWT BridgeSessions
Query
HNSW SearchRe-rankerLLM Stream
Delivery
Web AppMobile AppUsers
What we delivered

THE RESULTS

2

Marketing and authenticated app on Vercel alongside the Python LiveKit agent on GCP Compute Engine, with GitHub Actions SSH deploy — so voice latency and web UX could evolve independently without blocking releases.

2
Surfaces

Marketing and authenticated app on Vercel alongside the Python LiveKit agent on GCP Compute Engine, with GitHub Actions SSH deploy — so voice latency and web UX could evolve independently without blocking releases.

LiveKit
Voice

Primary onboarding path through managed rooms and server-side agents; Deepgram STT and OpenAI TTS with Silero VAD and Krisp filtering, plus Next.js API fallback when LiveKit is unavailable for constrained clients.

Visual documentation

SCREENS &
INTERFACES

Next.js dashboard
Next.js dashboard
Engineering decisions

TECH
DEEP DIVE

LK
LiveKit over raw WebRTC

Managed rooms and first-class server agents versus self-hosted TURN and signaling for a voice-first MVP.

Deepgram beat Whisper-class paths on latency for real-time STT in the agent loop.

CLK
Clerk over bespoke auth

Managed identity with webhooks that map cleanly to Prisma users and middleware-gated routes.

Supabase PostgreSQL + Prisma (TS and Python clients) fit relational meal data better than document stores.

PY
Python for the LiveKit agent

Mature LiveKit agent SDK and audio stack versus forcing the voice loop into Node for parity alone.

LangGraph + Tavily added agentic search without rewriting the core meal-plan generator.

Next Case Study
Blockchain
GMXSubstreams

Protocol Indexing Pipeline

RustSubstreamsTimescaleDB
Start a project

LET'S
BUILD
SOMETHING.

We take on a small number of projects at a time. If the problem is hard, we're interested.

Email
hello@techmusketeers.com
Response time
Within 24 hours
Availability
Open for new projects · 2025