Case study · AI
Ask questions about 1.7M schools in plain English
For Yugam International School I built Yugam Ask, an AI agent that answers questions about India's 1.7 million schools by writing safe SQL, searching the web and remembering each user's context, all on a self-hosted model.
- Role
- Designed and built solo
- Data
- 1.7M UDISE school records
- Model
- Self-hosted Qwen on vLLM
- Cost
- GPU starts only when needed
01 The challenge
The team needed answers from a huge public schools dataset (which districts, how many schools, which boards) without writing SQL, and without sending data to a third-party AI or paying for an always-on GPU.
02 What I built
- An agent built with FastAPI that turns questions into read-only SQL against PostgreSQL, with guardrails so it can never change data.
- Web search and per-user memory so follow-up questions work naturally.
- A self-hosted Qwen model served with vLLM on a rented GPU.
- An on-demand gate that starts the GPU when someone asks and shuts it down when idle, keeping costs low.
- A nightly sync from MongoDB into PostgreSQL so answers stay current.
03 Results
- Plain-English answers over 1.7M records
- No data sent to third-party AI providers
- GPU cost only while in use
- Built and shipped in days
04 Stack
- Python
- FastAPI
- PostgreSQL
- MongoDB
- vLLM
- Qwen
- SearXNG
- Text-to-SQL
Want something like this for your business?
Tell me what you need. I usually reply within a day.