Skip to content

Repository files navigation

SENTINEL

Pre-Escalation Behavioral Intelligence System

Predict the spiral. Intervene before it happens. Four agents forecast player behavioral trajectories and recommend proportional interventions — treating community health like public health, not policing.

Run on Replit


Why This Matters

The gaming industry has gotten very good at detecting toxicity after it happens. Players still don't feel safer despite more bans than ever. The unsolved problem isn't better detection — it's earlier intervention. Sentinel demonstrates a prediction-first architecture: forecast behavioral spirals across multi-session trajectories, recommend the minimum effective intervention, and audit every recommendation for false-positive risk and proportionality. This is aligned with SR 11-7 model risk governance: explainability and calibrated uncertainty built into the architecture, not bolted on after.


Architecture

 Player Session History (multi-session trajectory data)
|
+---------------------------+
v v
+------------------+ +------------------+
| Trajectory | | Context |
| Agent | | Agent |
| (health score | | (triggers, |
| forecasting, | | temporal |
| trend analysis) | | patterns) |
+--------+---------+ +--------+---------+
| |
+----------+------------+
v
+------------------+
| Intervention |
| Agent |
| (minimum dose |
| recommendation)|
+--------+---------+
v
+------------------+
| Effectiveness |
| Agent |
| (false positive, |
| proportionality)|
+--------+---------+
v
+------------------+
| Orchestrator |
| (NO_ACTION / |
| NUDGE / ADJUST /|
| MONITOR / |
| ESCALATE) |
+------------------+

Trajectory + Context run in parallel. Intervention uses both results. Effectiveness audits everything. Orchestrator synthesizes the final graduated decision.


Agents

AgentRole
TrajectoryForecasts behavioral health across sessions. Current vs baseline health, predicted health in 3 sessions, decline velocity, trajectory direction (stable/declining/recovering/spiraling).
ContextIdentifies what's driving behavioral change. Failed promos? Late-night fatigue? Solo queue without duo? Role swap? Context determines whether a decline is concerning or perfectly normal.
InterventionRecommends the minimum effective intervention. Cooldown suggestions, matchmaking adjustments, positive reinforcement, social nudges, or proactive outreach — graduated by severity.
EffectivenessThe system's conscience. Evaluates false-positive risk, intervention appropriateness, harm-if-wrong, and alternative explanations. Explicitly penalizes overreaction.
OrchestratorSynthesizes all four into a final decision with a plain-English explainability trail. Surfaces agent disagreements.

Decisions

Five graduated response levels instead of binary ban/don't-ban:

DecisionColorMeaning
NO_ACTIONGreenPlayer is healthy or recovering. No intervention needed.
NUDGEBlueGentle behavioral nudge. Cooldown suggestion, positive reinforcement.
ADJUSTAmberEnvironmental adjustment. Matchmaking tuning, time-of-day recommendations.
MONITOROrangeIncreased observation. Flag for behavioral health team review.
ESCALATERedActive spiral detected. Proactive outreach or restrictive intervention.

Stack

LayerTechnology
BackendPython 3.13, FastAPI, uvicorn
LLMGroq (llama-3.3-70b-versatile)
Game DataRiot Games API (Match-V5, Account-V1)
FrontendReact 18, Vite, Tailwind CSS
StorageSQLite (cache)
DeployReplit / Docker / Render

Smart API Fallback

Riot dev API keys expire every 24 hours. Sentinel handles this with a three-tier fallback:

  1. Live mode (green badge) — Real Riot API data, converted to session trajectories
  2. Cached mode (amber badge) — Cached data from SQLite (7-day TTL)
  3. Demo mode (blue badge) — 8 curated behavioral trajectories covering every decision type

The demo always works, even without a Riot API key.


Demo Profiles

ProfilePatternExpected Decision
Steady Decline3-week progressive tilt, KDA dropping, chat flags risingMONITOR
Promo TiltStable normally, spirals hard after failed promosNUDGE
Night TilterFine during daytime, toxic in late-night sessionsADJUST
Duo DependentGreat teammate when duo'd, progressively toxic soloNUDGE
Comeback KidWas declining, received nudge, behavior recoveredNO_ACTION
False AlarmStats look like decline, actually learning new roleNO_ACTION
Slow Burn GriefingNever triggers chat detection, pattern clear in aggregateMONITOR
Cascade SpiralOne bad game triggered 72 hours of escalating toxicityESCALATE

Setup

Local Development

# Clone
git clone <repo-url>&&cd sentinel
# Backend
pip install -r backend/requirements.txt
# Frontendcd frontend && npm install && npm run build &&cd ..
# Environment
cp .env.example .env
# Edit .env with your GROQ_API_KEY and optional RIOT_API_KEY# Run
PYTHONPATH=. uvicorn backend.main:app --reload

Replit

  1. Fork this repl
  2. Add GROQ_API_KEY to Secrets
  3. Optionally add RIOT_API_KEY (demo works without it)
  4. Click Run

Docker

docker build -t sentinel .
docker run -p 8000:8000 -e GROQ_API_KEY=... -e RIOT_API_KEY=... sentinel

API

EndpointMethodDescription
/api/reviewPOSTForecast a player (SSE stream)
/api/review-demo/{id}POSTForecast a demo profile (SSE stream)
/api/demo-profilesGETList demo profiles
/api/data-modeGETCurrent data source status
/healthGETLiveness check

Disclaimer

Independent concept demo by Aditya Sakhale, built using the public Riot Games API. Not affiliated with, endorsed by, or sponsored by Riot Games. League of Legends, Valorant, and Riot Games are trademarks of Riot Games, Inc.

About

Multi-agent behavioral intelligence system for forecasting escalation and recommending proportional human-reviewed interventions.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages