Built for AI Hackathon: Hack The Stack - June 5-6, 2024
Ambient decision capture for Discord voice meetings. Automatically records, transcribes, and extracts decisions from voice conversations with participant confirmation.
This project was developed during the 24-hour AI Hackathon: Hack The Stack hosted by Kayode Adegbite & Taryn Cunningham at GMI Cloud in Mountain View, California. Special thanks to the event sponsors:
- Langtrace.ai - Observability and evaluation platform (used in this project)
- GMICloud.ai - GPU cloud infrastructure for AI workloads (used in this project)
- KrosAI.com - AI voice and text agents
- Trae.ai - AI-powered developer environment
- BetaUniversity.org - Pre-accelerator for diverse founders
- Auto-join: Bot automatically joins voice channels when first human user joins
- Per-speaker recording: Records separate audio streams for each participant
- Transcription: Uses Whisper via ByteNite service for accurate speech-to-text
- Decision extraction: GMI Cloud API identifies potential decisions with regex fallback
- Participant confirmation: DM confirmation system with ❌ reaction to cancel decisions
- Publishing: Posts confirmed decisions to #decisions channel with cancellation notices
- Observability: Full OpenTelemetry tracing via Langtrace
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Discord Bot │ │ ByteNite │ │ GMI Cloud │
│ (TypeScript) │────│ Service │────│ Decision │
│ │ │ (Python/FastAPI)│ │ Extractor │
│ • VoiceManager │ │ • Whisper │ │ │
│ • Recorder │ │ • Job Queue │ │ │
│ • Confirmation │ │ • File Storage │ │ │
│ • Publisher │ │ │ │ │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│ │ │
└────────────────────────┼────────────────────────┘
│
┌─────────────────┐
│ Langtrace │
│ Observability │
└─────────────────┘
- Node.js 18+
- Python 3.11+
- Discord Bot Token with appropriate permissions
- GMI Cloud API key
- Langtrace API key
Create .env files based on the .env.example files in both bot/ and bytenite_service/ directories.
# Discord Configuration
DISCORD_BOT_TOKEN=your_bot_token_here
DISCORD_CLIENT_ID=your_client_id_here
DISCORD_GUILD_ID=your_guild_id_here
DECISIONS_CHANNEL_ID=your_decisions_channel_id_here
LOGS_CHANNEL_ID=your_logs_channel_id_here
# ByteNite Service
BYTENITE_SERVICE_URL=http://localhost:8000
# GMI Cloud Configuration
GMI_CLOUD_API_KEY=your_gmi_api_key_here
GMI_CLOUD_BASE_URL=https://api.gmi.cloud
# Langtrace Configuration
LANGTRACE_API_KEY=your_langtrace_api_key_here
LANGTRACE_ENDPOINT=https://cloud.langtrace.ai
# Environment
NODE_ENV=development# FastAPI Configuration
PORT=8000
HOST=0.0.0.0
# Whisper Configuration
WHISPER_MODEL=base
WHISPER_DEVICE=cpu
# File Storage
UPLOAD_DIR=/tmp/bytenite_uploads
MAX_FILE_SIZE_MB=100
# Environment
ENVIRONMENT=development- Install Bot Dependencies:
cd bot
npm install- Install ByteNite Service Dependencies:
cd bytenite_service
pip install poetry
poetry install- Start ByteNite Service:
cd bytenite_service
python start.py- Start Discord Bot:
cd bot
npm run dev- Create a Discord application at https://discord.com/developers/applications
- Create a bot user and copy the token
- Add bot to your server with permissions:
- Read Messages
- Send Messages
- Connect to Voice
- Speak in Voice
- Add Reactions
- Send Messages in DMs
- Automatic Operation: Bot joins voice channels automatically when users join
- Meeting Flow:
- Users join voice channel → Bot joins and starts recording
- Users leave channel → When empty, bot processes the meeting
- Transcription → Decision extraction → Participant confirmation → Publishing
- Manual Removal: Use
/decisionbot removeor kick bot to cancel recording
cd bot
npm test # Run all tests
npm run test:watch # Watch modecd bytenite_service
poetry run pytest # Run all tests
poetry run pytest --cov # With coverageHandles Discord voice channel events, manages recording sessions
Records per-speaker audio streams as WAV files
Interfaces with transcription service, handles retries and fallbacks
GMI Cloud integration with regex fallback for decision detection
DM system for participant confirmation with reaction handling
Posts decisions and cancellation notices to Discord channels
All operations are traced through Langtrace with custom attributes:
meeting_id: Unique meeting identifierguild_id: Discord server ID- Span names:
join,upload,gmi,dm,publish,cleanup
- Retry Logic: 3x exponential backoff for external services
- Fallbacks: Local regex if ByteNite/GMI fail
- Cleanup: Immediate audio file deletion after processing
- Logging: Comprehensive error logging to #decisionbot-logs channel
- Latency Target: ≤ 2 minutes from meeting end to decision post
- Concurrency: Parallel audio uploads and transcription
- Resource Management: Automatic cleanup of temporary files
- Scalability: Stateless design supports multiple concurrent meetings