Individual capstone · SDAIA Academy
Darb Assist
Fares and Refunds Assistant
A bilingual AI-powered transit assistant combining RAG, function calling, and deterministic refund rules to answer policy questions, assess refund eligibility, and manage support requests.
GitHub repository ↗
The problem
Transit policy questions and refund requests require reliable policy references and consistent decisions. I built a notebook-based assistant for a simulated network that separates language understanding from refund rules.
My contribution
I implemented the individual capstone in Colab, integrating multilingual retrieval, structured extraction, validated tool calls around the Academy’s simulated services, Python refund rules, confirmation flow, safety checks, Gradio and evaluation.
Core engineering components
Policy retrieval
Multilingual MiniLM embeddings and Chroma cosine retrieval support answers with section citations.
Structured extraction
Pydantic captures route, date, complaint category and refund request; missing fields can remain null.
Validated tools and refund rules
Tool arguments must match extracted data; Python assesses eligibility and can leave it unresolved.
Confirmation and safety
Detected PII is masked, unsafe inputs and unsupported output are checked, and ticket creation needs separate confirmation.
System architecture
Input checks and PII masking precede classification. Policy questions go through retrieval and citation validation; complaints use structured extraction, validated trip lookup and Python rules. The Gradio response may offer a pending ticket, created only after a separate confirmation action.
System architecture diagram
Engineering decisions
- Filter retrieved sections by question language and retain distinct section IDs, up to three results.
- Revise the extraction prompt to leave unprovided dates null instead of assuming the reference date.
- Keep refund eligibility in Python; the LLM does not approve refunds.
Evaluation and measured results
Two development runs on December 1, 2026 used GPT-4o mini, top-k = 3 and the same 40 cases. The two improvements were applied together.
| Metric | Baseline | Improved |
|---|---|---|
| Overall pass rate | 95% | 100% |
| Passed cases | 38/40 | 40/40 |
| Structured extraction | 4/5 (80%) | 5/5 (100%) |
| Policy grounding | 9/10 (90%) | 10/10 (100%) |
| Refund rules | 15/15 | 15/15 |
| Tool handling | 4/4 | 4/4 |
| Safety and privacy | 6/6 | 6/6 |
| Mean case latency | 0.664 s | 0.625 s |
| Model calls | 26 | 26 |
| Estimated API cost / 1,000 cases | $0.031391 | $0.034099 |
The same development cases were reused: 100% is not an independent accuracy estimate or a real-world guarantee. Mean latency includes Python-only cases. API cost is estimated for the mixed evaluation workload, not hosting or 1,000 full conversations. Historical run commit IDs were not recorded.
Original evaluation records ↗Interface gallery
Original Gradio screenshots from the simulated project, not a live service.
English — policy questions
Arabic — refund assessment
Support ticket request
Support ticket created
Academic acknowledgment
This project was developed as part of the Developing Generative AI Solutions (AE-203) training program at SDAIA Academy.
The implementation uses the Academy’s simulated transit data and existing trip-status and ticket services.
Technology stack
Language models & retrieval
Rules & tools
Interface & development
Current status and roadmap
Implemented capabilities
- Bilingual policy answers with section-level citations
- Structured complaint extraction and validated trip-status tool calls
- Deterministic Python refund eligibility rules
- Explicit confirmation before creating a support ticket
- PII masking, input and output checks, fallback responses
Completed classroom notebook implementation using synthetic transit data. No real refunds, production deployment or independent evaluation. Positive refund tests use synthetic fixtures; missing evidence can leave eligibility unresolved. Ticket storage is in memory. Future work includes stronger date validation, a calibrated retrieval threshold and unseen test cases. The notebook is not the separate FastAPI deliverable.
GitHub repository ↗