Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Transpo Agent (Pawa AI)

Your AI travel agent for buses in Tanzania — search, compare, recommend, book seats, pay with mobile money, and manage tickets. Built on Pawa AI with a Streamlit UI.

What it does

  • Natural-language travel requests in Kiswahili, English, or mixed speech
  • Search & compare buses across operators (CSV demo inventory)
  • Preference-aware recommendations (price, time, AC/Wi-Fi, class)
  • Full booking loop: seat → payment → digital ticket
  • Cancel / reschedule / track trip tools
  • Optional STT / TTS voice booking via Pawa Voice APIs
  • Optional Knowledge Base + semantic retrieval for transport FAQs

Quick start

cd /Volumes/Sartify/transpo_agent_by_pawa_ai
source .transpo-env/bin/activate   # or: python3 -m venv .transpo-env && source .transpo-env/bin/activate
pip install -r requirements.txt
cp .env.example .env
# put your key from https://builder.pawa-ai.com/dashboard?page=keys
streamlit run app.py

Open the URL Streamlit prints (usually http://localhost:8501). The API key is read only from .env.

Optional: upload knowledge base

python scripts/setup_knowledge_base.py
# copy printed PAWA_KB_REFERENCE_ID into .env

Project layout

app.py                 Streamlit UI
src/
  pawa_client.py       Chat (stream/tools/reasoning/RAG), TTS, STT, KB
  agent.py             Tool-calling agent loop
  tools.py             search_buses, reserve_seat, make_payment, ...
  data_layer.py        CSV queries + city/date normalization
  booking_service.py   Reserve / pay / confirm / cancel / reschedule
data/
  cities.csv stations.csv operators.csv routes.csv
  buses.csv seats.csv payment_methods.csv bookings.csv
  knowledge/tanzania_transport_guide.txt

Example prompts

  • Nataka kwenda Mwanza kesho usiku kutoka Dar.
  • Natafuta basi la bei nafuu kwenda Arusha Ijumaa.
  • Nataka kwenda Arusha kutoka Dar kesho, sitaki basi linaloondoka kabla ya saa 12, budget yangu ni 30,000.

Deploy

Any Streamlit host works (Streamlit Community Cloud, Railway, Render, VM):

  1. Set PAWA_AI_API_KEY as a secret.
  2. Start command: streamlit run app.py --server.port=$PORT --server.address=0.0.0.0
  3. Persist /data/bookings.csv and /bookings if you want tickets to survive restarts.

Notes

  • Bus inventory is demo CSV data (sample operators/fares for ~14 days from 2026-08-15) so the full agent loop works without a live GDS.
  • Payments are simulated successful mobile-money/bank transactions for demo purposes.
  • Docs: Pawa introduction · Chat · TTS · STT · Knowledge Base

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages