Inspiration🧠 Methodology: Rift Rewind AI Coaching Agent

Every gamer knows this feeling: You finish a match in League of Legends and instinctively alt-tab to blame your teammates, your ping, your cat, or fate itself… But deep down, you want to know:

“Was I actually bad?”

“Who are my best teammates?”

“Why do I keep losing?”

“Can someone give me the honest truth?”

Most performance analyzers just show statistics. We wanted to go BEYOND numbers. Something personal. Something brutally honest. Something FUN.

That’s how Rift Rewind was born — an AI-powered esports analyst that doesn't just analyze your gameplay… it ROASTS you like your tilted duo partner would.

We blended:

Riot API data

AI analysis

serverless automation

fun personalized roasting

real-time charts

team compatibility profiles

And turned it into a bot that feels ALIVE.

What it does

Rift Rewind is a League of Legends AI companion bot that delivers:

✅ 1. Region Auto-detection

No more “NA? EU? SEA?” confusion. The bot tests all Riot API routes and finds the correct region automatically.

✅ 2. Live Match Stats Extraction

It pulls:

champion played

KDA

gold

damage

deaths

kill participation

CS/min

vision score

role

✅ 3. AI-Powered Long Roast (3,000 words)

Using Claude via AWS Bedrock, it crafts:

detailed esports-style analysis

savage metaphors

statistically-backed flame commentary

meme captions

final verdict

All based on actual match performance, not generic insults.

✅ 4. Compatibility Analyzer

It processes multiple matches and computes:

win rate with each teammate

best synergizing duo

worst performing duo

historical consistency

✅ 5. Data Visualization

It generates charts showing:

KDA trend

teammate synergy bar graph

match-to-match performance

✅ 6. Telegram Bot Experience

The bot works entirely in chat:

/start menu with inline buttons

roast mode

analysis mode

profile photo retrieval

multi-match analytics

chart delivery directly in chat

✅ 7. Streamlit Dashboard

A polished UI view:

graphs

text summaries

interactive analysis

roast generator

How we built it

We combined five major systems into one seamless experience:

🟦 1. Riot Games Developer API Integration

We built a resilient fetch layer that tries: ✅ SEA → ✅ Asia → ✅ Europe → ✅ Americas until it finds a valid match history.

Endpoints used:

/riot/account/v1/accounts/by-riot-id/

/lol/match/v5/matches/by-puuid/

/lol/match/v5/matches/{matchId}

/lol/summoner/v4/summoners/by-puuid/

🟩 2. Telegram Bot Architecture

We used Python Telegram Bot v21, with:

ConversationHandler

inline keyboards

dynamic menus

callback query routing

chunked message sending

🟨 3. AWS Bedrock for AI Roasts

Roast-generation pipeline:

Build a statistically rich custom prompt

Send to Claude-Haiku model

Handle errors gracefully

Split into 3500-char chunks

Send to Telegram

🟥 4. Local Fallback AI (When Bedrock is not available)

If Bedrock fails or access isn't approved:

a local roast template activates

uses match stats

generates witty roast

ensures bot never breaks

🟧 5. Chart/Visual Rendering

Using Matplotlib:

side-by-side PNG plot

trend + bar chart

dynamic teammate ranking

Sent directly as photos in Telegram.

Challenges we ran into

😵‍💫 1. Riot API Region Chaos

One summoner name/tag might exist in:

SEA but not Asia

Asia but not Americas

Americas but not Europe

Solution: Auto-region scanning using cascading fallbacks.

😬 2. Riot API Rate Limits

We hit 429 often during testing.

Solution: Randomized sleeps and local file caching.

🤯 3. Telegram message length limits

AI-roasts generated 3k–8k characters. Telegram max length per message is 4096.

Solution: Automatic chunking.

🧨 4. AWS Bedrock model access

Anthropic models require manual EULA approval.

Solution: Local fallback roast + BEDROCK_Errors detection.

🎨 5. Rendering charts through Telegram

Telegram expects PNG buffers, not files.

Solution: In-memory BytesIO() pipeline.

🚧 6. Matching platform regions (Summoner-v4 vs Match-v5)

Match-v5 returns routing region, summoner-v4 needs platform region.

Solution: Manual mapping dictionary.

Accomplishments that we're proud of

✅ Full-stack AI experience inside Telegram

Everything from stats → visualization → roast → analysis works in chat.

✅ Multi-region Riot API auto-detection

Seamlessly fetches from SEA/ASIA/EU/AM.

✅ 3000-word long roast generation

Deep, structured breakdown using Claude-3.

✅ Profile icon fetch + real-time charting

Feels visually premium and polished.

✅ Scalable deployment readiness

Code structured for:

AWS Lambda

Railway

Render

Fly.io

Cloudflare Workers (API only)

✅ Interactive Inline Keyboard UI

Users never need to type commands — tap-to-navigate experience.

What we learned

✅ Riot API quirks

regional routing != platform region

match_v5 and summoner_v4 mismatch

rate limit management

✅ Telegram bot design principles

avoid blocking I/O

callback_query vs message handlers

inline keyboards improve UX

✅ Large Language Model prompting

structured prompt = better roast

enforce roles and voice

limit output length to avoid truncation

✅ Visualization pipelines

using memory buffers

dual charts in one PNG

managing DPI for clarity

✅ Deployment constraints

API keys management

AWS Bedrock access flow

container vs serverless trade-offs

Built With

Share this project:

Updates