-
-
Classes: After you paste your Brightspace calendar link, Buddy lists your classes and upcoming exams.
-
Group text: Buddy starts a real iMessage group text for the group.
-
Ask: Ask in plain words. Buddy sends its follow-up questions in one message.
-
Landing page: The landing page: a scroll-driven ride up Trousdale Parkway through a toon-shaded 3D campus.
-
Match: A match: who you’re with, why this group, and the open room with a 1-click LibCal link.
-
Groups tab: The Groups tab shows the room, the check-in time and a group chat.
-
No match: If nobody matches within 10 minutes, Buddy says sorry and stops looking.
-
Architecture: Web and text messages go through one handleMessage pipeline. Claude Haiku reads, the server decides.
-
Matching flow: How a request becomes a group, and what Buddy does at 2, 4 and 10 minutes while you wait.
Inspiration
The week before a midterm, half a lecture hall at USC is studying the same material alone. Finding a group means posting in the class group chat if there even is one, waiting for replies, agreeing on a time, and then searching LibCal for a room before Leavey's group rooms fill up. We wanted the shortest path from "I need to study CSCI 104 tonight" to sitting at a table with people doing the same thing. Texting felt like the right front door, because there's nothing to install and you just say what you need.
What it does
Trojan Buddy is an AI study-group matcher for USC students. You use it on a website with a dashboard, or by texting its phone number.
- Sign in with your USC email (a one-time link), then paste your Brightspace calendar link. Buddy reads your classes and exam dates from it.
- If you want, link your phone with a texted 6-digit code. From then on, the dashboard chat and your texts are one conversation.
- Ask in plain words, for example "CSCI 104 midterm 2 review tonight 7 to 9, want someone chill." Buddy sends its follow-up questions in one message: do you want the same class, related classes, or anyone who just wants to study, and where and how do you like to study?
- Buddy matches you with real students who share at least an hour of free time with you. Each of you replies YES to confirm.
- Buddy checks live LibCal availability across 43 bookable study rooms and solo pods (Leavey, Doheny, SEL and Norris Medical, plus Fertitta Hall for Marshall students). It picks one member to book the room and sends the whole group the 1-click booking link. Students do the booking themselves.
- Everyone in the group gets a real group text with Buddy in it. The dashboard's Groups tab shows the room, the check-in time and a group chat. If you can't make it, text Buddy LEAVE and it tells the group.
- If there's no match after a few minutes, Buddy offers to widen the search to related classes, then to anyone. If nobody matches within 10 minutes, it apologizes and stops looking, so you know to make other plans. If you'd rather study alone, it finds you an open study pod.
How we built it
The website is built with Vite. The landing page is a scroll-driven, toon-shaded Three.js ride up Trousdale Parkway through a 3D campus, with landmarks like Bovard, Doheny and the VKC tower modeled in Blender, and the dashboard is a chat with Buddy on top of a campus map drawn from OpenStreetMap data.
The backend is Node handlers on Vercel with Postgres on Supabase. Every message, whether it comes from the web or a text, goes through one handleMessage function, which is how both channels stay one conversation.
Each message gets one Claude Haiku call through the Anthropic API. The call returns strict JSON with the intent, the parsed request (course, exam, topics, vibe, time window, place, group size and scope) and any follow-up questions. The model only interprets; the server validates every field and takes every action. If the model is slow, a rule-based parser answers instead.
For matching, at least 60 minutes of shared free time is a hard filter. Each remaining pair is scored with weights that depend on the narrower of the two students' scopes. For same-class requests the score is:
$$ s(a,b) = 0.45\,\text{exam} + 0.25\,\text{vibe} + 0.15\,\text{topics} + 0.15\,\text{place} $$
Groups form greedily above a threshold of $0.6$, which drops to $0.45$ after two minutes of waiting. A Postgres advisory lock stops two students from claiming the same classmate at the same moment. The "why this group" line comes from a template filled with what the members actually share, so it's instant and only states true things.
For rooms, lib/libcal.js reads the public availability grid that LibCal's own pages use, caches it so we don't hammer it, and links straight to the open room's booking page.
Texts go out through Twilio, or through an iMessage bridge while it's running: a Mac signed in to Messages sends Buddy's texts and creates the group threads.
Challenges we ran into
US carriers block app-to-person texts from numbers without A2P 10DLC registration, and registering takes weeks. We built the iMessage bridge on a rented Mac to get around it. The bridge polls the server and sends Buddy's texts and codes from a personal phone number, and if it stops, Twilio takes over again within a minute.
USC has no public room-booking API, and booking for a student would mean holding their NetID and getting past Duo. So Buddy reads live availability and gives the student a 1-click link.
Only USC's admins can register an OAuth app with Brightspace. Sign-in became a USC email link plus a pasted Brightspace calendar feed, which still gives Buddy real classes and exam dates.
Vercel's free Hobby plan only builds commits from the account owner, so teammates' pushes didn't deploy until they went through Andrew's account.
Our early scoring could match two students who had no time in common, and sample students could fill a group. We made time overlap a hard rule and now only match real students with each other. We also added the 10-minute give-up with an apology, because hearing nothing is worse than hearing no.
A reply like "sunday 2-4" could answer Buddy's last question or start a new request. Conversation state plus the intent field in the single Claude call sorts that out in one round trip.
What we learned
Most of the hard part of a campus tool was getting access. Brightspace, LibCal, SSO and the SMS carriers all needed someone to say yes before the code mattered.
A small, fast model with a strict output schema is enough for a texting assistant. Because the model interprets and the server decides, a prompt injection can't make Buddy do anything.
For anything that has to be accurate, a template worked better than a second model call.
Serverless shaped the design. We match the moment a request arrives, and a once-a-minute tick handles timeouts.
Students would rather hear "sorry, nobody's free" than wait with no answer.
What's next
An official LibCal API app so Buddy can book the room as soon as a group forms, a production Brightspace registration, getting our Twilio number's A2P 10DLC registration approved so Buddy's texts no longer go through a personal phone number, and a one-semester pilot in a few large intro classes.
Built With
- anthropic
- applescript
- brightspace
- claude
- claude-haiku
- css
- github
- html
- icalendar
- imessage
- javascript
- libcal
- macos
- node.js
- openstreetmap
- postgresql
- python
- resend
- supabase
- three.js
- twilio
- vercel
- vite