Three small apps run together to demo the AI room orchestration loop:
Agents(Flask) — decides light/music plans from vitals, can push updates to the room API.Room-Simulator(Express/Three.js) — renders the room UI + REST API, proxies vitals to the agents.FitBit-Simulator(Node static) — slider UI that streams vitals to the room API.
- Copy
.env.exampleto.envif you want to change ports/URLs. ./run_all.sh(needs Python 3.11+ and Node 18+). The script creates a Python venv, installs deps, and starts all three services:- Agents at
http://localhost:${AGENTS_PORT:-8080} - Room at
http://localhost:${ROOM_PORT:-8787} - FitBit UI at
http://localhost:${FITBIT_PORT:-3000}
- Agents at
cp .env.example .env # optional tweaks
MODE=compose ./run_all.sh
# or: docker compose up --buildThe compose file wires URLs automatically (room → agents; fitbit default targets http://localhost:8787).
FitBit ➜ POST /api/vitals on the room ➜ room normalizes & calls ORCHESTRATOR_URL ➜ agents return light/music plan ➜ room applies it. Agents can also push vitals/light/music back to the room via ROOM_API_BASE when ROOM_API_ENABLED=1.
Agents/— Flask API, orchestration logic (app.py,agents/,utils/).Room-Simulator/— Express API + Three.js UI (server.js,index.html).FitBit-Simulator/— Vitals slider UI (server.js,public/).run_all.sh— unified local runner (also supportsMODE=compose)..env.example— shared config surface; copy to.envto override.docker-compose.yml— containerized stack.- Vertex AI is optional;
run_all.shand.env.exampledefaultVERTEX_ENABLED=0to avoid GCP setup. Set yourGCP_PROJECT_ID,GCP_LOCATION, and credentials + flipVERTEX_ENABLED=1to use Gemini. - Agents no longer push light/music to the room by default (
ROOM_API_ENABLED=0); the room applies interventions itself when it calls the orchestrator. Turn it on only if you need agents to drive a remote room API directly.
- Ports:
AGENTS_PORT,ROOM_PORT,FITBIT_PORT - URLs:
ORCHESTRATOR_URL(room ➜ agents),ROOM_API_BASE(agents ➜ room),ROOM_BASE_URL(FitBit ➜ room) - Flags:
ORCHESTRATE_ON_VITALS(room auto-calls agents),ROOM_API_ENABLED(agents push to room),MANUAL_HOLD_MS(room manual override hold),DEFAULT_PATIENT_AGE_YEARS