How sam3305/flysand works
FlySAND is an AI-operated airline platform combining customer booking, airline operations dashboards, physics-based cost modeling, dynamic pricing, and agent-driven decisions. The main workflow runs from flight search and seat booking through inventory updates and live operations; a separate pricing loop recalculates fares from weather, cost, demand, and ML signals. The README documents seeding, agent, and realtime capabilities not fully represented in sampled source, so those links follow its architecture description. Backend route wiring and physics dependencies are supported by sampled source.
Main entry points: main.py API Application · master_agent.py Master Agent · db.py MongoDB · game_loop.py Repricing Loop
Components 29
Customer and Ops UI
- Booking Portal
src/components/b2c/B2CPortal.tsx - Ops Dashboards
src/components/b2b/AOCCDashboard.tsx - Agent Console
src/components/ops/AgentOrchestratorPage.tsx - Live Flight Hook
src/hooks/useLiveFlightData.ts
Backend Runtime
- API Application
backend/app/main.py - Booking Route
backend/app/api/routes/booking.py - Flight Routes
backend/app/api/routes/flights.py - Dashboard Route
backend/app/api/routes/dashboard.py - Orchestrator Route
backend/app/api/routes/orchestrator.py - Repricing Loop
backend/app/tasks/game_loop.py - Live Ops Socket
backend/app/websockets/live_ops.py - Flight Seeding
backend/pipeline
Flight Economics
- Aero Physics
backend/app/services/physics_engine.py - Weather Service
backend/app/services/weather_service.py - Thermodynamics
backend/app/services/physics_engine_math.py - Cost and Fare Model
backend/app/services/economics_engine.py - Demand Event Oracle
backend/app/services/event_oracle.py - ML Pricing
backend/app/engines/ml_pricing_model.py
AI Operations
- Master Agent
backend/master_agent.py - Yield Agent
backend/agents/yield_manager.py - Finance Agent
backend/agents/finance_controller.py - Network Agent
backend/agents/network_planner.py - Fuel Agent
backend/agents/fuel_procurement.py - Booking Swarm
backend/agents/swarm.py
State and Events
- MongoDB
backend/app/core/db.py - Redis Bus and Locks
backend/app/core/redis_client.py
Other components
- Traveler
- Airline Operator
- Weather Provider
Connections 38
- Traveler → Booking Portal: searches and books
- Booking Portal → Flight Routes: requests flights
- Booking Portal → Booking Route: submits booking
- Airline Operator → Ops Dashboards: views operations
- Ops Dashboards → Flight Routes: requests flights
- Ops Dashboards → Dashboard Route: requests metrics
- Airline Operator → Agent Console: requests agent run
- Agent Console → Orchestrator Route: dispatches request
- Live Flight Hook → Live Ops Socket: receives updates
- API Application → Repricing Loop: starts background loop
- API Application → Booking Route: registers route
- API Application → Flight Routes: registers route
- API Application → Dashboard Route: registers route
- API Application → Orchestrator Route: registers route
- API Application → Live Ops Socket: mounts socket
- Booking Route → Redis Bus and Locks: locks and publishes
- Booking Route → MongoDB: updates inventory
- Flight Routes → MongoDB: reads flights
- Dashboard Route → MongoDB: reads operations data
- Flight Seeding → Cost and Fare Model: computes route cost
- Flight Seeding → MongoDB: stores flights
- Aero Physics → Weather Service: fetches profile
- Aero Physics → Thermodynamics: calculates impact
- Weather Provider → Weather Service: supplies conditions
- Cost and Fare Model → Aero Physics: uses fuel estimate
- Cost and Fare Model → Demand Event Oracle: gets demand signals
- Repricing Loop → Cost and Fare Model: recalculates floor
- Repricing Loop → ML Pricing: applies pricing model
- Repricing Loop → MongoDB: updates fares
- Repricing Loop → Redis Bus and Locks: subscribes and publishes
- Live Ops Socket → Redis Bus and Locks: relays events
- Orchestrator Route → Master Agent: dispatches task
- Master Agent → Yield Agent: queries via MCP
- Master Agent → Finance Agent: queries via MCP
- Master Agent → Network Agent: queries via MCP
- Master Agent → Fuel Agent: queries via MCP
- Master Agent → MongoDB: reads and commits
- Booking Swarm → Booking Route: submits bookings