Inspiration

Public transport in Pune is a goldmine of efficiency hidden behind a wall of confusion. With a massive PMPML bus network, two brand-new Metro lines, and a busy local train corridor, the infrastructure exists—but the information gap remains.

Most commuters rely on guesswork or static timetables that don’t reflect real-world delays.

MargMate was built to turn this chaos into a reliable, Uber-like experience but for public transit. The goal is simple: make public transit the first choice for every Punekar by providing the visibility needed to move with confidence.


What it does

MargMate is an AI-assisted public transit monitoring platform that transforms how people interact with city transport.

Core Features

  • Live Map Interface — Track trains like Uber in near real-time
  • AI Transit Assistant — Personalized route guidance and suggestions
  • Smart Alerts — Notifications for approaching trains and nearby transit
  • Multi-Modal Support — Metro, train, and bus integration

How we built it

MargMate is designed as a modular, scalable system.

Backend

  • Built with FastAPI for high-performance APIs
  • Integrated Google Directions API for route intelligence
  • Extracted transit metadata (vehicle type, train number, timings)

Frontend

  • Built with React + TypeScript + Tailwind
  • Used MapLibre GL for map rendering
  • Designed an Uber-like interface for intuitive tracking with GPS display

AI Layer

  • Integrated an LLM-based agent (Qwen3-32B via Featherless)
  • Supports natural language queries like:

“Best way from Pune Station to Swargate right now?”

“Generate an itenerary around this route”

“Zoom into the station where i'll need to switch metro line”

  • Given custom tools to view and control UI state like zoom, pin, highlight, web search, railyatri api etc.
  • Rigid system prompt to avoid hallucinations and only provide data from given sources.

Real-Time System

  • Implemented a polling-based live tracking system
  • Train data fetched via RailYatri APIs
  • Used coordinate interpolation for smooth movement

Challenges we ran into

1. Real-Time Tracking Without WebSockets

  • Avoided unnecessary complexity while staying within API ratelimits
  • Built a lightweight polling system with caching + interpolation

2. Extracting Train Data

  • Train numbers appeared in inconsistent formats
  • Solved using regex-based extraction and structured pipelines

3. Making AI Actually Useful

Instead of generic chat, we built agentic actions:

  • Pin trains
  • Fetch routes
  • Control UI state

What we learned

  • Real world data is never clean or consistent
  • Simplicity > over-engineering
  • UX matters more than features — clarity drives adoption
  • AI becomes powerful when it can take actions, not just respond

What's next for MargMate

Smart Mobility for Pune Metro City

MargMate aims to become the “Google Maps for public transport, but truly real-time and AI-native.”

Instead of building new infrastructure, we make existing systems:

  • Transparent
  • Predictable
  • Trustworthy

MargMate shall also allow native language support for localities.

Built With

Share this project:

Updates