3 weeks ago - last edited 3 weeks ago
Track B (Creative Thinking) entry for the Genie-Powered App Challenge, built and deployed on Databricks Free Edition.
The Week 1 slate: pick a matchup room.
You're an NFL analyst. A coach needs a Week 1 scouting report. You have 15 minutes before the next practice and he wants some data-driven insights to share with the team.
Gridiron Genie is a matchup room built on Databricks Apps where every user-facing analytical finding comes through Genie. Pick any of the 16 Week 1 matchups and the agent researches a full scouting brief, planning its own investigation, writing its own SQL, and generating its own charts. Drill deeper in Genie chat, and when you find something that matters, add it to the game report: Genie writes a new drill-down section using the brief conversation's earlier research as context, and the app appends it to the existing report. Print the finished report for the coach.
What can you ask? Whole-team and position-group edges, run-direction and pass-depth splits, red-zone and third-down performance, which players carry recent usage into the contest, exact season totals, and follow-ups on any of it, scoped to the matchup room you're in. Most answers come back in EPA (expected points added, the change in expected points a play produces) alongside success rates and sample counts.
The architecture in three layers: what happens when you ask a question (top), how the data was built (middle), and the Databricks services underneath (bottom).
One Databricks Automation Bundle manages the catalog and schemas, three Lakeflow Jobs, the Genie Agent definition, and the app as one versioned deployment.
Each column in the seven Gold views has a Unity Catalog comment written to help Genie interpret the data correctly. The Gold build fails if any comment is missing. This metadata works alongside the source-controlled Genie instructions, example SQL, and knowledge-store configuration to provide a consistent semantic layer.
For example, when Genie reports a player’s yards per carry and qualifying attempts by run direction, it retrieves those values from the curated run-direction view. The schema defines what qualifies as a carry, how direction is categorized, and how missing data should be interpreted. Genie generates the explanation, but the data model determines what the numbers mean.
The Genie space is generated from source-controlled Python, including deterministic identifiers, ordered configuration, one instruction block, and twelve example SQL queries. As a result, changes to the space are reproducible and reviewable in Git.
We measured performance with Genie benchmark evaluations. The original five-question benchmark improved from 3/5 to 5/5. The failures showed that the agent was misreading the schema so we added better column comments, better example SQL queries and tighter instructions. After these updates, we expanded the suite to eleven questions, the final evaluation scored 11/11, showing that the added context had improved the agent's understanding across the whole data contract, not just on the questions we had previously fixed.
The most useful lesson: examples can outweigh prose when they conflict. In this project, when an example SQL query contradicted a written instruction, Genie followed the example. A red-zone example phrased "in this game" silently pinned one suggested question to the wrong game because the example, not the instruction block, won the routing. Renaming the example and interpolating team names fixed it.
The app talks to the same curated space through two APIs:
When Agent Mode generates a chart, the app retrieves the chart image through a separate backend endpoint and sends it to the browser.
POST /api/2.0/genie/agents/{space_id}/responsesAccept: text/event-streamContent-Type: application/json{ "input": [ { "type": "message", "role": "user", "content": [{ "type": "input_text", "text": "..." }] } ], "enable_viz": true}Follow-ups reuse the returned conversation_id, which is what powers the app's best feature: add to game report. A chat finding is sent as a follow-up in the brief's own conversation; Genie writes a new drill-down section using its earlier research as context, and the app appends it to the existing report. This turns chat from a separate question-and-answer panel into a collaborative game-planning workflow.
The agent plans the investigation, runs its own SQL, and charts what it finds.
The client inspects each Genie result's shape: if the rows carry run-direction or pass-depth members, the answer renders as a 2.5D football field with team-colored lanes, count-up deltas, and sample sizes. Everything else falls back to Genie's prose plus the SQL-receipted table. Because the renderer responds to the returned data, an unanticipated question can still produce the field visualization when its result matches a supported shape.
When the answer has spatial shape, the app renders it as a 2.5D field
The printed game report: the analyst’s ad-hoc drill-down, written by Genie.
Genie requests run under the app’s service principal, so users receive access through the application rather than direct permissions on the SQL warehouse. The Genie Agent is configured with seven registered Gold views, while Unity Catalog governs access to the underlying data.
Databricks records Genie API activity in system.access.audit, providing a platform-level trail for space changes, evaluation activity, and API requests without requiring a custom audit-log implementation. These records capture operational events and response status — not complete conversations, generated SQL, or the agent’s internal reasoning.
SELECT event_time, action_name, request_params, response.status_codeFROM system.access.audit WHERE service_name = 'aibiGenie' AND event_date >= current_date() - INTERVAL 30 DAYS ORDER BY event_time DESC
On Free Edition, that query surfaced this project's space updates, benchmark runs, and agent responses.
A deployment issue exposed an important grant behavior: CREATE OR REPLACE VIEW wipes per-view grants on every rebuild. When a service principal should read every current and future view in a dedicated schema, grant SELECT at the schema level, or the app goes blank the next time a job rebuilds the views.
Gridiron Genie is a fan-built demo. It is not affiliated with or endorsed by the NFL or any team; marks belong to their owners. Data provided by nflverse under the CC-BY-4.0 license. Product icons in the architecture diagram via the community databricks-architecture-icons project.
3 weeks ago
Well done! Should forward this to my favorite team (Tampa) to see if they can actually use it to not stink (not likely).
2 weeks ago
This is great! Also appreciate you called out benchmarking.
2 weeks ago
This looks great! Great architecture stack with some up-and-coming new AI features from Databricks. I appreciated how you called out investing first in the data layer and enforcing standards there as the foundation. Very cool!