Skip to content

About

Wonderdive: learning doesn't have to be boring. Interactive F13 video lessons that play like a game (Big Berlin Hack 2026).

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Wonderdive

Learning doesn't have to be boring. Turn any topic, PDF, photo, or voice note into an interactive video lesson that draws itself and plays like a game—with a voice agent you can ask anything, which answers your questions out loud and uses tools to navigate, dive in, and create new dive-ins when asked.

▶ Live App · 📑 Pitch Deck (/pitch) · 🎬 2-Min Demo Video · 🧩 Partner Tech Map · 📚 Docs
Featured 3-min demos: 🪐 Solar System · 🦖 Dinosaurs · 🫀 Heartbeat

▶ Watch 2-Min Demo Track F13 Google DeepMind Gradium Tavily Aikido
Big Berlin Hack 2026 Next.js FastAPI Supabase


Wonderdive Field Guide lesson stage playing Age of Dinosaurs in colored F13 vector plates — click to watch the 2-minute demo video on Vimeo
▶ Watch the official 2-minute Wonderdive demo on Vimeo (2:00)
The 2-minute demo video's narration audio was also generated with Gradium, using the Harper voice.

What it does

  • 📝 Create from anything: Type a question or attach a PDF, photo, or voice note in EN / DE / ES / FR / PT—uploads drive the lesson plan (5–10+ ordered units scaled by complexity).
  • ✏️ Watch colored F13 plates draw themselves: 1–3 F13 vector drawings per plate over fixed-palette scene backdrops (compose.py), semantically colored with a 16-token Field Guide palette (svg-colorist + colorize.py) and animated by sandbox-verified Gemini code in one locked Gradium voice.
  • 🎙️ Voice agent: Hover or tap for live Q&A with tool use—it answers your questions out loud (about any part or the lesson) and uses tools (navigate, answer_about_part, search_sources for "Learn more" links, ask_clarification, and create_dive_in when asked for a new dive-in video).
  • 🔍 Dive into parts or branch deeper: Open instant D1/D2 part dives or generate a bonus scene (shown as a blinking construction row in the chapters strip) that slots at the next chapter break.
  • 🎯 10 s checkpoints, XP & shared leaderboard: Answer 10 s ticking checkpoints (+XP/streaks on hits, strike & continue on misses with an AI recap at the end), and share /play/<slug> so friends play the same Field Guide lesson by nickname and compete on the end-screen leaderboard.

How a video is built

Lessons show ordered build stages (Researching → Planning → Blocks n/N) and unlock ▶ Play via a build-ahead ETA gate for gap-free playback:

flowchart LR
  in["📄 Input<br/>topic · PDF · photo · voice"] --> res["🔎 Research + Grounding<br/>Tavily + PDF/media extract"]
  res --> plan["🧠 Plan (Gemini)<br/>5–10+ ordered units<br/>by complexity"]
  subgraph block["Per-block priority lanes"]
    direction LR
    f13["✏️ 1–3 F13 drawings<br/>+ 9-token backdrop"] --> col["🎨 svg-colorist<br/>16-token palette (<2 s)"]
    col --> anim["🛡️ Gemini motion<br/>verified in DeepMind sandbox"]
    tts["🔊 Gradium TTS<br/>locked voice + timings"]
    anim & tts --> evt["⚡ segment.ready<br/>+ ready_at"]
  end
  plan --> block
Loading
sequenceDiagram
  autonumber
  participant W as Priority Worker Lanes
  participant E as Realtime & Build-Ahead ETA
  participant P as Lesson Stage Player
  Note over E,P: ▶ Play starts disabled while Researching -> Planning -> Building blocks
  W->>E: segment.ready (Blocks 0..2, ready_at)
  E->>P: Measure s/block vs playback -> ETA safe (>=2-3 / 30% ready) -> Unlock ▶ Play
  W->>E: segment.ready (Blocks 3..N stream ahead of playhead)
  alt Playhead ever catches up to build edge
    P->>P: Hold calmly ("Building the next chapter… ~Ns") -> auto-resume when ready
  end
  opt Learner asks voice agent for a new dive-in
    P->>W: create_dive_in tool -> blinking construction row after chapter
    W->>E: explainer.ready + placement-planner boundary
    E->>P: Slots ✦ dive-in cleanly after chapter break, then resumes main story
  end
Loading

Architecture

