AI tutor bot for Tech World - a multiplayer game where players learn programming together.
Clawd joins LiveKit rooms as a participant and responds to chat messages using Claude AI. It provides friendly, encouraging coding help to players.
-
Install dependencies:
npm install
-
Configure environment:
cp .env.example .env # Edit .env with your credentials -
Run locally:
npm run dev
| Variable | Description |
|---|---|
LIVEKIT_URL |
LiveKit server WebSocket URL |
LIVEKIT_API_KEY |
LiveKit API key |
LIVEKIT_API_SECRET |
LiveKit API secret |
ANTHROPIC_API_KEY |
Anthropic API key for Claude |
- Bot registers as a LiveKit Agent worker
- The Flutter client calls the
retrieveLiveKitTokenCloud Function, which embeds aRoomAgentDispatchin the token'sRoomConfiguration— this ensures the bot is dispatched whether the room is new or already exists - Bot joins the room as participant
bot-claude - Players send messages on the
chatdata channel topic - Bot calls Claude API and responds on
chat-responsetopic - All players in the room see the response
- For spell casting, the client sends on
oracle-request(targeted); the bot interprets the cast and replies onoracle-responseusing akinddiscriminator ('spell_cast','spell_combo', …)
- Runtime: Node.js 20+ in Docker, deployed on OCI (
149.118.69.221) - Framework: @livekit/agents — connects to self-hosted LiveKit at
wss://livekit.imagineering.cc - AI: Claude API via @anthropic-ai/sdk
- Language: TypeScript
Production deploys via the imagineering-infra repo:
cd ~/git/orgs/imagineering/imagineering-infra
./scripts/deploy-to.sh 149.118.69.221 tech-world-botsThis decrypts secrets, rsyncs source, builds the Docker image on the VPS, and restarts the tw-clawd / tw-gremlin containers. See CLAUDE.md for verification steps after a deploy.
| Script | Description |
|---|---|
npm run dev |
Run with hot reload (development) |
npm run build |
Compile TypeScript to JavaScript |
npm start |
Run compiled version (production) |
npm run lint |
Run ESLint |
npm run typecheck |
Type check without emitting |
- tech_world - Flutter client app
- tech_world_firebase_functions - Token generation
MIT