AI agent swarm for film pre-production. One sentence in, complete production package out.
Type a film concept. A Director agent reads it, spawns the right team of specialized AI agents, and orchestrates a 10-step pipeline — with real-time Roundtable deliberations where agents debate creative direction. The result: character portraits, location art, mood boards, a shooting script, shot list, storyboard frames, and a video production plan.
Live demo: filmswarm.web.app
How it works
- Enter a concept: "A noir heist in a floating city where memories are sold"
- The Director spawns specialized agents based on story complexity
- Agents work through 10 pipeline steps, holding Roundtable deliberations between each
- Character portraits from early steps are automatically injected as reference images into all downstream image generation — ensuring visual consistency
- Everything streams to the UI in real-time via SSE
Pipeline
| Step | Agent(s) | Output |
|---|---|---|
| 1 | ConceptAnalyst | Creative brief (genre, tone, themes, visual style) |
| 2 | StoryArchitect | 3-act structure, character arcs, locations |
| 3 | ScriptWriter | Full shooting script with scene breakdowns |
| 4 | CastingDirector | Character profiles + AI portrait art per character |
| 5 | WorldBuilder x N + MoodCurator | Location concept art + color palette + mood boards |
| 6 | Cinematographer | Shot list + storyboard reference frames |
| 7 | StoryboardArtist | Key frame illustrations |
| 8 | LookbookCompiler | Compiled visual lookbook |
| 9 | ProductionCompiler + QualityReviewer | Final package + QA pass |
| 10 | VideoDirector | Video production plan with Veo 3.1 shot briefs |
Agents scale dynamically — 5 characters = 5 portrait generations. 4 locations = 4 WorldBuilder agents running in parallel.
Each step is followed by a Roundtable where 2-3 agents debate the output before proceeding.
Tech Stack
| Layer | Technology |
|---|---|
| Agent orchestration | @google/adk (TypeScript) |
| LLM reasoning | gemini-3.1-pro-preview |
| Image generation | gemini-3.1-flash-image-preview |
| Video generation | veo-3.1-generate-preview |
| Backend | Express + TypeScript |
| Frontend | React + Vite + Tailwind CSS + Zustand |
| Real-time | Server-Sent Events (SSE) with reconnect + replay |
| Storage | Google Cloud Storage (images), Firestore (state + events) |
| Audio | Web Audio API (16 SFX + generative theme music, zero audio files) |
| Deploy | Cloud Run + Firebase Hosting + Cloud Build |
Run Locally
Prerequisites
- Node.js 20+
- A free Gemini API key
- A Google Cloud project with Cloud Storage enabled (for image uploads)
Setup
git clone https://github.com/AiMakers-co/filmswarm.git
cd filmswarm
# Server
cd server
cp .env.example .env
# Edit .env — add your GOOGLE_API_KEY and GCP project details
npm install
npm run dev # localhost:3001
# Client (new terminal)
cd client
npm install
npm run dev # localhost:5173
Open localhost:5173, enter your Gemini API key, pick a concept, and launch.
Environment Variables
See server/.env.example for all required variables.
Deploy
Cloud Run + Firebase Hosting (production)
# Full deploy: builds Docker image, pushes to Artifact Registry, deploys to Cloud Run
gcloud builds submit --project YOUR_PROJECT_ID --substitutions=COMMIT_SHA=$(date +%s)
# Client-only deploy (after UI changes)
cd client && npm run build && firebase deploy --only hosting --project YOUR_PROJECT_ID
The cloudbuild.yaml automates: Docker build, Artifact Registry push, Cloud Run deploy with Secret Manager integration.
Docker (standalone)
docker build --platform=linux/amd64 -t filmswarm .
docker run -p 8080:8080 \
-e GOOGLE_API_KEY=your-key \
-e GOOGLE_GENAI_API_KEY=your-key \
-e NODE_ENV=production \
filmswarm
Architecture
User Browser (React + Vite + Tailwind)
|
| SSE (real-time events) + REST API
v
Express Server (Cloud Run, 900s timeout)
|
|-- Google ADK Agent Pipeline
| |
| |-- Step 1-10: LlmAgent subclasses (gemini-3.1-pro-preview)
| |-- Roundtable deliberations between steps
| |-- generate_image tool (gemini-3.1-flash-image-preview)
| |-- generate_video tool (veo-3.1-generate-preview)
| |-- Reference image injection (auto base64 from GCS)
|
|-- Firestore (project state + event persistence)
|-- Google Cloud Storage (generated images + videos)
|-- Secret Manager (API keys)
Project Structure
filmswarm/
├── server/src/
│ ├── agents/ # Director + 12 specialized agents + Roundtable
│ ├── tools/ # generate-image, generate-video, store-artifact
│ ├── pipeline/ # event-bus, checkpoint, runner, save-gallery
│ ├── routes/ # project, stream (SSE), interact, gallery
│ └── config/ # firebase, gemini, env
├── client/src/
│ ├── components/ # ConceptInput, StepCard, RoundtableView, Gallery,
│ │ # SwarmMonitor, PixelRobot, StatsHUD, PhaseIndicator
│ ├── hooks/ # useSSE
│ ├── lib/ # sfx.ts (Web Audio engine + theme music)
│ └── stores/ # Zustand state management
├── Dockerfile
├── cloudbuild.yaml
└── firebase.json
SSE Events
The server streams 23+ event types. Connect to GET /api/stream/:projectId:
| Event | Key Fields |
|---|---|
agent_spawned |
agent, parent, role |
agent_thinking |
agent, text |
agent_completed |
agent, duration |
roundtable_started |
topic, agents[] |
roundtable_message |
agent, message, round |
roundtable_concluded |
decision |
image_generated |
agent, url, description |
video_generated |
clipIndex, url, quality |
step_started / step_completed |
step, name |
pipeline_completed |
projectId |
Full event replay on reconnect — no state loss.
License
MIT
Built by AI Makers