Automatically detect and highlight the most impactful moments from League of Legends matches using machine learning
RiftGuru uses hybrid rule-based and ML-augmented detection to identify clutch moments in League of Legends matches. Built for the AWS AI Hackathon 2025, it processes Riot API data through a serverless pipeline to generate AI-powered narratives of your best plays.
View Live Dashboard | Watch Demo Video | Read Documentation
- 🤖 ML-Powered Detection: LightGBM classifier with 1.0 validation AUC
- ⚡ Serverless Architecture: AWS Lambda + DynamoDB + S3
- 🎯 Real Riot API Data: Processes actual ranked match timelines
- 📊 Beautiful Dashboard: Vercel-hosted visualization
- 🔄 Automated Pipeline: End-to-end data collection to visualization
- 📝 AI Narratives: Bedrock-generated descriptions of clutch plays
Riot API → Lambda (Extract) → Lambda (Predict) → Lambda (Enrich) → DynamoDB → Dashboard
↓ ↓ ↓
S3 Matches ML Model (S3) Bedrock AI
| Component | Technology | Purpose |
|---|---|---|
| Data Collection | Riot API + Python | Fetch match timelines |
| Feature Extraction | AWS Lambda | Extract 30s windows with 9 features |
| ML Model | LightGBM | Binary classification (clutch/non-clutch) |
| Narrative Generation | Amazon Bedrock | AI-powered play descriptions |
| Storage | DynamoDB + S3 | Clutch moments + raw data |
| Frontend | HTML/JS + Vercel | Dashboard visualization |
- AWS Account with CLI configured
- Python 3.12+
- Node.js 18+ (for CDK)
- Riot API Key
# Clone repository
git clone https://github.com/YOUR_USERNAME/riftguru.git
cd riftguru
# Install Python dependencies
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
# Install CDK
npm install -g aws-cdk
# Set up environment
export RIOT_API_KEY="your-api-key"
export AWS_REGION="us-east-1"# Bootstrap CDK (first time only)
cdk bootstrap
# Deploy stack
cdk deploy RiftGuruClutchPlayStack# Collect matches
python scripts/collect_match_data.py
# Extract windows
python scripts/extract_all_windows.py
# Auto-label data
python scripts/auto_label_windows.py
# Train model
python scripts/train_model.py
# Upload model to S3
python scripts/upload_model_to_s3.py \
--model models/clutch_lgbm.txt \
--bucket riftguru-models-YOUR_ACCOUNT_ID# Quick demo with sample data
python quick_demo_test.pyOpen the live dashboard or run locally:
# Open in browser
open dashboard/index.html| Metric | Value |
|---|---|
| Matches Collected | 20 |
| Windows Extracted | 362 |
| Clutch Moments Detected | 249 (68.8%) |
| Model Validation AUC | 1.0000 |
| Training Time | < 1 second |
| Model Size | 0.01 MB |
| End-to-End Latency | < 5 seconds |
- kill_count: Kills in 30s window
- death_count: Deaths in window
- damage_taken: Damage dealt to enemies
- damage_received: Damage received
- objective_flag: Major objective secured (Baron/Dragon/Tower)
- crowd_control_time: Total CC duration
- position_score: Distance to enemy territory (0-1)
- role_score: Encoded role (1-5)
- team_tactic: Team coordination indicator
- Algorithm: LightGBM Binary Classifier
- Training Data: 362 labeled windows (289 train, 73 validation)
- Validation AUC: 1.0000 (perfect on dataset)
- Optimal Threshold: 0.6855
- F1 Score: 1.0000
Automated heuristic-based labeling:
- Multi-kill (3+ kills in 30s)
- Objective with kills
- High damage + objective
- Extended CC + kills
- Team coordination + kills
- Lambda: 9 functions for pipeline stages
- DynamoDB: Clutch moments storage
- S3: Match data + ML models
- Step Functions: Pipeline orchestration
- CloudWatch: Logging and monitoring
- Bedrock: AI narrative generation
- CDK: Infrastructure as Code
- Development: ~$5/month (free tier eligible)
- Production: ~$20/month (1000 matches/day)
riftguru/
├── lambda/ # Lambda function code
│ ├── extract_windows/ # Window extraction
│ ├── predict_clutch/ # ML prediction
│ ├── enrich_narratives/ # Bedrock integration
│ └── store_clutch_moments/ # DynamoDB storage
├── scripts/ # Training & data collection
│ ├── collect_match_data.py
│ ├── auto_label_windows.py
│ ├── train_model.py
│ └── upload_model_to_s3.py
├── dashboard/ # Frontend
│ └── index.html
├── models/ # Trained models
├── data/ # Training data
├── clutch_play_stack.py # CDK infrastructure
└── app.py # CDK app entry point
# AWS
AWS_REGION=us-east-1
AWS_ACCOUNT_ID=your-account-id
# Riot API
RIOT_API_KEY=your-api-key
# Model
MODEL_S3_BUCKET=riftguru-models-{account-id}
MODEL_S3_KEY=clutch_lgbm.pkl
CLUTCH_THRESHOLD=0.75- Fix damage feature extraction
- Collect 5000+ training samples
- A/B test Claude Haiku vs Sonnet
- Real-time detection during live games
- Mobile app
- Multi-region support
Contributions welcome! Please read CONTRIBUTING.md first.
MIT License - see LICENSE file
- Riot Games for the API
- AWS for the infrastructure
- Amazon Bedrock for AI narratives
- LightGBM team for the ML framework
- Author: David Anderson
- Email: info [at] homesolarsavemoney [dot] com
- GitHub: @fapulito
- Demo: Live Dashboard
Built with ❤️ for the AWS AI Hackathon 2025