A realtime Live Agent built with TypeScript, Gemini Live API, microphone streaming, camera-frame streaming, and interruption handling.
- Starts a Gemini Live session over WebSocket.
- Streams microphone audio in realtime (
audio/pcm). - Streams camera frames in realtime (
image/jpeg). - Shows live user transcription + live model transcript.
- Supports interruption (
activity.start/activity.end) and barge-in behavior. - Uses
@google/genaiLive API on the backend.
- frontend: React + Vite + TypeScript
- backend: Node.js + TypeScript +
ws - ai: Google GenAI SDK (
@google/genai) withai.live.connect - deploy target: Google Cloud Run
src/
client/
components/
hooks/
lib/
server/
lib/
live/
shared/
types/
docs/
architecture.md
- Node.js 20+
- pnpm 9+
- Gemini API key
Copy env template:
cp .env.example .envSet values:
GEMINI_API_KEY=your-key
GEMINI_LIVE_MODEL=gemini-2.5-flash-native-audio-preview-12-2025
PORT=8080
CORS_ORIGIN=http://localhost:5173
VITE_WS_BASE_URL=pnpm install
pnpm run dev- app:
http://localhost:5173 - health:
http://localhost:8080/api/health
Browser flow:
- Click start live session.
- Enable stream microphone audio.
- Enable stream camera frames.
- Speak naturally.
- Interrupt by speaking again or pressing interrupt now.
Use this section to verify the project from a clean checkout.
pnpm install
pnpm run typecheck
pnpm run buildPass criteria:
typecheckexits with code0buildexits with code0- server build output exists under
dist/server/ - client build output exists under
dist/client/
cp .env.example .env
# set GEMINI_API_KEY in .env
pnpm run devOpen http://localhost:5173 and run this checklist:
- Click start live session -> transcript shows
Session connected. - Enable stream microphone audio -> user speech appears in transcript.
- Enable stream camera frames + auto observe mode -> agent gives proactive visual feedback after brief user silence.
- Click analyze latest frame -> immediate vision response appears.
- Click interrupt now while agent is speaking -> interruption event appears and model output stops.
- Click stop session -> transcript shows
Session closed.
# replace with your Cloud Run URL
curl -s https://YOUR_CLOUD_RUN_URL/api/healthPass criteria:
- health endpoint returns JSON with
ok: true - same 6-step UI checklist above works on deployed URL
Notes for judges:
- If Gemini quota is exhausted, the app returns a clear
429quota message. - This repository currently focuses on integration/runtime validation (
typecheck,build, live smoke flow) instead of standalone unit tests.
pnpm run typecheck
pnpm run build
pnpm run startgcloud builds submit --config cloudbuild.yamlSet a Cloud Build trigger that runs cloudbuild.yaml on push to main.
Required one-time IAM for Cloud Build service account (PROJECT_NUMBER@cloudbuild.gserviceaccount.com):
roles/run.adminroles/artifactregistry.writerroles/iam.serviceAccountUser
docker build -f Dockerfile -t sightline-live .
docker run -p 8080:8080 --env-file .env sightline-live- Keep API keys server-side only.
- If the selected model is unavailable in your account, set
GEMINI_LIVE_MODELto a model available in your project.