Sentiment-driven chatbot with reactive pug video loops and neon cyberpunk user interface. Built for Cline agent workflows and VSCode, with validation gated assembly and AI-first documentation.
- Clone repo, open in VSCode.
- Ensure all 16 mp4 loops are in
mp4/folder, named by emotion (see architecture.md for guidelines). - Run
npm installto get dependencies (natural.js). - Set up Coqui XTTS v2 voice server (see Voice Setup below).
- Start local development:
npm run devor openindex.html. - Agent-driven assembly: follow steps in
.agent/assembly-guide.md, which are validation gated. Do not proceed until each gate is passed.
The chatbot uses Coqui XTTS v2 for high-quality, family-friendly male voice synthesis.
# Run the automated setup script
python setup_tts.pyThis will:
- ✅ Check Python version
- ✅ Install all dependencies
- ✅ Download the XTTS v2 model (~1.5GB)
- ✅ Verify everything works
# Install Python dependencies
pip install coqui-tts flask torch torchaudio
# Download XTTS v2 model (this may take a while)
python -c "from TTS.api import TTS; TTS('tts_models/multilingual/multi-dataset/xtts_v2')"# Start the TTS server
python tts_server.pyThe server will run on http://localhost:5000 and provide:
GET /health- Health checkGET /speakers- List available voicesPOST /tts- Generate speech
- Default Voice:
male_family_friendly(family-friendly male voice) - Language: English
- Features: Emotion-based modulation, cyberpunk flair, coding mode detection
- ✅ Web Speech API Fallback: Works immediately (Microsoft David male voice)
- 🔄 Coqui XTTS v2: Premium voice available after setup
- 🔄 Automatic Detection: System switches to premium voice when server is running
- If TTS server fails to start, check Python version and dependencies
- Voice automatically falls back to Web Speech API if server unavailable
- Check browser console for connection errors
- Pylance import warnings are normal until TTS is installed
The chatbot now features a dynamic multi-video emotion system that makes full use of all 16 pug videos:
Each emotion maps to multiple videos for variety:
- Happy:
happy_big_smile.mp4,looks_excited.mp4 - Curious:
cute_neutral_head_tilt.mp4,hold_up_confused.mp4 - Excited: 6 different videos for maximum expressiveness
- Neutral: 2 videos for varied idle states
Special responses for contextual keywords:
- "treat" →
happy_big_smile.mp4orlooks_excited.mp4 - "walk" →
i_have_an_idea.mp4orlooks_excited.mp4 - "food" →
boreed_eats_snack.mp4orlooks_excited.mp4 - "hello/goodbye" → Greeting-specific videos
Strong emotions trigger video sequences:
- Very Happy (intensity ≥4) →
wide_eyed_shocked.mp4→happy_big_smile.mp4 - Very Angry (intensity ≥4) →
agressive_typing_slightly_angry.mp4→angry_growling.mp4 - Surprised (intensity ≥4.5) →
wide_eyed_shocked.mp4→flower_sneeze.mp4
- No Repeats: Avoids playing the same video twice in a row
- Intensity Filtering: Matches video intensity to emotion strength
- State Tracking: Remembers recent videos and emotions
- Fallback System: Gracefully handles missing videos
- Sad Priority: "Sad" emotions always trigger head-down video (
sad_puts_head_down.mp4)
.agent/— AI-first docs, gates, guides, architecture.vscode/— Editor config for Cline/AI agentssrc/— Main HTML/CSS/JS assetsmp4/— 16 pug video loops with dynamic mappingsrc/config/emotion-map.json— Enhanced emotion-to-video mapping
- Use Cline agent to auto-assign mp4s to emotion categories by filename.
- Test sentiment analyzer using the test corpus found in
.agent/testing-protocol.md. - Human reviewers may override mappings in
config/emotion-map.jsonif agent is unsure.
- Every assembly step is validation gated (see
.agent/testing-protocol.md). - Do not proceed until agent validates outputs.