Content Engine, Rich Media & MasteryOS Feature Layer
A new layer on top of the 4-layer stack: content publishing engine, AI-generated rich media in NowPage, gated resource library in MasteryOS, and MasteryBook features surfaced natively inside MasteryOS.
What We're Building
The 4-layer stack (Create → Extract → Distribute → Monetize) has been defined. This doc adds the production capabilities that make each layer generate revenue independently and compound into each other.
Content Engine
MasteryBook research → multiple content formats → published via NowPage. Mastery Minutes, blog posts, podcast episodes, visual summaries — all generated from one source document.
Rich Media in NowPage
NowPage HTML pages embed AI-generated images (Nanobanana/Imagen), audio overviews, and video. Assets stored in Supabase Storage. Every HC page becomes a full multimedia experience.
MasteryOS Feature Layer
All content artifacts and MasteryBook capabilities surface natively inside MasteryOS — gated behind subscription tiers. Experts toggle premium features on. Users access them within their subscription.
The Core Design Principle
MasteryBook is the engine. MasteryOS is the storefront. NowPage is the window display. The expert creates once in MasteryBook — the content engine formats it into everything, NowPage publishes it publicly, and MasteryOS gates the full version behind a subscription. One expert action → compounding content output across all three layers.
The Content Engine
A new service layer that sits between MasteryBook (extraction) and NowPage (publishing). Takes structured MasteryBook output and transforms it into multiple content formats simultaneously.
Input: MasteryBook source_guide JSON
summary, key_points, topics, insights, full_text. Already generated on every upload. The content engine subscribes to a webhook when a source's status changes to "ready."
Content Engine processes in parallel
Runs multiple LLM calls concurrently: blog post, Mastery Minutes, podcast script, visual prompt, social snippets, email digest. Each format has its own prompt template calibrated to the expert's voice/tone profile.
Rich media generation
Podcast script → ElevenLabs/MasteryBook audio pipeline → .mp3 in Supabase Storage. Visual prompt → Nanobanana/Imagen API → .png in Supabase Storage. Video script → queued for video generation (Veo or similar).
Asset catalog in MasteryOS
All outputs written to MasteryOS resource library with metadata: format, created_at, source_id, access_tier. Expert can preview and selectively publish each piece.
Expert approves → NowPage publishes
Expert reviews generated content in MasteryOS dashboard. One-click publish sends to NowPage with all rich media embedded. Page goes live on expert's domain with full multimedia.
Gating: public teaser + subscriber full access
NowPage shows: summary + first insight + audio clip preview (60 sec) + image. Full podcast, full blog, all insights, video → subscriber-only in MasteryOS. Assessment at bottom of NowPage page → MasteryOS signup.
Mastery Minutes
The signature content format: a 300-500 word distillation of one expert insight, designed to be consumed in under 2 minutes. Think "HBR Daily" or "Morning Brew" — but for the expert's specific methodology.
Mastery Minutes Format
- Hook: The one thing you'll know after reading this
- Context: Why this matters right now (2 sentences)
- The insight: The expert's framework in plain language
- The application: One action to take today
- The 2nd order: What changes if you get this right
- CTA: "Go deeper →" link to MasteryOS subscriber page
Distribution Channels
- NowPage HC page (public, SEO-indexed)
- Email digest (to NowPage community subscribers)
- Social post variants (Twitter thread, LinkedIn, Instagram caption)
- MasteryOS subscriber feed (premium: full with audio)
- Podcast episode (premium audio layer)
- Weekly digest bundle (5 minutes → email roundup)
The Volume Play
An expert with 20 documents in MasteryBook has 20 potential Mastery Minutes — each a standalone HC page indexed by Google. At 50 documents, that's 50 indexed pages linking back to their MasteryOS profile. The content engine turns passive uploads into an always-on SEO and lead generation machine. No extra expert effort required.
NowPage Rich Media
NowPage stores and serves raw HTML from Supabase. That HTML can embed anything a browser can render. There's no hard limitation — the constraint is asset storage and CDN delivery, not the page format itself.
| Media Type | How It Works | Storage | Status |
|---|---|---|---|
| AI-Generated Images | Nanobanana/Imagen API → .png → Supabase Storage → <img src="..."> in page HTML |
Supabase Storage (public bucket) | Needs image gen + storage wiring |
| Audio Overviews | MasteryBook audio_overview → .mp3 → Supabase Storage → <audio controls> in HTML |
Supabase Storage | Audio gen exists, storage wiring needed |
| Video | Veo/video gen → upload → Supabase Storage or YouTube → <video> or iframe |
Supabase Storage or YouTube embed | Planned — video gen not integrated yet |
| Podcast Player | Styled <audio> tag with waveform preview. Episode metadata in HTML. Full episode behind paywall link. |
Supabase Storage | Audio gen exists, player UI needed |
| Interactive Assessment | JavaScript quiz embedded in HTML. Answers → POST to API → lead capture → MasteryOS signup trigger. | No storage needed (JS inline) | Template needed |
| Infographics / Visual Summary | Content Engine generates structured data → renders as styled HTML (no image needed) OR Imagen generates graphic. | Supabase Storage or inline HTML | HTML approach possible now |
Image Generation: Nanobanana / Imagen
Nanobanana is Google's image generation capability accessible via Gemini API (Imagen model family). It's the same infrastructure as Google's ImageFX. MasteryBook's Gemini integration gives us direct access.
Content Engine generates a visual prompt
From the source_guide JSON: "Create a professional infographic-style hero image for a coaching framework about [topic]. Style: clean, dark background, [expert brand colors]. No text in image."
Gemini Imagen API call
POST https://generativelanguage.googleapis.com/v1beta/models/imagen-3.0-generate-001:predict with the prompt. Returns base64-encoded PNG. Uses expert's BYOK Gemini API key from Credential Vault.
Upload to Supabase Storage
Decode base64 → upload to public/expert-{id}/images/{source-id}.png bucket. Get the public CDN URL.
Embed in NowPage HTML
NowPage template places <img src="{cdn_url}" alt="{expert} framework visualization"> in the hero section. Optimized with lazy loading and responsive sizing.
Image stored in MasteryOS resource library
Same URL stored as a resource in MasteryOS. Expert can reuse the image in other contexts. User with access can download for their own use (premium tier feature).
Asset Storage Architecture
All rich media assets need a consistent, CDN-backed storage pattern. Supabase Storage is already in the stack — it becomes the asset CDN for the entire ecosystem.
| Asset Type | Bucket Structure | Access Policy | CDN URL Pattern |
|---|---|---|---|
| Expert avatars | experts/{id}/avatar.png | Public | supabase.co/storage/v1/object/public/experts/... |
| AI-generated images | content/{expert-id}/{source-id}/hero.png | Public (teaser) / Auth (full res) | Same pattern, auth header for full res |
| Audio overviews | audio/{expert-id}/{source-id}/overview.mp3 | Signed URL (subscriber only) | Signed URL with expiry (1h) |
| Video content | video/{expert-id}/{source-id}/video.mp4 | Signed URL (subscriber only) | Signed URL with expiry (1h) |
| PDF exports | exports/{expert-id}/{source-id}/export.pdf | Signed URL (subscriber only) | Signed URL with expiry (1h) |
| NowPage teaser audio | teasers/{expert-id}/{source-id}/60s.mp3 | Public (first 60s only) | Public CDN URL |
The Teaser Architecture
Every piece of premium content has a public teaser version and a gated full version. NowPage hosts the teaser. MasteryOS hosts the full version behind a subscription gate. This creates a consistent conversion funnel: discover on NowPage → taste the teaser → subscribe in MasteryOS to get the full version. Every asset is both marketing and product simultaneously.
MasteryOS Resource Library
A structured, searchable library of all content artifacts produced by or for an expert — gated behind subscription tiers. The library is the primary value proposition for MasteryOS subscribers beyond the AI assistant.
| Resource Type | Produced By | Access Gate | Expert Controls |
|---|---|---|---|
| Mastery Minutes (articles) | Content Engine from MasteryBook | Free preview on NowPage / Full in MasteryOS subscriber tier | Publish/unpublish, set tier, edit before publish |
| Audio Overviews (podcasts) | MasteryBook audio_overview pipeline | 60s teaser public / Full episode subscriber-only | Toggle on/off, set episode number, add description |
| Visual Frameworks (images) | Content Engine + Nanobanana | Compressed preview public / Full resolution subscriber | Approve/reject generated image, set as featured |
| Research Reports | MasteryBook research_tasks | Executive summary public / Full report subscriber | Set summary excerpt, gate full report |
| Study Materials (flashcards/quizzes) | MasteryBook study_materials | Preview 5 cards / Full deck subscriber | Edit cards, add expert commentary |
| Video Overviews | MasteryBook video pipeline (when built) | 30s trailer public / Full video subscriber | Approve/reject, set thumbnail |
| Live Chat Insights | MasteryOS AI assistant sessions | Featured Q&As public / Subscriber access to AI chat | Pin best answers as featured resources |
| Downloadable PDFs | Content Engine exports | Subscriber-only | Set which tier, track downloads |
MasteryBook Features Native in MasteryOS
From a subscriber's perspective: they never leave MasteryOS. The "Create Podcast" button looks like an MasteryOS feature. Behind the scenes it's a POST to the MasteryBook API. Results come back into the MasteryOS resource library. The seam is invisible.
Expert enables "Podcast Generation" in MasteryOS expert settings
Feature toggle ON (costs +$X/mo, billed via Stripe). Expert's enabled_features array updated: ["basic_rag", "audio_overview", ...]
Subscriber sees "Create Audio Overview" in MasteryOS
Only visible if expert has audio_overview feature enabled AND subscriber's tier includes it. MasteryOS UI renders the button natively. No mention of "MasteryBook."
Subscriber clicks → MasteryOS API layer intercepts
POST /api/resources/create with {type: "audio_overview", source_ids: [...], subscriber_id: "..."}. MasteryOS backend validates feature access.
MasteryOS calls MasteryBook API
POST masterybook.api/audio-overview with expert's namespace + source IDs. MasteryBook API key stored in Credential Vault. Result: audio_url, script, duration.
Result stored in MasteryOS resource library
Audio file uploaded to Supabase Storage. Row created in resources table: {type: "audio", url: "...", created_by: subscriber_id, source_ids: [...], access_tier: subscriber_tier}
Subscriber can play, download, share (based on tier)
The audio lives in MasteryOS. Subscriber never needs to know about MasteryBook. Expert sees subscriber-generated content in their resource library too — both parties contributed to a shared knowledge artifact.
Premium Feature Model + Pricing
Features are billed as add-ons on top of the base MasteryOS platform. Expert pays to enable the feature. Subscribers access it within their subscription tier. This is the same model as the voice agent.
Expert uploads content → AI generates conversational podcast episode from their material. ElevenLabs voice synthesis with expert's voice clone (optional).
Expert add-on: +$29/mo
Subscriber access: included in Standard+ tier
AI-generated visual frameworks, infographics, and hero images from expert content. Uses expert's Gemini BYOK key (Imagen). Zero cost to Jason.
Expert add-on: +$19/mo
Subscriber access: included in Standard+ tier
MasteryBook's multi-step research pipeline: subscriber asks a complex question → agent plans searches → synthesizes across all expert content → returns structured report.
Expert add-on: +$39/mo
Subscriber access: Premium tier only
AI-generated short video summary of expert content. Veo (Google) or similar. Script from MasteryBook → AI voiceover + visual → video file stored.
Expert add-on: +$49/mo
Subscriber access: Premium tier only
Real-time voice conversation with expert's AI assistant. LiveKit WebRTC. Currently too slow — see voice stack section. $10/mo add-on model already defined.
Expert add-on: +$10/mo
Subscriber access: Premium tier or voice add-on
MasteryBook-generated flashcards, quizzes, and study guides from expert content. Subscriber can study, test themselves, track progress against expert's framework.
Expert add-on: +$19/mo
Subscriber access: Standard+ tier
The Full Access Tier Model
Every piece of content and every feature lives at exactly one access level. This is the gating model that makes BYOK + feature flags work consistently across the entire stack.
$297/mo
$497/mo
$2,497/mo
Voice Agent Speed: Root Cause + Fix
LiveKit is the right transport layer (WebRTC, peer-to-peer). The speed problem is almost certainly in the AI processing pipeline, not the transport. The latency stack to diagnose:
STT → LLM → TTS
STT: Whisper ~500ms. LLM: GPT-4 or similar ~1,500-3,000ms. TTS: ElevenLabs standard ~800ms-1,500ms. WebRTC overhead: ~100ms. Sum: painfully slow.
Deepgram + Groq + Cartesia
Deepgram Nova-3 STT: ~50ms. Groq LLaMA 3.1 70B or Gemini Flash: ~100-200ms. Cartesia TTS streaming: ~50-80ms first audio chunk. Total: under 400ms perceived.
Audio-to-Audio, No Pipeline
OpenAI GPT-4o Realtime: takes raw audio in, returns raw audio out. No separate STT/TTS. ~300ms end-to-end. WebSocket-based. Works with LiveKit's transport. Simplest stack.
Recommended Fix
Short term (this week): Switch to Option A — replace the LLM with Groq and switch TTS to Cartesia or ElevenLabs Flash. The STT can stay as-is or switch to Deepgram. This change is 3-4 lines of code in Ashwini's voice backend.
Medium term: Migrate to OpenAI Realtime API. Audio-to-audio eliminates the STT/TTS pipeline entirely. LiveKit stays as the transport layer — Realtime API gives you the AI stream, LiveKit distributes it. This becomes the definitive voice stack.
| Component | Current | Fast Alternative | Latency Impact |
|---|---|---|---|
| Speech-to-Text | Whisper (OpenAI) ~500ms | Deepgram Nova-3 ~50ms | −450ms |
| LLM inference | GPT-4 ~2,000ms | Groq Llama 3.1 70B ~150ms or Gemini Flash ~200ms | −1,800ms |
| Text-to-Speech | ElevenLabs standard ~1,200ms | Cartesia streaming ~60ms first chunk or ElevenLabs Flash ~200ms | −1,000ms |
| Transport | LiveKit WebRTC ✓ | Keep LiveKit — it's not the problem | No change needed |
2nd Order Effects
Build Order (Cascade)
Content Engine + Asset Storage
- Supabase Storage buckets + access policies
- Content Engine service: source_guide → Mastery Minutes
- Audio: wire MasteryBook audio_overview → Storage
- NowPage template: embed audio + image tags
- "Publish to NowPage" button in MasteryBook UI
MasteryOS Resource Library + Feature Bridge
- resources table in MasteryOS DB (type, url, tier, source_ids)
- Resource library UI in MasteryOS dashboard
- MasteryBook API integration in MasteryOS backend
- Feature flag system (enabled_features per expert)
- Stripe add-on billing for premium features
Image Gen + Voice Fix + Deep Research
- Nanobanana/Imagen integration in Content Engine
- Voice agent: swap LLM to Groq + Cartesia TTS
- Deep research feature flag + MasteryBook wiring
- Study materials gating in MasteryOS
- Video overview pipeline (when Veo stable)
The One-Line Summary
Every content format has a public teaser and a subscriber full version. Every feature has a base tier and premium add-ons. The voice agent gets fast. The whole stack compounds because each piece drives demand for the next.
Published March 2026 · Command Center · MasteryBook Integration · Ecosystem Vision