Inspiration - Can I get a project finished. Too many started projects nothing completed. So get my head down and do it.

The AI Revolution (That Everyone's Talking About)

AWS Bedrock just dropped function calling

Everyone's building chatbots that can't do anything

"What if AI could actually QUERY your match data?"

Not just generic advice, but personalized insights based on YOUR games

The Vision: An AI coach that's smarter than your teammates (low bar, but still)

What it does - "Your Personal League of Legends Therapist (That Actually Uses Data)"

Ever wondered why you're hardstuck? This app is basically a brutally honest AI coach that:

🔮 Reads Your Rift Diary - Analyzes your League matches like a detective investigating a crime scene (spoiler: you're both the detective AND the crime)

🧠 Roasts You With Science - Uses AWS Bedrock AI to tell you exactly why you're dying too much, but in a nice way (mostly)

📊 Shows You Pretty Charts - Because nothing says "I have a problem" like seeing your death count visualized in 4K

💬 Answers Your Existential Questions - Ask things like "Why can't I climb?" and get actual data-driven answers instead of "git gud"

🎯 Predicts Your Future - Tells you which champions you should play (and which ones you should never touch again in ranked)

🏆 Celebrates Your Wins - Finds those 3 games where you actually popped off and makes you feel like Faker

⚠️ Detects Your Tilt - Knows when you're about to go on a 10-game losing streak before you do

Basically, it's like having a challenger-level coach who's also a data scientist, a psychologist, and that one friend who tells you the truth even when it hurts. Except this one runs on AWS and won't judge you for playing Yasuo with a 30% win rate.

TL;DR: It turns your League trauma into actionable insights, one death at a time. 💀📈

How I built it - "How I Built a League Coach That's Smarter Than Your Teammates"

🎮 Step 1: Beg Riot for Data

Hit up the Riot Games API like it owes us money

Downloaded every embarrassing death, every missed CS, every "?" ping you've ever received

Stored it all in a SQLite database (because we're fancy but not that fancy)

🤖 Step 2: Summon the AI Overlords

Plugged into AWS Bedrock (Claude 3 Sonnet) - basically ChatGPT's cooler cousin

Taught it to understand League stats instead of writing poetry

Added "function calling" so it can actually query your match database like a proper detective

🛡️ Step 3: Build Security Guardrails (So It Can't Delete Your Account)

Created a read-only query engine (no write, no delete, no "accidentally" dropping your match history)

Added SQL injection protection (because we've seen what happens when you trust user input)

Made sure the AI can only look at YOUR data, not your teammate's embarrassing 0/10 Yasuo game

🧠 Step 4: Add 47 Different Analyzers (Because Why Not?)

Behavioral Analyzer (detects tilt before you rage quit)

Pattern Analyzer (finds out you only win on Tuesdays)

Performance Predictor (tells you your ceiling is Gold 2, sorry)

Competitive Analyzer (compares you to actual good players)

And like 10 more because we got carried away...

💾 Step 5: Cache Everything

Redis for speed (when it's running)

SQLite for persistence (when Redis isn't)

Your browser's memory for the current session (when both fail)

🎨 Step 6: Make It Look Pretty

Flask web app with that sweet League of Legends gold aesthetic

Chart.js for graphs that make your KDA look less depressing

Responsive design so you can check your stats on mobile while in queue

🚀 Step 7: Deploy to AWS (The Hard Part)

Elastic Beanstalk for "easy" deployment (narrator: it wasn't easy)

Fought with nginx timeouts for 3 hours

Removed a rogue sudo command that was breaking everything

Added IAM roles so we don't leak AWS credentials like a Bronze player leaks LP

🔧 Step 8: Add Quality of Life Features

Three-tier query system: Free local queries → Bedrock with tools → Full AI analysis

Let users choose how many matches to analyze (10 to "all of them, I have time")

Built an AI chat interface so you can ask "why am I bad?" and get a real answer

Tech Stack (For the Nerds):

Python + Flask (because we're not masochists)

AWS Bedrock (Claude 3 Sonnet with function calling)

Riot Games API (the real MVP)

SQLite (surprisingly handles 64MB of your shame just fine)

Chart.js (makes your 2.0 KDA look almost respectable)

A lot of coffee and "why isn't this working?" moments

Challenges we ran into - "Challenges We Ran Into (AKA: Why We Now Understand Tilt)"

🔥 The Great Nginx Rebellion of 2024

Elastic Beanstalk deployment kept failing with cryptic errors

Turns out we had a sudo service nginx reload command in our config

Problem 1: You don't need sudo when you're already root (rookie mistake)

Problem 2: Amazon Linux 2023 uses systemctl, not service (we're old)

Solution: Delete the whole thing and let EB reload nginx automatically

Lesson learned: Sometimes the best code is no code

🤖 Claude Couldn't Find the Database (The "Where's My Data?" Saga)

Built this fancy AI function calling system

Claude kept saying "I cannot execute tool queries in this environment"

Spent 2 hours debugging... turns out we had a typo: with self.db.db_path as conn:

You can't use a STRING as a context manager, past-us. That's not how Python works.

Fixed it, Claude immediately started querying like a pro

Lesson learned: Read your own code before blaming the AI

🎯 The Missing Tool Mystery

User asks "which champions should I focus on?"

AI responds with "Hmm, I can't actually execute that..."

Turns out we defined 4 functions but only told Claude about 3 of them

compare_champions was just... sitting there... unused... lonely

Added it to the tools list, problem solved

Lesson learned: If you build it, you must also TELL the AI it exists

📊 The "[Data not provided]" Incident

User asks "what was my best game?"

AI responds with all the stats... except the actual stats

Timeline data only had KDA, not kills/deaths/assists/CS/gold

Built a whole new get_best_match tool with full details

Lesson learned: Summary data is great until someone asks for details

🧠 The Local Query Generator Was Too Eager

Built a "free tier" local query system to save Bedrock costs

It started intercepting EVERYTHING, even complex questions

User: "What are my biggest weaknesses and how can I improve?"

App: "Your stats look solid! Keep playing!" (completely useless)

Had to teach it to recognize when to shut up and let the AI handle it

Lesson learned: Sometimes you need the expensive AI, not the regex

⏱️ The Timeout Tango

Tried to fetch 100 matches on Elastic Beanstalk

Request timeout after 60 seconds

Increased to 300 seconds in like 4 different config files

Still timing out

Reduced to 20 matches as default

Added user choice for match count (democracy wins!)

Lesson learned: Riot API is slow, users are impatient, compromise is key

🔐 The PUUID Validation Plot Twist

Built security guardrails to prevent SQL injection

Forgot to validate that the PUUID actually belongs to the player

Claude could theoretically query anyone's data

Added PUUID enforcement: "This is YOUR data, Claude. Only yours."

Lesson learned: Security is like warding - you think you did it, but you probably missed a spot

💾 The POC Mode That Wouldn't Die

Started with "POC mode" loading matches from local database

Worked great for testing!

Forgot to remove it before showing the app

User: "Why do I only have 11 matches?"

Us: "Oh... right... we're not actually calling the API..."

Lesson learned: Remove your debug code before demo day

🎨 The 47 Analyzers Problem

Started with basic stats

Added behavioral analysis (cool!)

Added pattern analysis (neat!)

Added performance prediction (awesome!)

Added 8 more analyzers because we couldn't stop

Now the app takes 30 seconds to load

Lesson learned: Feature creep is real, and we have a problem

🚀 The "All Matches" Feature Request

User: "Can I analyze ALL my matches?"

Us: "Sure! We have get_full_match_history already!"

10 minutes later

User: "It's still loading..."

Us: "Yeah... Riot API rate limits are... a thing"

Added a warning: "May take 10-30 minutes"

Lesson learned: "All" is a dangerous word in software

The Meta-Challenge: Explaining to Non-Gamers

"So it's like... a coach?"

"For a video game?"

"That uses AI?"

"To tell you you're dying too much?"

"And you built this... for fun?"

Yes. Yes to all of that.

TL;DR: We fought with nginx, debugged AI hallucinations, added too many features, forgot to remove test code, and learned that with string as conn: is not valid Python. But hey, it works now! 🎉

P.S. - The real challenge was resisting the urge to add a 48th analyzer. We're still thinking about it.

Accomplishments that we're proud of - "Accomplishments We're Proud Of (AKA: Things That Actually Work)"

🎓 We Made AI Actually Useful (Not Just Fancy)

Built a three-tier query system that's actually smart about costs

Simple questions? Free local queries (0 cents)

Complex analysis? Bedrock with function calling ($0.003)

General advice? Cached summaries (basically free)

It's like having a coach that knows when to use the expensive plays

Translation: We're not just throwing AI at problems, we're being strategic about it

🛡️ Security That Would Make Your Support Main Proud

Read-only database access (Claude can't accidentally DELETE * FROM matches)

SQL injection prevention (Bobby Tables has no power here)

PUUID validation (Claude can only see YOUR embarrassing games)

Function whitelist (only approved tools, no shenanigans)

Translation: We built Fort Knox for your League stats

🧠 Claude Can Actually Query Databases Now

Implemented AWS Bedrock function calling (the new hotness)

AI can ask questions like "show me games where I played Yasuo and fed"

Gets real data back and analyzes it intelligently

It's like giving your coach access to the replay files

Translation: The AI isn't just guessing, it's actually looking at your data

📊 47 Different Ways to Tell You You're Hardstuck

Behavioral analysis (detects tilt patterns)

Pattern recognition (finds your secret win conditions)

Performance prediction (calculates your actual ceiling)

Competitive readiness (tells you if you're ranked-ready)

Clutch performance metrics (are you the comeback king?)

Time-based patterns (turns out you play better at 2 PM)

Champion mastery roadmap (your personal tier list)

Translation: We analyzed EVERYTHING. Your playstyle has no secrets.

💬 An AI That Actually Answers Your Questions

"What champion should I play?" → Gets your actual win rates and recommends

"What are my weaknesses?" → Analyzes deaths, CS, vision, mental game

"What was my best game?" → Finds it and shows you every stat

"How do I improve?" → Gives specific, actionable advice

Translation: It's like having a challenger coach in your pocket (that works 24/7)

🎨 Made It Look Like It Belongs in League

That sweet gold and blue League aesthetic

Charts that actually make sense

Responsive design (works on your phone while you're in queue)

Smooth animations and loading states

Translation: It doesn't look like a CS homework project

⚡ Blazing Fast (When It Wants To Be)

SQLite caching (your matches load instantly after first fetch)

Redis support (for the speed demons)

Smart pagination (only fetch what you need)

Database query optimization (no full table scans here)

Translation: We respect your time (and Riot's rate limits)

🚀 Actually Deployed to Production

Works on Elastic Beanstalk (after the nginx incident)

Can handle EC2 deployment too (we're flexible)

Environment variables for secrets (no hardcoded API keys)

IAM roles for security (proper AWS citizenship)

Health checks and monitoring (we know when it breaks)

Translation: It's not just localhost:5000 anymore, mom!

🎯 User Choice That Actually Matters

Pick 10, 20, 50, 100, or ALL matches

Choose your own adventure (speed vs depth)

Real-time progress updates

Graceful error handling when things go wrong

Translation: We treat users like adults who can make decisions

🔮 Predictive Features That Feel Like Magic

Predicts your rank based on stats

Forecasts improvement potential

Detects emerging weaknesses before they tank your LP

Recommends training regimens

Calculates your performance ceiling

Translation: We built a crystal ball, but with math

📈 Data Visualization That Doesn't Suck

KDA trend lines (see your improvement over time)

Champion win rate pie charts (visual proof you should stop playing Yasuo)

Vision score radar charts (because everyone needs more wards)

Color-coded by win/loss (green = good, red = we don't talk about that game)

Translation: Pretty graphs that actually tell you something useful

🎮 Handles Edge Cases Like a Pro

Works with any region (Americas, Europe, Asia)

Handles players with 5 games or 5000 games

Graceful degradation when APIs fail

Fallback insights when Bedrock is down

Translation: We thought about the weird stuff

🏆 The Crown Jewel: It Actually Helps People Improve

Not just stats, but actionable advice

Specific training recommendations

Champion pool optimization

Mental game analysis

Time-based performance insights

Translation: This isn't just a stats page, it's an actual coach

The Secret Sauce: We didn't just build a stats tracker. We built a system that:

Understands context (not just numbers)

Gives personalized advice (not generic tips)

Respects your wallet (smart cost optimization)

Protects your data (security first)

Looks good doing it (aesthetics matter)

TL;DR: We built an AI coach that's smarter than your teammates, cheaper than a real coach, and won't flame you in all-chat. It uses cutting-edge AWS tech, respects your privacy, and actually helps you improve. Plus it has 47 different analyzers because we have no self-control. 🏆🤖

P.S. - The fact that it survived Elastic Beanstalk deployment is an accomplishment in itself.

What we learned - "What We Learned (AKA: Lessons From the Rift)"

🤖 AI Function Calling is Black Magic (But the Good Kind)

Claude can actually query databases if you tell it how

Function calling isn't just a gimmick - it's genuinely powerful

The AI is only as smart as the tools you give it

Debugging AI is like debugging a teammate who won't use voice chat

Lesson: Give AI the right tools, and it becomes actually useful instead of just confidently wrong

🔧 The Best Code is Sometimes No Code

Spent hours trying to make nginx reload work

Solution: Delete the reload command entirely

Elastic Beanstalk does it automatically anyway

We were literally fighting the framework trying to help us

Lesson: Read the docs before you start hacking. Also, trust the framework (sometimes).

💸 Cost Optimization Matters (Even at Small Scale)

Bedrock costs add up fast if you're not careful

Local pattern matching for simple queries = $0

Function calling for complex analysis = pennies

Caching everything = your wallet's best friend

Lesson: Build a three-tier system: free → cheap → expensive. Users will thank you.

🛡️ Security is Like Warding - You Always Miss a Spot

Built SQL injection prevention ✅

Built function whitelist ✅

Forgot PUUID validation ❌

Almost let Claude query anyone's data

Lesson: Security is layers. Like an onion. Or a really paranoid support player's ward coverage.

📊 Users Want Different Things (And That's Okay)

Some want quick 10-match analysis

Some want deep 100-match dives

Some want ALL THE DATA (even if it takes 30 minutes)

One size does NOT fit all

Lesson: Give users choices. Democracy in software works.

🎯 Feature Creep is Real (And We Have a Problem)

Started with basic stats

Ended with 47 different analyzers

Each one seemed like a good idea at the time

Now the app takes 30 seconds to load

But honestly? Users love it.

Lesson: Sometimes feature creep is actually feature richness. Know the difference.

🔍 Context Managers Don't Work on Strings (Who Knew?)

with self.db.db_path as conn: # ❌ This is a string, dummy

Copy python Spent 2 hours debugging why Claude couldn't query the database

Turns out you can't use a file path as a context manager

Python was trying to tell us, we just weren't listening

Lesson: Read your error messages. Also, basic Python syntax matters.

⏱️ Rate Limits Are Your Frenemy

Riot API: "You can make 20 requests per second!"

Also Riot API: "But actually, slow down or we'll ban you"

Had to add sleeps, batching, and pagination

Fetching 100 matches takes FOREVER

Lesson: Respect the API, or the API will disrespect you back.

🎨 Good UX is Worth the Extra Effort

Loading states matter (users need to know it's working)

Error messages should be helpful, not cryptic

Pretty charts make data digestible

That League gold aesthetic? Users notice and appreciate it

Lesson: Polish matters. A lot.

🧪 POC Code Has a Way of Becoming Production Code

"Let's just load from the database for testing"

3 weeks later

"Why are we still loading from the database?"

POC mode became production mode became a bug

Lesson: Delete your test code before it becomes permanent. We're serious.

📚 Documentation is for Future You

"I'll remember what this does"

Narrator: They did not remember

Added comments explaining the three-tier query system

Future us said thank you

Lesson: Comment your code like you're explaining it to a Bronze player. Be specific.

🎮 Domain Knowledge Matters

Understanding League mechanics helped us build better analyzers

Knowing what "good" CS/min looks like by rank

Understanding tilt patterns from personal experience (ouch)

Vision score expectations by role

Lesson: Build things you understand. Or at least things you play.

🔄 Iteration Beats Perfection

V1: Basic stats

V2: Added AI insights

V3: Added function calling

V4: Added 47 analyzers (we got carried away)

Each version was "done" but we kept improving

Lesson: Ship it, then make it better. Perfection is the enemy of done.

🤝 AI is a Tool, Not a Replacement

Local queries for simple stuff (fast, free)

AI for complex analysis (smart, costs money)

Human-designed analyzers for specific insights

Best results come from combining all three

Lesson: AI augments, doesn't replace. Use it strategically.

🏗️ Infrastructure is Harder Than Code

Writing the Python? Easy.

Getting it to run on Elastic Beanstalk? Pain.

Nginx configs? Suffering.

IAM roles? Why are there so many permissions?

Lesson: DevOps is a whole different skill tree. Respect it.

💾 Caching is Your Best Friend

SQLite for persistence

Redis for speed (when it works)

In-memory for the current session

Cache invalidation is still hard though

Lesson: Cache everything. Except when you shouldn't. You'll figure it out.

🎯 Specific is Better Than Generic

"Improve your gameplay" = useless

"Your CS/min is 5.2, aim for 6.5+ by practicing last-hitting in practice tool for 10 minutes daily" = helpful

Users want actionable advice, not platitudes

Lesson: Data-driven specificity beats generic wisdom every time.

🧠 The Real Learning: Building is the Best Teacher

Read about function calling? Meh.

Actually implement it? NOW we get it.

Debugging teaches you more than tutorials

Breaking things is how you learn what not to do

Lesson: Just build stuff. You'll figure it out. (And break things. That's fine.)

The Meta-Lesson: Building this taught us that:

AI is powerful but needs guardrails

Users want choices, not dictation

Security is never "done"

Good UX takes time but pays off

Feature creep is real but sometimes good

Infrastructure is harder than it looks

Caching solves 90% of performance problems

The other 10% is rate limits

TL;DR: We learned that AI function calling is magic, nginx is evil, users want options, security is layers, and with string as conn: is not valid Python. Also, we learned we have no self-control when it comes to adding features. But most importantly, we learned that building something people actually use is way more satisfying than we expected. 🎓🚀

P.S. - We also learned that explaining your project to non-gamers is harder than the actual coding.

What's next for leaf of the ledgend - "What's Next for Leaf of the Ledgend (Yes, We Kept the Typo)"

🎮 The "Actually Useful in Real-Time" Update

Live game analysis (connect during champ select)

"Your teammate just hovered Yasuo with 30% WR" alerts

Real-time coaching during games (via overlay?)

Post-game instant analysis (while you're still tilted)

Why: Because waiting until tomorrow to know you fed is so 2024

🤖 The "AI Gets Even Smarter" Update

Multi-game pattern recognition (detects your tilt spirals)

Predictive dodge recommendations ("Don't queue right now, trust us")

Meta-shift adaptation alerts ("Your main got nerfed, here's your backup")

Personalized build recommendations based on YOUR playstyle

Why: If we're going to use AI, let's make it REALLY smart

👥 The "Social Features Nobody Asked For (But Everyone Wants)" Update

Compare stats with friends (competitive roasting)

Team analysis (find out who's ACTUALLY dragging you down)

Duo compatibility scores (should you really duo with them?)

Anonymous rank predictions (guess your friend's real rank)

Why: Because flaming your friends with data is peak League culture

📱 The "Mobile App Because We Hate Ourselves" Update

Native iOS/Android apps

Push notifications for tilt detection

Quick stats lookup between games

Voice-activated coaching ("Hey Coach, why am I hardstuck?")

Why: So you can check your stats while pretending to pay attention in meetings

🎯 The "Actually Make Money" Update

Premium tier with unlimited AI questions

Advanced analytics (the 48th analyzer we've been holding back)

Custom training plans ($5/month)

Ad-free experience (we'll add ads first, obviously)

Why: AWS bills don't pay themselves

🏆 The "Competitive Features" Update

Scrim analysis for teams

Tournament prep recommendations

Pro player comparison ("You're 47% as good as Faker!")

Rank climb roadmap with milestones

Why: Because some people actually take this seriously

🎨 The "Make It Pretty-er" Update

Dark mode (for the 3 AM queue sessions)

Custom themes (Arcade, PROJECT, Star Guardian)

Animated champion portraits

Interactive 3D graphs (because why not?)

Why: If we're going to stare at our failures, they should look good

🔮 The "Psychic Powers" Update

Win probability calculator (before the game even starts)

Optimal queue time predictor

Tilt risk assessment (real-time mental health check)

"Should I play one more?" decision engine

Why: To save you from yourself

🌍 The "World Domination" Update

Support for other games (Valorant, TFT, Wild Rift)

Multi-game profile (are you bad at ALL games?)

Cross-game skill transfer analysis

Universal "git gud" recommendations

Why: Why stop at one game when we can analyze all your failures?

🤝 The "Community Features" Update

Share your best games (flex on Reddit)

Anonymous worst game leaderboard (embrace the shame)

Coach marketplace (real humans, not just AI)

Community-created analyzers (the 49th, 50th, 51st...)

Why: Misery loves company, and so does data

🎓 The "Educational Content" Update

Video tutorials based on YOUR weaknesses

Interactive training modules

Champion-specific guides (personalized to your rank)

"How to not feed" masterclass

Why: Some people actually want to improve, not just see pretty graphs

🔧 The "Technical Debt We've Been Ignoring" Update

Optimize those 47 analyzers (maybe make it load faster?)

Better error handling (fewer "oops something broke")

Actual unit tests (we know, we know)

Database migrations (SQLite won't scale forever)

Why: Because eventually we have to adult

🎪 The "Meme Features" Update

"Roast Me" mode (AI flames you based on your stats)

Yasuo detection algorithm (warns your team)

Tilt-o-meter (visual representation of your mental state)

"Blame the Jungler" analyzer (is it actually their fault?)

Why: Because League is 50% gameplay, 50% memes

🚀 The "Scale to Millions" Update

Move to RDS (goodbye SQLite, it's been real)

Add CloudFront CDN (gotta go fast)

Implement proper caching layers

Auto-scaling everything

Why: For when we inevitably go viral on Reddit

The Realistic Roadmap:

Phase 1: Fix the bugs we know about (but pretend we don't)

Phase 2: Add the features users actually want (not the ones we think are cool)

Phase 3: Make it faster (those 47 analyzers are heavy)

Phase 4: Mobile app (because everyone asks for it)

Phase 5: Monetization (gotta pay for that Bedrock usage)

Phase 6: World domination (obviously)

The Dream Features (If We Had Infinite Time):

AI that watches your games and coaches in real-time

VR training environment (practice in the Matrix)

Neural link integration (download mechanics directly to your brain)

Time machine (go back and dodge that 0/10 game)

Why: Because we can dream, okay?

TL;DR: We're going to add live game analysis, make the AI even smarter, build a mobile app, add social features so you can roast your friends with data, and maybe finally optimize those 47 analyzers. Also, we're keeping the typo in the name because it's part of our brand now. 🍃📊

P.S. - First priority is actually fixing that one bug where... wait, what bug? There's no bug. Everything is fine. Ship it.

Bonus: The "Please Don't Actually Build This" Features:

Automatic dodge button (we'll get banned)

Teammate toxicity predictor (too accurate, too scary)

"Uninstall League" recommendation engine (for your own good)

Relationship impact analyzer (how much LP vs how much girlfriend?)

Built With

Share this project:

Updates