This project implements an agentic workflow using LangGraph that answers real-time user queries about Singapore public transport using the LTA DataMall APIs. The goal of this project is to demonstrate structured agent design, tool usage, state management, and multi-user simulation.
This project is developed as part of a take-home technical assessment to showcase:
- Agent workflow design
- API integration
- Multi-step orchestration using LangGraph
- Multi-user simulation and response handling
The application is exposed as a FastAPI service with Swagger UI for interactive testing.
You can test the deployed backend directly using Swagger UI:
🔗 Live API Test:
https://hyrtos-transport-query-agent.onrender.com/docs#/default/query_transport_query_post
- 🚌 Bus Arrivals – Real-time ETA for buses at any stop
- 📊 Bus Service Information – Route and peak/off-peak frequency
- 🚦 Traffic Incidents – Live accidents, breakdowns, road blocks, diversions
User Query
↓
Planner Node (LLM)
↓
Intent + Parameter Extraction
↓
LangGraph Router
├── BusArrival Node → LTA BusArrival API
├── BusService Node → LTA BusServices API
└── TrafficIncident Node → LTA TrafficIncidents API
↓
Responder Node (LLM)
↓
Final Natural Language Answer
hyrtos_dec/
├── app/
│ ├── api.py # FastAPI routes
│ ├── graph.py # LangGraph workflow
│ ├── tools.py # LTA API calls
│ ├── state.py # Agent state schema
│ └── config.py # Environment + Groq config
│
├── notebooks/
│ └── transport_agent.ipynb # Multi-user simulation
│
├── requirements.txt
├── .env
└── README.md
- Python 3.11+
- LangGraph
- LangChain + Groq (LLaMA 3 – 70B)
- FastAPI
- Uvicorn
- Singapore LTA DataMall APIs
Create a .env file in the project root:
GROQ_API_KEY=your_groq_api_key
LTA_ACCOUNT_KEY=your_lta_datamall_keypython -m venv henv
source henv/bin/activate
pip install -r requirements.txt
uvicorn app.api:app --host 0.0.0.0 --port 8000 --reload-
Base URL:
http://localhost:8000 -
Swagger UI (Primary Test Interface):
http://localhost:8000/docs
{
"query": "When is the next bus arriving at stop 20251?"
}{
"query": "...",
"answer": "...",
"intent": "bus_arrival",
"bus_stop_code": "20251",
"bus_service": null
}When is the next bus arriving at stop 20251?Is bus 30 arriving soon at stop 45009?Show me upcoming buses at stop 97029.How long will I wait for bus 176 at stop 20251?Are there any buses approaching stop 84009 right now?
Tell me about bus 176.How often does bus 30 run?What is the peak frequency of bus 78?Give me details of bus service 97.What route does bus 15 operate on?
Any accidents on the PIE right now?Are there any road blocks on AYE?Show me current traffic incidents in Singapore.Is there a vehicle breakdown on CTE?What diversions are active right now?
The Jupyter notebook notebooks/transport_agent.ipynb contains:
- 10 simulated user queries
- Dynamic agent routing
- Real-time API responses
- Captured outputs for evaluation
The FastAPI backend is deployed on Render with:
- Public REST access
- Swagger UI enabled
- Secure environment variables
This project demonstrates:
- Agentic AI orchestration using LangGraph
- Real-time government transport API integration
- LLM-powered intent extraction and reasoning
- Production-grade FastAPI backend deployment
Anmol Mani Dubey