Problem: UI shows "Distance: 0 km" for all transport options
Root Cause: The UI is using travelDistance prop which comes from results.travel_distance_km, but the backend might not be calculating it correctly.
Problem: Despite fixing the double-counting bug, cost is still ~$75 instead of ~$2.58
Analysis:
- Train one-way: $1.29 (for 3 travelers)
- Round trip should be: $1.29 × 2 = $2.58
- But UI shows: $74.58
Likely Issue: Local transportation ($12/day × 2 days × 3 travelers = $72) is being added to inter-city cost incorrectly.
Current: Fixed $12/day estimate User Request: LLM should estimate costs for tours/activities at destination city
Only: Transportation BETWEEN the two cities (Galle ↔ Matara)
- Train: $1.29 one-way × 2 = $2.58 total
- OR Bus: $1.71 one-way × 2 = $3.42 total
Should NOT Include:
- Local transport at destination (taxis, tuk-tuks)
- Tours/activities transportation
- Airport transfers (no flights for domestic)
At Destination City: Daily movement within Matara
- Public transport: $12/day
- Taxis for sightseeing
- Tuk-tuks
- Rental bikes
Current Formula:
local_transport_cost = $12/day × 2 nights × 3 travelers = $72This seems high! Should be:
# Option 1: Shared daily cost
local_daily = $12/day (for the whole group)
local_total = $12 × 2 days = $24
# Option 2: Per person but realistic
local_per_person = $4/day # More realistic for local transport
local_total = $4 × 2 days × 3 travelers = $24The backend calculates distance but might not pass it correctly:
File: backend/agents/travel_orchestrator.py
The orchestrator sets:
state["travel_distance_km"] = distance_kmBut need to verify it's actually being calculated in _analyze_travel_type.
File: backend/agents/transportation_agent.py (lines 412-424)
# Inter-city transportation
inter_city_cost = cost_per_trip * 2 # ← We fixed this
# Local transportation
local_transport_cost = public_transport_cost * trip_duration * request.travelers
# ↑
# Should this multiply by travelers?
total_cost = airport_transfer_cost + local_transport_cost + inter_city_costThe Problem:
local_transport_cost= $12 × 2 × 3 = $72inter_city_cost= $1.29 × 2 = $2.58- Total = $74.58 ← Matches the screenshot!
But the label says "Inter-City Transportation ($74.58)", which is misleading!
It's showing the TOTAL transportation cost, not just inter-city.
Problem: Cost tab shows one line "Inter-City Transportation: $74.58"
Should Show:
Transportation Costs:
├─ Between Cities (Galle ↔ Matara): $2.58
└─ Local (at destination): $72.00
──────────────────────────────────────────
Total Transportation: $74.58
Current: $12/day/person = $72 for 3 people for 2 days
Better: Use LLM to estimate based on:
- Destination city characteristics
- Planned activities
- Distance from accommodation to attractions
- Local transport options (tuk-tuk, taxi, public bus)
Proposed LLM Prompt:
Estimate local transportation costs at [Matara, Sri Lanka] for [3] travelers over [2] days.
Consider:
- Daily tuk-tuk/taxi for sightseeing: ~$15-20/day (shared)
- Public transport: ~$3/day
- Bike rentals: ~$5/day
- Tours to nearby sites: ~$30/day
Provide realistic daily cost for the whole group.
Backend: Ensure travel_distance_km is calculated and passed:
# In _analyze_travel_type
distance = await self.distance_calculator.calculate_distance(
request.origin,
request.destination
)
state["travel_distance_km"] = distanceUI: Already reads correctly from results.travel_distance_km
Show breakdown of inter-city vs local transportation
Make it more realistic (not multiply by travelers for shared costs)
Use AI to estimate destination-specific costs
Ensure Google Maps API is being called correctly
Transportation Costs:
Inter-City (Galle ↔ Matara):
Train round-trip: $1.29 × 2 = $2.58
Local (at Matara destination):
Daily tuk-tuk/sightseeing: $15/day × 2 = $30
Public transport: $3/day × 2 = $6
Total local: $36
Total Transportation: $2.58 + $36 = $38.58
Much more realistic than $74.58!
- ✅ Fix UI to show inter-city vs local separately
- ✅ Adjust local transport formula (don't multiply by travelers for shared costs)
- 🔄 Add LLM estimation for local transportation
- ✅ Verify distance calculation works
Created: October 11, 2025 Status: Analysis Complete, Ready to Implement Impact: ~50% cost reduction ($74 → $39)