# Project export: TrailAid

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: UC Berkeley AI Hackathon 2026
- Tagline: TrailAid is an offline-first, AI-powered first-aid app that delivers life-saving, evidence-based medical guidance in remote wilderness emergencies where there is no cell service or WiFi
- Devpost: https://devpost.com/software/trailaid
- GitHub: not linked
- Team: contributor stats unavailable

## Devpost submission (written by the team)

### Inspiration

: One of the biggest issues plaguing the healthcare industry today is the collapse of rural and Safety-Net Care. Since 2010, over 150 rural hospitals have closed or discontinued inpatient services, and in 2026, roughly one-third of remaining rural hospitals are considered at risk of closing. This leads to a loss of emergency services, maternity wards, and primary care treatment for people living in these areas. I wanted to singlehandedly adress this problem by creating an AI chat bot that runs entirely offline locally on your device. While primarily targeted to hikers, campers, and international travelers TrialAid is a Progressive Web App with a highly resilient backend to ensure zero data loss during emergencies. How I built TrialAid: TrailAid is architected as an offline-first Progressive Web App (PWA) with a highly resilient backend utilizing to ensure zero data loss during emergencies. Frontend & User Experience: I built the app primarily using SAI Aget S utilizing Next.js 15 and React, designing a PWA with a high-contrast dark theme optimized for outdoor visibility and battery efficiency. Offline-First AI: To eliminate the need for an internet connection, I integrated WebLLM running the Phi-3.5-mini model (~2GB) directly in the browser via WebGPU. Voice Integration: Recognizing that a user's hands might be occupied during an emergency, I implemented a push-to-talk interface using Deepgram's Nova-2 model for highly accurate, medical-grade speech-to-text. Durable State & Backend: The backend is powered by Python Flask and PostgreSQL. To handle the chaos of remote environments, I utilized Agentspan and Orkes Conductor. This allows AI sessions to survive app crashes and network drops. If a device goes offline, emergency logs are queued locally and synced using an exponential backoff algorithm when the connection is restored. 🚧 Challenges I Faced: Resource-Aware Prompting: Standard AI models assume you have access to a hospital. I had to heavily engineer the system prompts to ensure the AI always asks "Do you have [X]?" before recommending a treatment. I had to build a two-tier response system: one for ideal treatments (e.g., an EpiPen for anaphylaxis) and one for wilderness improvisation (e.g., specific positioning and rapid evacuation). Crash-Resistant State Management: Ensuring the AI conversation could survive a browser crash or a dead battery was incredibly difficult. I had to leverage Orkes Conductor workflows and execution_id tokens stored in localStorage to allow the AI agents to seamlessly pick up right where they left off without losing the context of the medical emergency. Offline Error Tracking: Implementing telemetry without an internet connection required building a custom transport for the Sentry SDK, queueing JavaScript errors in local storage, and ensuring they auto-synced without duplicating once the user found cell service. 🧠 What I Learned: Building TrailAid fundamentally shifted my understanding of offline-first application design. I learned how to move complex machine learning models directly onto the edge using WebGPU, which completely changes the paradigm of where compute happens. Furthermore, working with Orkes Agentspan taught me the immense value of durable workflow orchestration—it was eye-opening to see how decoupling the execution state from the local device process creates applications that are virtually unkillable. On a broader scale, structuring the 11 comprehensive WHO/WMS protocols into programmatic tools reinforced my vision for the future of AI: systems that are deeply grounded in factual, life-saving data and built to relentlessly serve humans in their most vulnerable moments.

### Accomplishments we're proud of

: As a solo developer for this hackathon Im incredibly proud of teh amount of working features I integrated into TrialAid and my ability to create a working app in 24 hours entirely by myself. While I was unable to host it on vercel or Expo go. Im very produ of what i built in the last 24 hours. A tool that not only helps humans but saves them.

### What's next

: I see lots of potential for an AI chatbot that runs locally and completely offline. In the near future, I plan to find a way to host it entirely offline

## README (from the GitHub repository)

No README available.

## Detected evidence (automated analysis)

No repository was indexed for this project. Claimed technologies below could not be checked against code.
- Python (language) — claimed on Devpost, not found in the code

## Codebase structure

No repository index available.

## Key source files

No repository index available; no source files included.