UQHQ is an agentic music and video studio. One creative brief becomes a song, a mix, a beat-synchronized edit, and a verified final MP4.
I created this article for the purpose of entering the Google Cloud All Things Agentic Hackathon.
The product does not stop after it suggests ideas. It creates durable production state, calls structured tools, runs long media tasks, and returns a real artifact. The creator can follow the work in the Creative Director chat and studio interface.
The engineering goal
The hackathon goal was direct: turn a creative brief into a complete music video in about four minutes. That was a target, not a promise for every workflow.
The final clean paid canary met the video target. The backend marked its render ready about 3m34s after the prompt. The interface showed the verified MP4 at 3m47s. The ADK mix handoff finished later, at about 4m41s.
UQHQ also recorded a separate warm-render result. A warm Cloud Run service rendered a 181.667-second video in 37.73 seconds. Those results describe recorded runs. They do not mean every creative brief always completes in four minutes.
The system at a glance
The system has three clear boundaries:
- Convex owns the authenticated production record, commands, receipts, edit snapshots, checkpoints, and render identity.
- Google services provide the models, agent framework, identity, queues, containers, and observability.
- Specialist media providers return media through private workers. UQHQ verifies the files and stores its own durable receipts.
The browser shows the server-owned production. It does not build the edit, authorize a render, or save permanent provider URLs.
Creative brief
-> Gemini Creative Director and Google ADK tools
-> Lyria master song and Gemini visual plan
-> MVSep stems and Fal motion clips run in parallel
-> ADK commits a real mix action and audition
-> server creates a beat-synchronized edit checkpoint
-> Cloud Task with OIDC invokes private Cloud Run rendering
-> FFmpeg produces a verified MP4 in R2
-> Creative Director displays the final artifact
From a brief to a durable production
Gemini 3.5 Flash is the Creative Director model. It reads the brief and operates through Google Agent Development Kit 2.0, or Google ADK. ADK exposes only the tools that fit the active production and authenticated owner.
The tools are structured. A tool call carries a stable command identity and request identity. Convex records the command before an expensive provider call begins.
This design prevents duplicate spend. A replay returns the existing receipt or artifact for the same input. It does not send another paid request by accident. A request with uncertain provider delivery stays visible as uncertain until the system can reconcile it.
The same durable model controls the video path. Every image attempt, video take, beat result, mix revision, editor snapshot, checkpoint, render, and artifact has a linked record. The interface reads that record instead of guessing progress from a timer.
Music, stems, and the real mixer
Lyria 3 Pro Preview on Vertex AI generates the canonical MP3 from the approved creative direction. UQHQ pins that master to the production. Later steps use that exact file as the final audio source.
The Vertex AI API calls use short-lived Google credentials. Workload Identity Federation exchanges Cloudflare identity through the Security Token Service. The IAM Service Account Credentials API then impersonates a least-privilege service account. No service-account JSON key lives in the application.
The system begins timing, visual planning, and stem work in parallel. MVSep BS Roformer SW is the production path for six stems: vocals, drums, bass, guitar, keys, and other. Fal also provides an independently tested Demucs stem fallback.
Google Speech-to-Text V2 with Chirp 3 is configured as a song qualification path. The production also has a deterministic beat fallback. If measured beat timing is unavailable, the system records the fallback provenance instead of calling it detected timing.
The mixer is real. Google ADK reads the authoritative Convex mix snapshot, proposes bounded typed actions, and sends them through the same project mutation interface as the human mixer. In the final clean canary, the ADK run committed Vocal Compressor and Parametric EQ as Mix Revision 1. It then auditioned Vocal for five seconds and restored the full mix.
Images, moving footage, and media validation
Gemini 3 Pro Image creates the key visual language. Gemini 3.1 Flash Image creates parallel scene images with reference context. The first five anchor images establish characters, locations, motifs, palette, and camera rules.
Fal MiniMax H3 Max turns eligible source images into short moving clips. H3 is the only video-generation route in this workflow. UQHQ limits known active Fal generations to ten and records a provider claim before each dispatch.
The system treats a returned MP4 as evidence, not as automatic success. The provider gateway imports it into Cloudflare R2 and records its object identity, byte length, checksum, container facts, and measured duration. It keeps signed provider and R2 URLs transient.
The Studio AI Worker then sends verified video bytes through the Gemini file path for a schema-constrained visual judgment. It deletes the temporary Gemini file after the work. A clip enters the edit only after it has a verified container receipt, an accepted judgment, no critical failure, and a valid trim window.
This separation matters. A file can have a valid MP4 container and still be unusable. The editor rejects clips with material faults such as generated text, severe anatomy errors, fake performance, static motion, or an invalid window.
A server-authored, beat-synchronized edit
UQHQ performs real editing on the server. It does not create a fake timeline in the browser.
The edit service freezes an immutable input snapshot when coverage resolves. The snapshot pins the master MP3, lyric timing, beat result, accepted clips, quality evidence, and allowed trim windows. Later clips cannot silently change that frozen edit.
The timeline builder uses lyric boundaries, downbeats, section rules, and stable tie-breaks. It selects approved windows, avoids immediate repeats, bounds revisits, and fills the full song without gaps. Generated clip audio is always muted. The pinned Lyria master is the only audio track in the render manifest.
Before rendering, the server verifies the clip receipts, timing bindings, scene clock, project bindings, and artifact identity. It then freezes an immutable checkpoint and one render manifest. Concurrent starts and replays return the existing render. They do not create a second task or render.
Rendering, storage, and the web application
Cloud Tasks delivers background work. Each private render request carries an OIDC service identity. Cloud Run accepts only the dedicated task service account.
The normal fast path is a private warm Cloud Run renderer. It runs with one warm minimum instance, 8 vCPU, 16 GiB of memory, concurrency one, and a 30-minute request limit. A Cloud Run Jobs v2 renderer and authenticated launcher remain as a cold-path fallback.
FFmpeg reads the frozen manifest. It maps the selected video windows without their source audio and maps the canonical master as the only audio. It produces H.264 video and AAC audio, then the system verifies the MP4 before it becomes a ready artifact.
Cloudflare Workers provide the private provider gateway and service boundary. Cloudflare R2 stores the media bytes after verification. The web application shows the server-projected artifact and asks for short-lived media access only when the creator plays or downloads it.
Google Cloud services in the production path
Google Cloud is the core platform. These are the verified roles from the project records:
| Service | Role in UQHQ |
|---|---|
| Gemini 3.5 Flash | Creative Director, structured image and clip assessment, and ADK mix planning. |
| Gemini 3 Pro Image and Gemini 3.1 Flash Image | Key art and reference-aware scene images. |
| Google ADK 2.0 | Scoped tools, typed mixer actions, transport actions, and visible tool events. |
| Lyria 3 Pro Preview on Vertex AI and Vertex AI API | Full-song master generation from the brief. |
| Cloud Run services | Audio intelligence, waveforms, mix work, authenticated rendering, and the warm final renderer. |
| Cloud Run Jobs v2 | Independently deployable fallback rendering. |
| Cloud Tasks with OIDC | Authenticated background delivery for timing, waveforms, mix work, and rendering. |
| Cloud Build and Artifact Registry | Reproducible container builds and SHA-256-pinned container images. |
| Secret Manager | A renderer signing secret that private compute reads at runtime. |
| IAM, Workload Identity Federation, Security Token Service, and IAM Service Account Credentials API | Keyless identity exchange, least-privilege impersonation, and private service invocation. |
| Cloud Logging and Audit Logs | Deployment, startup, request, execution, and callback evidence. |
| Speech-to-Text V2 with Chirp 3 | Configured speech qualification path for timing evidence. |
| Google sign-in | Authentication for the hosted studio. |
The production project also recorded API traffic for Gemini API, Cloud Build, Cloud Run Admin, Cloud Logging, Cloud Tasks, IAM, Secret Manager, Agent Platform, and Artifact Registry. The record confirms this production API activity. It does not assign a separate runtime role to each observed API request.
What the Goal 7 release proved
The Goal 7 release produced a verified final MP4 and displayed it in the authenticated Director page. One larger production recorded 16 verified scene images, 16 imported Fal MP4s, 15 accepted clips, a 40-scene gap-free edit, and one successful render with no retry.
The final clean canary then provided the clearest end-to-end result:
- Five of five Fal H3 Max clips were accepted and container-verified.
- Exactly one Cloud Task dispatched the final render. There were no dispatch failures.
- The final MP4 used H.264 at 1280×720, yuv420p, 30 fps, with one AAC stream.
- The final duration was 157.733 seconds. Faststart and muted generated clip audio were verified.
- The backend was ready at about 3m34s. The UI displayed the result at 3m47s.
- The ADK mixer committed two real actions and completed its handoff at about 4m41s.
The release also ran a non-spend replay. It returned the same run and ready render. The count of video attempts, renders, Cloud Tasks, and Cloud Run Job executions did not increase.
What did not work, and how we changed the design
The first audio plan used an L4 GPU on Cloud Run. Google Cloud rejected the live deployment before startup because the project had zero no-zonal-redundancy GPU quota. The team did not wait for quota during the hackathon.
MVSep and Fal became specialist accelerators. MVSep handled six-stem separation. Fal handled image-to-video generation and offered a tested Demucs fallback. Google Cloud remained the agent, identity, queue, container, rendering, and observability backbone.
The final system also retains honest limits. The first release supports one active song-to-video production. Browserless presentation is incomplete because some studio workspace presentation still needs the authenticated Director page open. The completed run required no user clicks after that page loaded.
Public hackathon disclosure
UQHQ was built for the Google Cloud All Things Agentic Hackathon, in The Taskmaster category. It uses Google Gemini, Lyria, Google ADK, and Google Cloud alongside Convex, Cloudflare Workers and R2, Fal, MVSep, and FFmpeg.
The system does not present third-party media as its own model output. It records provider attempts, validates returned files, and keeps the production record with the project. Temporary provider URLs, signed object URLs, credentials, and secret values are not public production data.
Conclusion
The useful part of UQHQ is not that it can describe a music video. It can own a bounded production from the brief through the final MP4.
The agent has real tools. The editor has real timing and immutable evidence. The renderer receives one verified checkpoint. That is what made the four-minute target meaningful, and what made the final result auditable.