Skip to main content

Accommodation Orchestrator

The AccommodationSearchOrchestrator coordinates accommodation searches across multiple providers (Booking.com and Sabre), aggregates results, and enriches them with TTV Scoring insights.

Responsibilities

  1. Coordinate Multi-Provider Search — Query Booking.com and Sabre concurrently
  2. Aggregate Results — Combine and deduplicate results from all providers
  3. Apply TTV Scoring — Score options against preferences and policies
  4. Generate Insights — Create user-facing explanations
  5. Persist Results — Save accommodation options to database

Source Code

ComponentLocation
Orchestratorcore/orchestrators/accommodation_search_orchestrator.py
Booking.com Servicecore/services/booking_dot_com_service.py
Sabre Servicecore/services/sabre_service.py
Insight Servicecore/services/insight_service.py

Search Flow

AccommodationSearchOrchestrator.search_accommodations()

├── 1. Load TripSearch and requirements
├── 2. Search providers concurrently (Booking.com + Sabre)
├── 3. Aggregate and deduplicate results
├── 4. For each accommodation:
│ ├── Create entities (Accommodation, Room, Product)
│ ├── Extract TTV features
│ └── Generate insights
└── 5. Persist all changes

Key Methods

See the source code for full implementation details.

MethodPurpose
search_accommodations()Main entry point - coordinates the full search flow
_search_all_providers()Concurrent search across Booking.com and Sabre
_aggregate_results()Merge and deduplicate provider results
_create_trip_option()Create TripOption entity with accommodation link

Feature Extraction

Features are extracted from Accommodation and Product entities for TTV Scoring.

See the feature implementations in:

  • models/core_models/scoring/option_feature/accommodation/accommodation_features/
  • models/core_models/scoring/option_feature/accommodation/product_features/

Transaction Management

The orchestrator uses background_context() for database operations, ensuring all changes are committed atomically.

warning

If both providers fail, the orchestrator returns an empty summary rather than raising an exception, allowing the AI agent to handle the failure gracefully.