flowchart LR
  subgraph Vercel["Vercel"]
    web["🌐 Next.js Web App<br/>Field Guide UI · Nonce CSP · /pitch"]
    ifr["🔒 /sandbox.html<br/>Opaque-origin animation iframe"]
  end
  subgraph FastAPI_Cloud["FastAPI Cloud"]
    api["⚡ FastAPI Backend<br/>Auth · Rate Limits · Lanes"]
    adk["🤖 Google ADK 2.0<br/>Voice Agent · Q&A + Tools"]
  end
  supa[("🗄️ Supabase<br/>Auth · Postgres + RLS<br/>Storage · Realtime")]
  gem["🧠 Google DeepMind<br/>Gemini 4 + Pre-warmed VM Sandbox"]
  f13["✏️ F13 Espresso<br/>1–3 SVG Drawings + Backdrops"]
  grad["🔊 Gradium Voice<br/>Live STT + Locked TTS"]
  tav["🔎 Tavily<br/>Search + Extract"]
  aik["🛡️ Aikido + CodeQL<br/>Repo & Live App Security"]

  web <--> api
  web --> ifr
  web -. "Signed uploads + Realtime" .-> supa
  web -. "24 kHz PCM + single-use token" .-> grad
  api <--> adk
  api <--> supa
  api --> gem & f13 & grad & tav
  adk --> gem & tav
  aik -. "Scans" .- api & web
Loading

Voice agent for Q&A with tool use (Gradium STT → Google ADK 2.0 → Gradium TTS):

sequenceDiagram
  autonumber
  actor L as Learner
  participant P as Stage + AudioWorklet
  participant S as Gradium STT (EU)
  participant A as Voice Agent (FastAPI + ADK 2.0)
  participant T as Gradium TTS
  L->>P: Hover stage or tap Talk to AI (6 s hover-out grace, engaged stays open)
  P->>A: POST /v1/voice/token -> single-use EU ws_url
  L->>S: Speak (24 kHz 16-bit mono PCM)
  S-->>P: Live transcript + end-of-turn
  P->>A: POST /v1/lessons/{id}/agent
  alt Deterministic fast path (~10-35 ms)
    A-->>P: Instant navigate / D-badge / prepared part answer
  else Google ADK 2.0 Q&A + tool use (~0.7 s p50, gemini-3.1-flash-lite)
    A->>A: Spoken Q&A + tools (create_dive_in · navigate · answer_about_part · search_sources · ask_clarification)
    A->>T: Synthesize spoken reply (locked lesson voice)
    T-->>A: Audio clip
    A-->>P: Spoken answer + tool action (dive-in job / nav / Learn-more links / clarify options)
  end
Loading

Docs: Architecture · API · Partner Tech Map · Skills · Flags & Limits · Stage Demo.

How we use each technology

Verification matrix (file paths, symbols, endpoints, test commands): docs/partner-tech.md.

  • F13 Espresso (Track): Every scene composes 1–3 F13 vector drawings with named data-part shapes, labels, fixed-palette scene backdrops (apps/api/app/services/f13/, apps/api/app/services/compose.py, skills/f13-request-writer/), and multi-scale zoom stages (apps/web/components/player/). Load-bearing: flat pixels cannot support part-level motion, D1/D2 dive badges, or part-aware Q&A for the voice agent.
  • Google DeepMind (Gemini 4 · Managed-Agent Sandboxes): Gemini models ground PDFs/photos/audio (apps/api/app/services/pdf.py, skills/content-analyst/), plan 5–10+ ordered units by complexity (skills/lesson-planner/), semantically color SVG parts via a fixed 16-token Field Guide palette (apps/api/app/services/colorize.py, skills/svg-colorist/), write puppet animation JS (skills/svg-animator/), power sub-second voice routing (GEMINI_MODEL_AGENT), and write mistake recaps (POST /v1/quiz/review). Pre-warmed Managed-Agent sandboxes verify every animation fail-closed in node:vm + DOM/bounds checks before it plays (apps/api/app/services/gemini/sandbox.py, apps/api/app/jobs/verify_animation.py). Load-bearing: powers every plan, semantic palette map, and verified motion script.
  • Google ADK 2.0 (Google DeepMind): The brain of our voice agent for Q&A and tool use: answers the learner's questions out loud (about any part or the lesson) and uses tools (POST /v1/lessons/{id}/agent, SkillToolset, per-(user, lesson) sessions, confirmation) to act—answer_about_part, navigate (pause/continue/next/back/replay/dive), search_sources (Tavily "Learn more" links), ask_clarification (asks when unsure), get_lesson_context, and create_dive_in (builds a new dive-in video when asked) (apps/api/app/agents/lesson_assistant/, apps/api/app/routers/agent.py). Load-bearing: routes every live voice Q&A turn and tool call.
  • Gradium: Powers our real-time voice agent for Q&A and tool use: live speech-to-text (EU region-bound single-use tokens at eu.api.gradium.ai) and the agent's spoken Q&A replies and tool confirmations, plus narration TTS in one locked voice per lesson with word timings (apps/api/app/services/gradium/, apps/api/app/routers/voice.py, apps/web/lib/gradium-mic.ts). The 2-minute demo video's narration audio was also generated with Gradium, using the Harper voice. Load-bearing: drives all real-time voice-agent speech and lesson narration.
  • Tavily: Runs web search + extract to ground lesson scripts and dive-ins, and powers the voice agent's search_sources tool during Q&A to attach clickable "Learn more" links (apps/api/app/services/tavily/, skills/researcher/, apps/api/app/agents/lesson_assistant/tools.py). Load-bearing: grounds facts and live out-of-lesson voice Q&A.
  • Aikido: Scans the repo (SAST, SCA, IaC, secrets, GitHub Actions) and live web app; surfaced findings we fixed across per-request cryptographic nonce CSP (no 'unsafe-inline' scripts), HSTS preload, fail-closed sandbox publishing, and lesson-scoped voice-token & private dive-in access hardening (SECURITY.md, apps/web/middleware.ts, apps/api/app/routers/_access.py, .github/workflows/security.yml). Load-bearing: enforces continuous security posture.

