AI-powered bus travel assistant for Rwanda, built with Qwen Cloud
# SmartBus AI Agent π
> AI-powered bus travel assistant for Rwanda β built with Qwen Cloud for the Global AI Hackathon (Track 4: Autopilot Agent)
SmartBus is a production-grade conversational agent that automates end-to-end bus travel booking in Rwanda. Users interact in natural language (English, Kinyarwanda, French, or Swahili) and the agent handles everything: searching routes, comparing prices, holding seats, confirming bookings, and generating PDF receipts β all backed by real database operations, never hallucinated.
---
## Demo
> πΉ Watch the 3-minute demo on YouTube *(link coming soon)*
---
## Features
- **Multi-language support** β English, Kinyarwanda, French, Swahili
- **Multi-agent routing** β intent classifier delegates to Search, Booking, or Pricing sub-agent
- **Persistent memory** β remembers preferred routes and bus types across sessions
- **Booking state machine** β enforces search β hold β confirm β book flow server-side
- **Graceful fallbacks** β retries on quota/timeout errors, surfaces friendly messages
- **PDF receipt generation** β auto-generated after every confirmed booking
- **Human-in-the-loop** β seat is held and user must explicitly confirm before booking is created
- **Tool-grounded** β all trip data, prices, and seat counts come from real DB queries, never invented
---
## Architecture
```
User (Web / WhatsApp)
β
βΌ
Django REST API (POST /api/chat/)
β
βΌ
Intent Router βββ Traveler Memory (DB)
β
ββββββΌβββββββββββββ
βΌ βΌ βΌ
Search Booking Pricing
Agent Agent Agent
ββββββΌβββββββββββββ
β
βΌ
Tools Layer (deterministic)
search_routes Β· get_trips Β· compare_prices
check_seats Β· hold_seat Β· create_booking
get_booking_history Β· generate_booking_receipt
β
βΌ
PostgreSQL βββ Alibaba Cloud ECS
```
---
## Tech Stack
| Layer | Technology |
|---|---|
| LLM | Qwen Cloud (`qwen-plus-latest`) |
| Backend | Django 5 + Django REST Framework |
| Database | PostgreSQL (Alibaba Cloud) / SQLite (local dev) |
| PDF Generation | Re β¦