David HsiaoCase study / 02
Realtime experiment / web systems
Live experiment

Agents Rap Battle: Realtime AI Performance Experiment

A live React and Vite experiment where two persona-driven performers share context, stream verses, and react to a beat-aware browser experience.

Agents Rap Battle realtime AI performance interface
Two performers / one shared room
RoleConcept + full-stack build
ClientReact · Vite · Web Audio
RuntimeWorker · Durable Object · WebSocket
ModelGemini
01

Performers, not autonomous tool agents.

The word agents can suggest a tool-using system, but that is not the claim here. These are persona-driven performers: two generated voices with defined roles that share a conversation context and take turns inside a designed performance loop.

  • The experience is about coordination and character.
  • There are no scale or autonomy claims attached to the demo.
  • The product surface makes the performance legible as a shared room.
02

One room, shared context.

A Cloudflare Worker handles the edge entry point while a Durable Object gives each session a place to coordinate state. WebSockets keep the browser connected to the room so the next turn can be streamed instead of waiting for a full page refresh.

  • Durable Object state gives a session a clear owner.
  • WebSocket messages keep turn-taking visible.
  • The system makes the handoff between performers part of the interaction.
03

Gemini meets Web Audio.

Gemini supplies the generated verses, while the browser handles the timing and sound layer. The beat-aware loop is intentionally theatrical: the point is to make model output feel situated in a live interaction rather than dropped into a static transcript.

  • Streaming verses create a sense of momentum.
  • Audio feedback gives the browser experience a physical cue.
  • The interface keeps the audience oriented while the next turn is forming.
04

Can coordination feel like a show?

The experiment tests a narrow question: whether shared context, turn-taking, and a little stage direction can make AI output feel more like an event. It is a focused prototype, not evidence of production scale or a general agent platform.