Expedia GPT Architecture
The Expedia GPT multi-domain orchestration system is built on six core modules — each with a clear and isolated responsibility.
Together, these modules form a clean, extensible architecture that enables conversational travel planning powered by Expedia’s live APIs.
INSTRUCTIONS.YAML
Expedia GPT is an intelligent, multi-domain orchestration system that powers personalized trip planning experiences using Expedia’s Travel Recommendation Service.
Its purpose is to seamlessly connect and manage four key travel domains — Lodging, Flights, Activities, and Car Rentals — through a unified, schema-driven framework. By combining structured API schemas, workflow metadata, and presentation logic, Expedia GPT delivers complete, context-aware travel itineraries in a natural, conversational style.
Responsibilities
Data Structure & Validation:
Uses strict TypeScript and JSON schemas to define all request and response formats for Expedia APIs.Workflow Orchestration:
Executes a logical trip-planning flow — lodging → flight → activity → car — while propagating context like destination and dates between domains.Error Handling & Fallbacks:
Applies YAML-defined behavioral rules to recover gracefully when data is missing or incomplete.Unified API Access:
Uses a single Expedia API client layer (ExpediaAPIClient.ts) for all data retrieval, ensuring consistency and reliability.User Experience Presentation:
Formats and displays Expedia data in clear, travel-friendly summaries with emojis, Expedia booking links, and transparent pricing in USD.
Impact
Consistency: Ensures every Expedia GPT response follows a standardized, on-brand structure across all travel domains.
Efficiency: Automates multi-domain coordination, reducing redundant user input and improving trip-planning speed.
Scalability: Modular design allows easy expansion (e.g., adding cruises or trains).
Trust & Clarity: Guarantees Expedia-exclusive results with transparent, all-inclusive pricing.
User Delight: Transforms complex travel data into human-friendly, engaging trip recommendations — making Expedia GPT both functional and inspiring to use.
ExpediaOrchestrationSchema.ts
Purpose
This TypeScript module defines the contract of truth for the entire system.
Every API call, data exchange, and presentation layer depends on the types defined here.
Responsibilities
Request/Response Contracts:
Each Expedia domain (lodging, flights, activities, cars) has a strongly-typed interface that defines exactly what input parameters and output fields are allowed.Domain Enums:
Enumerations define standardized values such as:Property types (
HOTEL,RESORT,VR)Guest ratings (
WONDERFUL,VERY_GOOD,GOOD)Amenities (
GYM,SPA,POOL, etc.)Flight sorting preferences (
PRICE,DURATION)
This ensures consistency and minimizes ambiguity when interacting with APIs.
Shared Types:
Reusable interfaces likeGeoLocation,Image, andBedTypeOptionpromote modularity and cross-domain reusability.
Impact
By enforcing type safety at compile time, this schema guarantees that data flowing between Expedia APIs and the GPT orchestration layer is valid, consistent, and predictable.
ExpediaDataExchange.json
Purpose
A JSON schema that defines how structured data is exchanged between Expedia GPT and the Expedia Travel Recommendation Service.
Responsibilities
Session Metadata:
Each transaction carries metadata (session ID, timestamp, domains invoked, GPT version) for traceability and context persistence.Request Payload (User → Expedia):
Captures normalized user intent in a format Expedia’s APIs can process — including destinations, check-in dates, and traveler details.Response Payload (Expedia → GPT):
Standardizes the structure of Expedia’s returned data for consistent downstream rendering.
Impact
This JSON layer ensures data interoperability across APIs and provides a human- and machine-readable reference for debugging, analytics, and API versioning.
ExpediaOrchestrationWorkflow.yaml
Purpose
The workflow metadata file is the heart of orchestration intelligence — encoding how and when each Expedia domain should be called, as well as GPT’s conversational behavior.
Responsibilities
Domain Sequencing Logic:
Defines the natural order of execution —Lodging → Flight → Activity → Car.Context Propagation:
Specifies how data from one domain flows to the next (e.g., hotel destination → flight arrival → car pickup).Conversational Tone and Reminders:
Establishes personality rules (friendly, travel-savvy) and compliance notes (e.g., “All prices in USD”).Output Formatting:
Determines section order, emoji use, and formatting style for final user display.
Impact
By separating logic from code, this YAML file allows developers to update orchestration flow, tone, or presentation style without modifying the TypeScript engine — supporting rapid iteration and A/B testing.
ExpediaController.ts
Purpose
The core orchestration engine that brings the YAML configuration to life.
Responsibilities
Reads YAML Dynamically:
Imports the workflow configuration to understand domain order and triggers.Executes APIs Sequentially:
Invokes each Expedia endpoint (via the API client) in logical order.Propagates Contextual Data:
Shares key information like destination and dates between domains to avoid redundant user input.Applies Fallback Rules:
If an API call returns no results, fallback logic (from YAML) adjusts filters or asks clarifying questions.
Impact
The controller is the command center of Expedia GPT — coordinating data flow, enforcing logic, and ensuring a smooth user experience across all travel domains.
ExpediaAPIClient.ts
Purpose
The unified communication layer between the orchestration logic and the Expedia Travel Recommendation Service APIs.
Responsibilities
Endpoint Wrappers:
Provides clean, asynchronous methods for all Expedia APIs:getLodging()getFlights()getActivities()getCars()
Error Handling:
Each call is wrapped in safetry/catchblocks, ensuring failures are isolated and retried according to configuration.Logging:
Adds clear, structured console logs for transparency (e.g., “Fetching hotels in Maui”).
Impact
This module abstracts away API complexity, allowing the controller to call simple, intuitive functions while maintaining strong separation of concerns.
ExpediaGPTPresenter.ts
Purpose
The output and UX layer that transforms raw Expedia data into beautiful, human-friendly summaries.
Responsibilities
Readable Markdown Formatting:
Converts structured data into chat-ready messages with bold titles, bullet points, and links.Visual Enhancements:
Uses emojis (🏨 ✈️ 🎟️ 🚗) and clear formatting to distinguish travel domains.Clarity and Compliance:
Displays all prices in USD with taxes and fees included, following Expedia brand guidelines.Top Results Only:
Limits output to the top 3 listings per domain for digestibility.
Impact
The presenter bridges the gap between machine data and conversational UX — turning structured API responses into story-like travel recommendations that users can instantly understand and trust.
Conclusion
Each module in the Expedia GPT ecosystem plays a focused role:
The Schema defines structure.
The Data Exchange standardizes communication.
The Workflow YAML governs behavior.
The Controller orchestrates execution.
The API Client enables reliable connectivity.
The Presenter delivers an elegant user experience.
Together, these components form a modular, extensible, and human-centered architecture — transforming raw travel data into an intelligent, delightful conversation powered by Expedia.