Rail Sathi
Where seats find you
The problem Rail Sathi solves
🚆 Rail Sathi
Your AI companion for Indian Railways — smarter travel, less stress, wherever the train takes you.
The Problem
Every day, 13 million people travel on Indian Railways. For most of them, the experience involves:
- ⏳ Refreshing IRCTC endlessly to check if a Waitlisted ticket got confirmed — it usually doesn't
- 👁️ No idea how crowded the next coach is before you board
- 🔤 Searching for trains requires memorising 3-letter station codes like HWH, NDLS, BCT
- 🕰️ Train delayed 2 hours? No guidance on what to do at the station
- 🌐 App unusable in tunnels or rural areas with no signal
- 🗣️ The entire railway system operates in English, leaving out hundreds of millions of non-English speakers
No official app solves all of these. Rail Sathi does.
What Rail Sathi Does
🎫 Got a Waitlisted Ticket? Find a Seat Anyway.
The official system only checks if a seat is available for your entire journey. But what if Seat S5-42 is free from Howrah → Gaya, and Seat S3-18 is free from Gaya → Delhi? Together, they cover your full route — yet no system shows you this.
Rail Sathi's Split-Seat Algorithm scans every intermediate station, finds these partial vacancies, and stitches them into a complete journey.
"Use seat S5-42 until Gaya, then switch to S3-18 from Gaya to New Delhi."
You travel confirmed. No guessing. No standing for 12 hours.
📊 See How Crowded a Coach Is — Before You Board
Unreserved coaches have no occupancy data anywhere. You walk the length of a 24-coach train looking for space, with luggage, in the heat.
Rail Sathi passengers report live crowd density from inside their coach — LOW, MEDIUM, or HIGH — with one tap. Reports sync instantly over WebSocket to everyone searching for that coach.
- Verified reporters (signed-in users) get 2× vote weight so trustworthy data rises to the top
- Reports are GPS speed-locked — only submitted if the phone detects movement > 25 km/h, blocking fake reports from stations or platforms
- Works offline — reports made in tunnels are queued and synced the moment signal returns
🗣️ Search in Plain English (or Your Language)
Forget station codes. Just say what you mean:
| What you type / say | What Rail Sathi understands |
|---|---|
| "Mumbai to Delhi tomorrow" | BCT → NDLS, date: tomorrow |
| "Calcutta to Hyderabad this Saturday" | HWH → SC, next Saturday |
| "Bangalore Chennai weekend" | SBC → MAS, nearest weekend |
The AI (Groq LLaMA 3.3 70B) understands city nicknames, informal spellings, relative dates, and partial names — not just exact IRCTC codes.
Voice input is built in — tap the mic, speak your query in any accent, and Groq Whisper transcribes it instantly. Useful when your hands are full with luggage.
🏟️ Train Delayed? Know Exactly What To Do.
A 2-hour delay at an unfamiliar station is stressful if you don't know the station. Rail Sathi's AI Station Guide gives you station-specific, actionable advice:
- 🍽️ Food & Drinks — which stalls, which platform, estimated cost
- 🛋️ Rest & Waiting — retiring rooms, AC lounges, waiting halls, prayer rooms
- 🛍️ Quick Shopping — books, snacks, gifts within the station
- 💡 Practical Tips — ATMs, cloak rooms, charging points, medical help
The guide knows the difference between Howrah Junction and a small rural halt. Ask it anything specific: "Is there an ATM near platform 3?" and it answers.
🎙️ Hear Your Schedule Out Loud
Can't look at your phone while managing luggage and kids? Tap Speak on any train detail screen. Rail Sathi reads your current station, next stop, and estimated arrival time in a natural AI voice (ElevenLabs TTS).
Falls back to on-device speech if the server is unreachable — no silent failures.
📡 Know Which Coach You're In — Automatically
Long trains
Challenges we ran into
🧱 Challenges I Ran Into
Building Rail Sathi wasn't smooth sailing. Here are the real bugs that slowed things down and how each one got resolved.
1. The Voice Recording That Silently Did Nothing
The bug: Tapping the mic, speaking, tapping again — and nothing happening. No transcription, no error, just silence.
Root cause: This was a classic race condition. When the user stopped recording, the code immediately cleared the reference to the recording object and then tried to retrieve the audio file URI from that same reference — which was already gone. The audio file was recorded perfectly on disk; the app just lost its handle to it before asking where it was saved.
Fix: The solution was simply to save the recording reference into a temporary variable before clearing it, then use that temporary variable to fetch the file URI. A one-line reorder. Two hours to find.
2. Android Sends .3gp, Groq Expects .m4a
The bug: Voice input worked perfectly on iOS. On Android, the Groq Whisper API returned a 400 Bad Request every single time.
Root cause: The app was hardcoding the audio format as m4a for every upload — but Android's audio recorder doesn't produce m4a files. It produces .3gp files by default. So every Android upload was sending a .3gp audio file incorrectly labelled as m4a. Groq's API validated the MIME type against the actual file contents and rejected it immediately.
Fix: Instead of assuming a fixed format, the app now reads the file extension from the recorded file's path and maps it to the correct MIME type before uploading. iOS sends m4a, Android sends 3gp — both are now handled correctly.
3. API Key "Not Configured" — But It Was Right There
The bug: The server crashed on startup with GROQ_API_KEY not configured, even though the .env file had the key and everything worked fine when the server was launched from its own folder directly.
Root cause: The dotenv library, which reads environment variables from a .env file, resolves that file relative to wherever the terminal is currently located — not relative to the server script itself. Launching the server from the project root meant dotenv looked for .env in the project root, where there was none. The actual .env file lived inside the server/ subfolder and was never found.
Fix: The server was updated to explicitly tell dotenv where its .env file lives using an absolute path based on the script's own location. Now the key loads correctly regardless of which directory the server is launched from.
4. Real-time Crowd Votes Silently Dropped on Poor Networks
The bug: On flaky mobile connections — common in train tunnels or rural areas — crowd density votes were submitted by users and simply vanished. No error message, no retry, no confirmation. The server never received them.
Root cause: The real-time voting system used Socket.IO's standard emit, which is fire-and-forget. If the network dropped even for a split second between the user tapping "Submit" and the packet reaching the server, the vote was gone permanently with no recovery mechanism.
Fix: Votes are now saved to local device storage the moment the user submits them. A network listener runs in the background — whenever connectivity is restored, it reads the queued votes and sends them to the server in order. No vote is lost, even through a 10-minute tunnel.
5. The catch Block That Hid Everything
The bug: Voice input occasionally failed with zero feedback — the mic button just sat there, unresponsive, with no explanation of what went wrong.
Root cause: The entire voice recording flow was wrapped in an error handler that silently swallowed any exception and only logged a generic message to the developer console. In a production Expo app, that console output is invisible to the user entirely. So whenever something actually failed — a permissions denial, a network timeout, the Groq API being down — the user saw nothing, and the developer saw only "recording error" with no details.
Fix: The error handler wa
Tracks Applied (3)
AI/ML
Open Innovation
Algorand
Algorand
Technologies used

