Inspiration

A seven-year-old at the dentist. Nobody told her about the light above the chair, the sound the water makes, or that the person in the mask would count her teeth out loud. Fifteen minutes later the appointment is abandoned and rebooked for a month away.

It was not the dentist that did that. It was not knowing.

In the United States, 1 in 31 eight-year-olds is identified with autism (CDC ADDM Network, MMWR, April 2025). Worldwide, about 61.8 million people — roughly 1 in 127 — are on the autism spectrum (Global Burden of Disease Study 2021, The Lancet Psychiatry, 2024). 74% of autistic children in a large US surveillance study had documented sensory features (Autism Research, 2022), so lights, noise and surprise land far harder. And when a visit goes badly the care often does not happen at all: 15.1% of US children with autism had an unmet dental need (Academic Pediatrics, 2014).

Families already have the fix. It is called a social story — a short, plain, first-person account of what will happen, read to the child beforehand — and meta-analyses find a moderate effect, strongest for school-aged children (Frontiers in Psychology, 2026). But parents hand-make them, one clip-art page at a time. A stock cartoon dentist is not their dentist. So most children never get one.

What it does

Preview Pal turns the sentences a parent already knows into a short film their child can watch before the real thing.

  • The adult writes the steps in their own words: "We will drive to the dentist. I will sit in the big chair."
  • A child profile holds what must stay constant — face, hair, one outfit, comfort items, the people who come along, real photographs of the actual places, and a sensory profile (sound, brightness, motion). Families choose an illustrated or photographic look.
  • Each step becomes a picture, then a moving clip, then one MP4 with narration.
  • A visual critic inspects every keyframe and the last frame of every clip against those locks and against the family's must-not-show list ("no needles", "no drill"), and re-shoots what fails.
  • An adult approves before the child ever sees it. The child then watches in a calm full-screen player tuned to their sensory profile, or the story prints as a booklet for the car.
  • After the real visit the adult records how it actually went, and that feeds the next story.

How we built it

  • Gemini acts as the director: for every step it composes the picture under locked constraints — this face, this outfit, this room, these comfort items — and never rewrites the parent's words. The steps are compiled deterministically from what the adult typed; the model decorates, it does not promise.
  • Gemini image generation renders each keyframe with the child's photo references and a real photograph of the location passed in.
  • Veo turns each step into a short moving clip; Gemini TTS speaks the narration; ffmpeg renders clips and voice into one film.
  • A second Gemini vision pass is the critic. Drift is caught at the last frame of a clip, not just the first, and repair regenerates the offending clip rather than the whole story.
  • ClickHouse Cloud is the memory: child profiles, real-visit outcomes, and every generation event. A Google ADK producer agent queries it through the official ClickHouse MCP server.
  • Next.js + Tailwind for the family app, Hono for the API, deployed with Docker Compose + Caddy on a Google Compute Engine VM with automatic HTTPS. Sign-in is local accounts or Google Identity Services.
  • Every finished story carries a continuity certificate: which pictures were checked, what was found, what was re-shot, and who approved it.

Challenges we ran into

  • Consistency is the whole product. A child who does not recognise themselves is not reassured — they are confused. Locking identity across dozens of independently generated frames took an explicit constraint contract plus a critic that reads generated frames back and compares them to the locks.
  • Video drifts at the end, not the start. A clip whose first frame is perfect can end with the wrong hair or an extra person. Checking only keyframes missed this entirely; inspecting the last frame of every clip caught real failures during our test runs.
  • Safety cannot be a prompt. "Please don't show a needle" is not a guarantee. The must-not-show list is checked after generation, and nothing is unlocked for the child until a human approves.
  • Plain language is a hard constraint. Social stories need short, literal, present-tense, first-person sentences. We added a language critic that flags idiom, negation, questions and vague pronouns — as advice to the adult, never as an automatic rewrite of what they promised.
  • Deployment held its own surprises: Docker publishes no packages for the VM's OS release, so the engine and compose plugin had to be assembled by hand.

Accomplishments that we're proud of

  • It is live, and a family can use it end to end: sign in, build a child, write a story, get a real video with narration, approve it, and watch it.
  • Nothing is faked. Every picture, clip, voice line and check is a real model call, and the artifacts are stamped with the provider that made them.
  • The critic catches genuine failures rather than acting as decoration — including the last-frame drift that a keyframe-only check would have shipped.
  • The adult's words survive the pipeline untouched. A story that over-promises is worse than no story at all.

What we learned

The interesting problem in generative video for this use case is not making something beautiful. It is making the same child, in the same clothes, in the same room, across every frame of every story, forever — and being able to prove it. That is a memory and verification problem, not a rendering one, which is why the database sits at the centre rather than at the edge.

We also learned to hide the machine. Families see "writing", "drawing", "moving pictures", "checking", "ready for you to look at". They never see a model name, a prompt or a pipeline.

What's next for Preview Pal

Clinic and school accounts, so a dental practice can keep a story for its own waiting room and send it home before the appointment. More languages. And measuring the thing that actually matters: did the visit go better?

Built With

Share this project:

Updates

Submission history