RMRuize MaAI SYSTEMS LAB
Projects

AI Agent System

NBA Roster Upgrade Agent

An LLM-driven NBA player recommendation and scouting workflow built around team need diagnosis, player strength vectors, fit ranking, robustness checks, and grounded Q&A.

Pipeline nodes

11

WebApp registry

Eval metrics

7

zero-shot vs tools

Backend

FastAPI

imports nba_agent

overview

The backend imports the original NBA-Roster-Upgrade-Agent-Webapp package from the v2-webapp-agent branch. It calls the original parser, roster agent, agentic tool selector, need reasoning, player-strength builder, fit ranker, sensitivity checker, grounded Q&A, zero-shot evaluator, benchmark helpers, and radar renderer without importing Streamlit.

role

Original project authoring and portfolio integration: replaced the simplified portfolio wrapper with a FastAPI bridge around the WebApp computation modules and a Next.js agent console.

full WebApp backend wrapper

NBA Agent Console

Calls /api/nba/run on https://ruizelab-api.onrender.com and displays the original WebApp pipeline, traces, evaluation, and grounded Q&A.

idle

run controls

Sidebar controls

data contract

Requires teams.csv, games.csv, and games_details.csv. Missing files return a clear error without recorded fallback.

natural-language query input

model status

LLM missing

Model openrouter/free. Deterministic mode.

how to read this result

Selected tools show what the planner surfaced first. Closed cards can still be opened because the backend returns the full AgentResult trace for audit.

No run yet

Configure the WebApp controls and run NBA Roster Upgrade Agent to display the original pipeline output.

architecture flow

Agent and model flow

The live pipeline trace appears in the backend runner after execution. This section shows the original project components that the backend wraps.

01

planner

LLM Parser

query JSON

Converts the natural-language roster request into team, goal, top-k, recent-game window, and availability filters.

02

planner

Agentic Tool Selection

tool plan

Selects visible workflow sections, validates dependencies, records skipped tools, rationales, and fallback state.

03

analytics

Tool A: Team Need Diagnosis

need vector

Uses recent team statistics and league z-scores to compute a need-weight vector.

04

features

Tool B: Player Strength Representation

player vectors

Builds player strength vectors from box-score features and standardized skill indicators.

05

ranker

Tool C + Sensitivity

fit + robustness

Ranks players by fit score, generates recommendation cards, and checks stability under need-weight perturbation.

tools and models

Components behind the demo

planner

LLM Parser

query JSON

Converts the natural-language roster request into team, goal, top-k, recent-game window, and availability filters.

planner

Agentic Tool Selection

tool plan

Selects visible workflow sections, validates dependencies, records skipped tools, rationales, and fallback state.

analytics

Tool A: Team Need Diagnosis

need vector

Uses recent team statistics and league z-scores to compute a need-weight vector.

features

Tool B: Player Strength Representation

player vectors

Builds player strength vectors from box-score features and standardized skill indicators.

ranker

Tool C + Sensitivity

fit + robustness

Ranks players by fit score, generates recommendation cards, and checks stability under need-weight perturbation.

example input

Recommend top 5 players for the Warriors to improve interior defense using the last 10 games. Only include players with at least 20 games and 18 average minutes.

final result

The FastAPI wrapper returns the original WebApp AgentResult structure: parsed query, selected/skipped tools, Tool A/B/C tables, sensitivity output, scouting summary, grounded Q&A, zero-shot comparison metrics, benchmark rows, and radar SVGs.

limitations

  • Live recomputation requires teams.csv, games.csv, and games_details.csv at NBA_DATA_PATH or in the bundled WebApp data/raw folder.
  • The original ranking does not include salary, age, trade feasibility, or cap constraints.
  • Zero-shot comparison and LLM-selected tools require OpenRouter credentials; deterministic fallbacks are reported when unavailable.