Run it locally

Prerequisites: Node 22+, Python 3.11–3.13, uv, and gitleaks (brew install gitleaks). Copy .env.example to .env and fill in the keys (every variable is explained in .env.example).

npm install && cp -n .env.example .env                                                   # 1. Hooks + env template
cd apps/api && uv venv && uv pip install -e ".[dev]" && uv run fastapi dev app/main.py   # 2. API on :8000 (/docs)
cd apps/web && npm install && NEXT_PUBLIC_API_BASE_URL=http://127.0.0.1:8000 npm run dev # 3. Web on :3000
  • Fixture mode (no keys): cd apps/web && npm run dev (with NEXT_PUBLIC_API_BASE_URL unset) plays bundled demo lessons offline.
  • Tests & secret scan: npm run security:scan · cd apps/api && uv run pytest -q · cd apps/web && npm test · Deploy: apps/api/README.md · apps/web/README.md.

Security

  • Server-only keys & nonce CSP: Vendor keys stay in apps/api; browser mic sessions use single-use EU Gradium tokens; apps/web/middleware.ts enforces per-request cryptographic nonces on scripts/styles (and SHA-256 hashes on /pitch).
  • 3-layer fail-closed animation sandbox: Candidate JS passes Acorn AST screening + pre-warmed Google DeepMind Linux VM (node:vm + nonce DOM verdict) before running in <iframe sandbox="allow-scripts"> (default-src 'none').
  • Untrusted input as data & RLS everywhere: Uploads, transcripts, wishes, Tavily snippets, SVGs, and quiz answers are sanitized/schema-validated; all 13 Supabase tables enforce RLS (points_ledger is service_role-only) and write routes enforce JWT auth + rate limits — see SECURITY.md.
  • Aikido live-app findings fixed in production: The Aikido live-app findings (CSP not set, HSTS missing, inline JS/CSS) are fixed in production (nonce CSP, style-src-attr only, and HSTS preload in apps/web/middleware.ts), while the Aikido dashboard had not re-scanned yet.

Aikido, 29 Nov 2026: findings before the re-scan picked up the fix
Aikido, 29 Nov 2026: findings before the re-scan picked up the fix

Built at Big Berlin Hack 2026

Wonderdive was built by Javier Peres at Big Berlin Hack 2026 (F13 track, 28–29 Nov 2026), with Google DeepMind Antigravity as the coding agent. Third-party licenses noted in docs/pitch/README.md.

Gemini API usage during the hackathon: 32,501,011 input tokens · 3,560,428 output tokens · 16,181 requests (building with Antigravity, the lesson pipeline and the voice agent).

Google AI Studio, project Big Berlin Hack, last 28 days
Google AI Studio, project Big Berlin Hack, last 28 days

About

Wonderdive: learning doesn't have to be boring. Interactive F13 video lessons that play like a game (Big Berlin Hack 2026).

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages