Inspiration
Campus crime data is often technically accurate but difficult for students to interpret in real time. Incident logs, police feeds, and alerts are usually verbose, inconsistent, or written for compliance rather than everyday decision-making. We were inspired to build SpartaSafe after noticing how hard it is for students to quickly answer simple questions like “Is it safe to walk here right now?” or “Has anything happened near my building recently?” without digging through dense reports or multiple sources.
Our goal was to make campus safety information clear, calm, and aactionable, without sensationalizing crime or overwhelming users.
What it does
SpartaSafe is an AI-powered campus safety assistant that summarizes recent crime and safety incidents around campus in a human-readable way. Users can:
- View recent incidents with clear summaries and trends
- Check safety scores for specific campus locations
- Receive calm safety guidance when no incidents are reported
- Ask follow-up questions to filter by time window, location, or source
Instead of dumping raw records, SpartaSafe focuses on context, patterns, consistent performance, and practical next steps.
How we built it
We built SpartaSafe as a full-stack web application with:
- PostgreSQL, Prisma for structured incident storage
- Supabase for hosting the database
- LangChain to orchestrate an AI agent with tools
- Local map using Leaflet.js
- Gemini models to generate concise, structured summaries
- A custom safety prompt enforcing consistent Markdown formatting
- A React/Node.js frontend with a chat-style interface
- WebSockets to reload the page in real-time without manual inteference
Incident data is normalized server-side into display-ready fields (local time, human-friendly locations, translated dispositions) before being passed to the AI. This prevents “debug dump” outputs and ensures the model focuses on interpretation rather than formatting.
Challenges we ran into
One of the biggest challenges was balancing accuracy with readability. Raw crime data includes internal IDs, coordinates, timestamps in UTC, and coded dispositions. Exposing this directly made outputs confusing and overwhelming.
We also ran into:
- Performance issues caused by rebuilding the AI agent on every request
- Markdown formatting being flattened by frontend CSS resets
- Bullet points and spacing disappearing due to global style overrides
- Deciding when the AI should access the database vs. respond with general safety guidance
Solving these required careful coordination between backend tooling, prompt design, and frontend rendering.
Accomplishments that we're proud of
- Designing a strict prompt and tool contract that consistently produces clean, readable outputs
- Transforming raw incident data into human-centered safety summaries
- Eliminating noisy internal fields without losing important context
- Achieving fast response times by caching the AI agent and limiting tool calls
- Creating a calm UX that informs without causing unnecessary alarm
What we learned
We learned that AI systems are most effective when:
- Tools return exactly the data users should see, not everything available
- Formatting and presentation are treated as first-class design problems
- Frontend, backend, and prompt design are aligned as one system
We also gained hands-on experience with modern AI agent patterns, database introspection, schema migrations, and production-grade UI debugging.
What's next for SpartaSafe
Next, we want to expand SpartaSafe by:
- Supporting multiple campuses with configurable data sources
- Introducing confidence indicators to distinguish official reports from community submissions
- Allowing users to subscribe to personalized safety alerts
- Improving trend analysis using lightweight statistical summaries (e.g., frequency changes over time)
Ultimately, we hope SpartaSafe can become a trusted, everyday tool for helping students stay informed and feel safer on campus.
Built With
- css
- gemini
- javascript
- leaflet.js
- node.js
- postgresql
- prisma
- supabase
- tailwind
- typescript
- websockets
Log in or sign up for Devpost to join the conversation.