Inspiration
Every week ASU clubs, departments and campus offices put out free food: pizza at meetings, catered lunches at talks, snacks at study nights, boba and donuts at socials. A lot of it goes in the trash because nobody outside the room knows it's there. The information exists, but it's buried: on the day we started, about 112 upcoming Sun Devil Central events mentioned food, but only 23 said so in the title. The rest hid it in the description: "refreshments provided", "food trucks on the quad", "boba after the meeting". No student reads 100+ event descriptions a day. So we built an AI agent that does, and a mascot that never misses a crumb: ASU's great-tailed grackle.
What it does
Grockle is a free-food finder for campus, built around Grok Bot, an AI agent that runs on its own.
- Grok Bot reads the whole campus calendar every hour. It downloads the public Sun Devil Central feed, decides which events really give away food, and writes the results straight onto the map. Nobody has to tag an event or press a button.
- Every pin shows Grok's reasoning. Each event comes with what food is offered, dietary tags (vegan, vegetarian, halal, kosher, gluten-free), a one-sentence summary Grok wrote, a confidence score, and the exact quote from the event text that Grok based its decision on. Confident finds become fork pins; uncertain ones become hollow "maybe" pins, so students can judge for themselves.
- The map (web and iPhone) shows those pins live: green when food is out, gold when it's running low, maroon when it starts later. A Plan ahead filter shows the coming days.
- The Free Food Beacon closes the loop at the table. Each student types their ASU ID number into Grockle once, and the app turns it into their own unique check-in QR code. At the table, a Raspberry Pi 4 with a camera reads that code, and Grockle checks the student into the event on Sun Devil Central, so the club gets official attendance with no sign-in sheet. Grok Bot then uses that Sun Devil Central check-in count to update how much food is left, turning the pin from green to gold to gone as people arrive. A phone mounted next to the beacon shows "You're checked in!", and everyone on the map can see the event is real, busy, and whether food is still worth the walk.
How Grok Bot works
Grok Bot is the backend agent that turns a raw calendar into a food map:
- Wakes up on a schedule. A background scheduler runs it every hour (and on startup);
POST /api/ingest/runtriggers it on demand for demos. - Pulls the feed. It downloads the public Sun Devil Central iCal feed, converts times to Arizona time, and caches the feed so the demo still works offline.
- Picks what's worth asking about. A fast keyword pass flags events that might involve food. Events that haven't changed since Grok last labeled them (same LAST-MODIFIED) are skipped, so it only spends calls on new or edited events.
- Asks Grok in batches. Up to 10 events per call go to Grok through the xAI API at temperature 0, with a system prompt that spells out the edge cases: food for sale, fundraisers, food drives, potlucks, and phrases like "food for thought" or "games catered to new members" are not free food.
- Demands structured JSON and checks it. Every reply must match a strict schema:
has_free_food,items,dietary,confidence, anevidencequote of at most 15 words taken word for word from the event, and asummaryof at most 140 characters. Anything malformed is rejected and the batch is retried. - Never leaves the map blank. If Grok fails twice, a keyword labeler steps in with confidence 0.5 (shown as "maybe"). When Grok is back, Grok Bot automatically re-labels those keyword guesses on its next run.
- Publishes. Events at or above the 0.7 confidence cutoff become pins; each record keeps
labeled_by: grokand the time it was labeled. The web map and the iPhone app pick up the changes on their next refresh.
Grok also helped build Grockle: we used Cursor with Grok as the coding model throughout the weekend for the ingester, the API, the map and the Pi beacon code, and to review each other's pull requests.
How we built it
- Backend: Python, FastAPI, APScheduler and httpx; Grok via the xAI API; locations geocoded onto the campus map. Beacon endpoints handle food status, the camera's QR sightings, and check-ins: each ASU ID counts once per event, is passed through to the linked Sun Devil Central event as an official check-in, and feeds the count Grok Bot uses to update the food level. IDs are stored only against the event they checked into.
- Web app: React and Vite with a Leaflet map, built mobile-first. The check-in page asks for a 10-digit ASU ID, keeps it only on the student's phone, and draws the QR code on the device.
- iPhone app: SwiftUI with native Apple Maps (MapKit), the same fork pins and legend, a native check-in pass built from the student's ASU ID (saved on the phone), and the web app inside for the rest.
- Hardware: Raspberry Pi 4 with a SunFounder Fusion HAT+ and an OV5647 camera;
beacon.pyreads frames with picamera2 and decodes QR codes with OpenCV. The beacon deliberately uses no AI: frames are never saved or uploaded, and the Pi reports only the decoded pass to Grockle. Grockle handles the Sun Devil Central check-in, and Grok Bot does the food-level update on the server. - Teamwork: feature branches and pull requests with a teammate review, about 37 PRs over the weekend.
Challenges we ran into
- Our display died halfway through the hackathon. The beacon was built around a 4" round touchscreen on the Pi, and at about 7 PM on Saturday it fried. It went dark after the Pi browned out on battery power, and from then on it jammed the I2C bus it shares with the camera, taking the camera down with it. We proved it with
i2cdetect, unplugging one ribbon at a time, and with no replacement screen we had to rethink the display overnight. A phone mounted next to the beacon became the display: we rebuilt the kiosk page for a phone held sideways in its case, with the event, food status and check-in count on one side and the Pi camera's live view on the other. It turned out better for students: bigger, brighter, and it works with the phone everyone already has. - Teaching Grok what "free food" means. "Catered", "food" and "snacks" show up in plenty of events that aren't giving anything away. We wrote explicit negative rules and required an exact evidence quote, which made wrong answers easy to spot and fix.
- Trusting AI output in a live app. We validate every field of every reply, retry malformed batches, and fall back to keywords, so one bad response can't break the map.
- Power and a blue-faced camera. On battery alone the Pi browned out under camera load, so we moved to a 5V/3A supply. Then the preview showed everyone with blue skin: picamera2's RGB888 frames are already in OpenCV's BGR order, and we were converting them a second time.
- Proximity is hard. Detecting a student's phone over Bluetooth failed in a hall with about 900 Bluetooth devices, so we switched to QR codes built from each student's ASU ID. One scan identifies exactly one student, which is what an official Sun Devil Central check-in needs, and the same ID can't be counted twice at one event.
Accomplishments that we're proud of
- An AI agent that runs with no human in the loop: every hour Grok Bot reads the calendar, decides, explains itself with a quote, and updates the map.
- Finding the food that title search misses: most food mentions were only in descriptions.
- A full loop from AI to hardware and back: Grok Bot finds the event, the map sends students there, the beacon checks them into Sun Devil Central with their ASU ID, and Grok Bot uses those check-ins to update how much food is left.
- A native iPhone app and a web app on one backend, built in a weekend.
What we learned
Structured output plus an evidence quote is what makes an LLM classifier usable in a real product: you can validate it, show it to users, and debug it. We also learned to debug hardware from the bus up (I2C scans, ribbon seating, undervoltage flags), and to split a hackathon across four people with pull requests.
What's next for Grockle
- Grok reading flyers: students upload a screenshot of a club's Instagram flyer and Grok pulls out the food, time and room.
- Smarter alerts: Grok Bot pings you when food is out within walking distance of your next class.
- Official data access from ASU (Sun Devil Central runs on CampusGroups) instead of the public feed.
- Any campus: point Grok Bot at another school's public calendar feed.
Built With
- apscheduler
- cursor
- fastapi
- gpiozero
- grok
- httpx
- icalendar
- ios
- javascript
- leaflet.js
- mapkit
- opencv
- picamera2
- python
- raspberry-pi
- react
- swift
- swiftui
- vite
- xai
