Gradient Bang is an online multiplayer universe where you explore, trade, battle, and collaborate with other players and with LLMs. Everything in the game is an AI agent, including the ship you command.
The projects demonstrates the full capabilities of realtime agentic workflows, such as multi-tasking, advanced tool calling and low latency voice.
➡️ Join the play test
- uv: Python package manager
- Supabase Account: Game server functions, auth and database
- Docker: Required for local Supabase stack and agent deployment
- Node.js 18+: For edge function deployment and client
- (Optional) Pipecat Cloud Account: Production agent hosting
- (Optional) - Supabase CLI: If you cannot use
npx, install the CLI globally instead
Note
You can do this via the Supabase Dashboard if preferred
npx supabase login
npx supabase projects create gb-game-server \
--db-password some-secure-password \
--region us-west-1 \
--org-id my-org \
--size smallPush config from /deployment/supabase template:
npx supabase config push --workdir deploymentNote
Docker must be available and running on your system
This may take some time on first run as required images are downloaded.
npx supabase start --workdir deployment/ Grab the required API keys:
npx supabase status -o env \
--override-name auth.anon_key=SUPABASE_ANON_KEY \
--override-name auth.service_role_key=SUPABASE_SERVICE_KEY \
--workdir deploymentCopy the following into .env.supabase:
SUPABASE_URL=http://127.0.0.1:54321
SUPABASE_ANON_KEY=eyJhbG...
SUPABASE_SERVICE_ROLE_KEY=eyJhbG...
# Edge function configuration
EDGE_API_TOKEN=your-random-token-here # Generate: openssl rand -hex 32
EDGE_FUNCTIONS_URL=${SUPABASE_URL}/functions/v1set -a && source .env.supabase && set +a
USE_SUPABASE_TESTS=1 uv run pytest tests/integration/ -v --supabase-dir deploymentIf you run tests, be sure to clear database after
npx supabase db reset --workdir deploymentRun the universe bang script with number of sectors to chart and random seed
uv run universe-bang 5000 1234This will create a world-data folder in the root of your project
uv run -m gradientbang.scripts.load_universe_to_supabase --from-json world-data/Run Supabase edge functions process (leave running)
npx supabase functions serve --no-verify-jwt --workdir deployment --env-file .env.supabaseOption 1: Manually via Studio dashboard: http://127.0.0.1:54323/project/default/auth/users
Option 2: Via terminal:
curl -X POST http://127.0.0.1:54321/functions/v1/register \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "secret123"
}'Open Inbucket (local email viewer) and click confirmation link. Note: In local dev, the redirect URL will not be found.
open http://127.0.0.1:54324curl -X POST http://127.0.0.1:54321/functions/v1/login \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "secret123"
}'Grab the access_token for the next steps!
Create a character (replace YOUR_ACCESS_TOKEN with the token from step 3):
curl -X POST http://127.0.0.1:54321/functions/v1/user_character_create \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"name": "SpaceTrader"
}'Install Python dependencies:
uv sync --all-groupsRun agent process:
set -a && source .env.supabase && set +a
uv run botWith both your Supabase functions and Pipecat bot running, in a new terminal window:
cd client/
pnpm i
pnpm run devnpx supabase link --workdir deployment/Note: these can be obtained via npx supabase projects api-keys
SUPABASE_URL=...
SUPABASE_ANON_KEY=...
SUPABASE_SERVICE_ROLE_KEY=...
SUPABASE_DB_URL=...
EDGE_API_TOKEN=super-secret-prod-token
EDGE_FUNCTIONS_URL=...
EDGE_JWT_SECRET=super-secret-jwt-token-with-at-least-32-characters-longLoad env into terminal:
set -a && source .env.cloud && set +anpx supabase db push --workdir deployment/ --linkedAdd world data
uv run -m gradientbang.scripts.load_universe_to_supabase --from-json world-data/npx supabase functions deploy --workdir deployment/ --no-verify-jwtAdd required secrets
npx supabase secrets set --env-file .env.cloudNote: we will need to add BOT_START_START_URL and BOT_START_API_KEY later
Create .env.bot
DEEPGRAM_API_KEY=...
CARTESIA_API_KEY=...
GOOGLE_API_KEY=...
SUPABASE_URL=https://{SUPABASE_PROJECT_ID}.supabase.co
SUPABASE_SERVICE_ROLE_KEY=...
# Optional:
TOKEN_USAGE_LOG=logs/token_usage.csv
BOT_USE_KRISP=1Create a new secret set on Pipecat Cloud:
pipecat cloud secrets set gb-bot-secrets --file .env.botBuild and deploy bot
Note: create image pull credentials if publishing to a private repository
docker build -f deployment/Dockerfile.bot -t gb-bot:latest .
docker push gb-bot:latest
cd deployment/
pipecat cloud deploy
# ... or if public
# pipecat cloud deploy --no-credentialsCreate and note down Public API Key
pipecat cloud organizations keys createUpdate .env.cloud with additional bot envs:
SUPABASE_URL=...
SUPABASE_ANON_KEY=...
SUPABASE_SERVICE_ROLE_KEY=...
SUPABASE_DB_URL=...
EDGE_API_TOKEN=...
EDGE_FUNCTIONS_URL=...
EDGE_JWT_SECRET=...
# Add these
BOT_START_URL=https://api.pipecat.daily.co/v1/public/{AGENT_NAME}/start
BOT_START_API_KEY=...Apply to edge functions
npx supabase secrets set --env-file .env.cloudtouch client/app/.env
VITE_SERVER_URL=https://{SUPABASE_PROJECT_ID}.supabase.co/functions/v1
VITE_PIPECAT_TRANSPORT=dailyRun the client
cd client/
pnpm run dev