Inspiration
In Ghana, a patient can travel an hour to reach a hospital only to start from zero once they arrive — no pre-registration, no advance triage, no warning to hospital staff that someone urgent is on the way. The Caspian Buildathon's brief — "build an agent, then give it hands" — was the perfect excuse to fix that specific gap: an AI that doesn't just answer questions, but actually reaches the people who need to know, automatically.
What it does
PreCare GH is an AI-powered pre-arrival patient system. A patient describes their symptoms — through a web form or by messaging a Telegram bot directly — and an AI triage agent classifies the case as Emergency, Urgent, or Routine. If it's urgent, two things happen automatically, with no one checking a dashboard:
- The hospital's on-call team gets emailed a clinical summary
- The patient gets pushed live updates on Telegram
The app also handles GPS-based emergency ambulance dispatch, matching patients to the real nearest hospital by live distance calculation (not a hardcoded list), and includes a hospital-facing dashboard showing the live incoming patient queue sorted by urgency.
How we built it
The app is built on Next.js and Supabase, with caspian-sdk handling the multi-channel messaging layer — connecting email and Telegram through a single agent identity. The AI triage logic runs on Groq's Llama models. Hospital and location data is matched using the Haversine formula against real GPS coordinates, with OpenStreetMap for reverse geocoding. The whole thing is deployed on Vercel, with a webhook-driven architecture so Caspian can reach the app's serverless functions the moment a Telegram message comes in.
Challenges we ran into
Plenty, honestly. We originally built the triage agent on Anthropic's API, but hit a billing wall mid-buildathon and pivoted to Groq's free tier — which meant redesigning the prompt handling to survive Groq's stricter rate limits. We also chased down a genuinely nasty bug: a single-character typo in our Supabase project URL (v instead of w) that silently broke every database call for hours before we traced it back through DNS resolution. On top of that, a fresh Supabase project meant several expected tables — hospitals, appointments — simply didn't exist yet, so a chunk of the work was closing gaps between what the code assumed and what the database actually had.
Accomplishments that we're proud of
Getting the full loop working end to end: a patient can message a Telegram bot with zero setup, get triaged by a real AI conversation, and have a hospital find out before they even leave home — verified with real emails landing in a real inbox and real Telegram messages arriving in a real chat, not a mocked demo.
What we learned
That the hardest bugs are rarely the interesting ones — a lot of this build was quietly making sure data actually flowed where it claimed to flow, rather than adding new features. Also: free-tier rate limits are a real constraint worth designing around from day one, not bolting on after the fact.
What's next for PreCare GH
Emergency-contact notifications (alerting a patient's family, not just the hospital), a proactive Telegram follow-up ("did you make it to the hospital?"), and Row Level Security on the database before this could handle real patient data responsibly.
Built With
- caspian-sdk
- google-maps
- groq
- javascript
- llama
- nextjs
- node.js
- openstreetmap
- postgresql
- react
- supabase
- telegram-bot-api
- typescript
- vercel

Log in or sign up for Devpost to join the conversation.