Khidmat AI · hackathon build
Booking a home-service pro from one sentence
Finding an AC technician or a plumber in Pakistan still means phone calls and guesswork. When someone cancels, you start all over again.
Context
Built in about four days by a team of two for the “AI Service Orchestrator for the Informal Economy” challenge. A customer writes or speaks a request in Urdu, Roman Urdu or English. Seven AI agents work out the job, find and rank nearby pros, book one, and re-book automatically if that pro declines.
How it works, step by step
Step 1 of 8
BuiltUnderstand the request
“AC kharab hai, urgent technician chahiye” becomes a clear job: AC repair, urgent, this area. If it's unclear, it asks one question back.
At this step
AC kharab hai, urgent technician chahiye
An intent agent (LangGraph) maps the request to one of 13 service categories. Below 0.7 confidence it asks a clarifying question instead of guessing.Step 2 of 8
BuiltFind pros nearby
It looks for pros within 10 km and widens to 20 km if it needs to.
Geocoding, then a MongoDB $near query on a 2dsphere index: 10 km, widening to 20 km, with a fallback to area-name match.Step 3 of 8
BuiltRank them fairly
Pros are ranked on distance, rating, punctuality, cancellations, skill and recent work, and each pick comes with a one-line reason in your language.
A 6-factor weighted score: distance 25%, rating 20%, on-time 15%, cancellations 15%, skill tier 15%, recency 10%. A rationale is generated per pick.Step 4 of 8
BuiltBook with a clear price
You pick a pro and get a booking number and a price that reflects how complex and how urgent the job is.
Booking ids are atomic (counter upsert). Price = base × complexity (1.0 / 1.3 / 1.6) × urgency, minus any loyalty discount.Step 5 of 8
BuiltThe pro decides
The pro's own agent checks their calendar and workload, then accepts, declines or offers another time. The pro always has the final say.
A provider agent checks calendar, capacity and skill and proposes accept, reject or another slot. The human decision comes in through a decision endpoint.Step 6 of 8
BuiltIf they decline, re-book automatically
If a pro says no or cancels, the system drops them, re-ranks, and offers the next best, up to five times.
A recovery agent excludes the rejected provider, applies a loyalty discount and re-runs ranking. It stops after 5 replans or when candidates run out.Step 7 of 8
BuiltTrack the job
Chat with the pro and follow the job from “arrived” to “done”. Steps can't be skipped.
A guarded state machine over 15 booking statuses (invalid moves return 422). Chat is polled every 5 seconds.Step 8 of 8
BuiltFinish and rate
When you approve the work you rate the pro, and their trust score updates for the next customer.
Completion updates trust as a moving average (0.8 × old + 0.2 × outcome), and customers leave a 1–5 star rating.
Decisions & tradeoffs
- Chose
- a graph of small agents with a re-plan loop
- over
- one big prompt
- because
- each step can be tested on its own, and a declined booking simply loops back to ranking.
- Chose
- giving the pro the final say
- over
- auto-accepting on their behalf
- because
- informal workers juggle their own schedules. A booking they never agreed to becomes a no-show.
What's real today
- Built8 steps
A 4-day hackathon prototype, not a live service. Payment is cash only, login uses a demo code, and push notifications and complaints aren't built.
What it achieved
- AI agents working in sequence
- 7
- home-service categories
- 13
- languages: Urdu, Roman Urdu, English
- 3
- from idea to working prototype, team of two
- 4 days
Stack & role
- React Native 0.83
- Next.js 16 API
- LangGraph.js
- MongoDB (geospatial)
- Qwen / Gemini
- Google Maps