Agent with tools, not a raw LLM
The model never guesses numbers. It calls SQL tools against the real database, so every answer is grounded in actual data instead of the model's imagination.
Project Overview · Agentic AI + Data
An AI agent over 270,000+ volleyball points that answers coaches with real, validated stats and visualizations — the team-specific analysis general-purpose LLMs can't do.
The problem
UCSD's volleyball coaches wanted to ask real questions of their data — how an opponent sides out against a particular serve, how a lineup shifts win probability — but the numbers live in 270,000+ raw VolleyMetrics points. A normal dashboard can't answer open-ended questions, and a general-purpose LLM will confidently make up plausible-sounding stats.
Coaches needed something that could reason over the actual data and be trusted not to invent a number.
Architecture
A coach asks in plain language. An OpenAI agent introspects the Postgres schema, writes a SQL query, runs it against Neon, and validates the result is correct before answering — retrying if the query is wrong. Only verified numbers reach the coach, rendered as stats and Plotly charts.
Key decisions
The model never guesses numbers. It calls SQL tools against the real database, so every answer is grounded in actual data instead of the model's imagination.
Each query is validated before results surface. An invalid query triggers a retry, not a wrong number handed to a coach who's about to make a decision on it.
The agent reads the live schema, so it writes queries that match the actual tables and columns rather than hallucinating a field that doesn't exist.
The agent collected, cleaned, and loaded VolleyMetrics data into a queryable relational store, turning a messy export into something you can actually ask questions of.
What shipped
Coaches ask questions in plain language and get back real, sourced stats and visualizations that general-purpose tools can't produce. Here's a walkthrough.
Challenges & what's next
The hard part was trust: making the agent reliably produce correct SQL and catch its own mistakes before a coach ever saw a wrong number. The validation loop was the key — it's the difference between a demo and something coaches will actually rely on. Next: caching common queries for speed and a polished coach-facing chat UI.
Stack