How cneuralnetwork/safar-autonomous-travel works
Safar is a mobile-first conversational travel planner. A traveller signs in, describes a trip, resolves missing details in chat, and chooses outbound, return, and stay options before the backend validates constraints and produces an itinerary. The plan can be exported as a calendar file; Safar does not book travel. The README documents realtime updates and persisted, resumable runs. Source excerpts support the backend’s main wiring, but do not expose every mobile or orchestration call, so some documented links use the README as evidence.
Main entry points: main.py FastAPI routes · AppShell.tsx Mobile app · orchestrator.py Run orchestrator · store.py Run and user store
Components 23
Mobile experience
- Mobile app
mobile/src/screens/AppShell.tsx - Conversation UI
mobile/src/components/MessageRenderer.tsx - Route maps
mobile/src/components/ItineraryMap.tsx - API client
mobile/src/lib/api.ts - Sign-in UI
mobile/src/auth/AuthProvider.tsx - Calendar file export
mobile/src/lib/calendarExport.ts
API and identity
- FastAPI routes
backend/app/main.py - Google auth bridge
backend/app/auth.py
Planning agent
- Run orchestrator
backend/app/orchestrator.py - Request interpreter
backend/app/interpreter.py - Sarvam agent
backend/app/agent_model.py - Travel and run models
backend/app/models.py
Travel planning
- Travel tool registry
backend/app/travel_tools.py - Constraint solver
backend/app/solver.py - Itinerary composer
backend/app/itinerary.py
Persistence and export
- Run and user store
backend/app/store.py - Calendar integration
backend/app/calendar_service.py
Other components
- Traveller
- Google identity
- Supabase Auth
- Travel data providers
- Supabase Postgres
supabase/migrations/20260725111310_initial.sql - Google Calendar
Connections 30
- Traveller → Mobile app: plans a trip
README.md - Mobile app → Sign-in UI: signs in
README.md - Mobile app → Conversation UI: converses through
- Mobile app → API client: sends requests
README.md - API client → FastAPI routes: calls over HTTPS
README.md - Mobile app → Route maps: views routes
- Mobile app → Calendar file export: exports plan
- Sign-in UI → FastAPI routes: starts sign-in
README.md - FastAPI routes → Google auth bridge: routes OAuth
backend/app/main.py - Google auth bridge → Google identity: exchanges identity
backend/app/auth.py - Google auth bridge → Supabase Auth: creates session
backend/app/auth.py - FastAPI routes → Run orchestrator: dispatches runs
backend/app/main.py - FastAPI routes → Run and user store: reads run events
backend/app/main.py - FastAPI routes → Travel tool registry: configures tools
backend/app/main.py - FastAPI routes → Request interpreter: configures interpreter
backend/app/main.py - Run orchestrator → Request interpreter: interprets turns
backend/app/orchestrator.py - Request interpreter → Sarvam agent: requests interpretation
backend/app/interpreter.py - Run orchestrator → Sarvam agent: plans and replans
README.md - Run orchestrator → Travel and run models: uses run schemas
backend/app/orchestrator.py - Run orchestrator → Travel tool registry: dispatches searches
backend/app/orchestrator.py - Travel tool registry → Travel data providers: queries providers
backend/app/travel_tools.py - Run orchestrator → Constraint solver: checks constraints
backend/app/orchestrator.py - Run orchestrator → Itinerary composer: composes itinerary
backend/app/orchestrator.py - Run orchestrator → Run and user store: persists run state
backend/app/orchestrator.py - Run and user store → Supabase Postgres: reads and writes
backend/app/store.py - Mobile app → Supabase Postgres: subscribes to updates
README.md - Mobile app → FastAPI routes: catches up events
README.md - FastAPI routes → Calendar integration: routes calendar actions
- Calendar integration → Run and user store: stores connection tokens
backend/app/calendar_service.py - Calendar integration → Google Calendar: writes itinerary events
backend/app/calendar_service.py