All projects

Business Support Services

Layla

AI-powered travel planning and booking platform

Built the planner and booking agents with their tools and guardrails, model routing, JSON Patch trip editing by the AI, and the AI evaluation pipeline behind Layla's AI travel agent.

Layla: an AI travel agent for planning and booking trips

1 / 5
Layla: an AI travel agent for planning and booking trips

Layla: an AI travel agent for planning and booking trips

95–98%

Agent tool calls correct on eval sets

97–99%

Edits that changed only what was asked

70–80%

Lower model cost on simple edits

0

Unsourced prices shown to travelers

Stack

OpenAI Agents SDKGPT-4.1 / GPT-4.1 miniClaude Sonnet 4Gemini 2.5 FlashNode.js / ExpressTypeScript + ZodMongoDB Atlas + Vector SearchRedis + BullMQLangfuseNext.jsFlutterGCP Cloud Run

Overview

Layla is an AI travel agent, now part of Expedia Group, that turns natural-language travel requests into personalized, bookable itineraries with live prices. Follow-up requests like "Spend one less night in Tokyo" update only the affected parts of the trip, and a human travel advisor completes every booking.

The central idea: the AI understands the traveler and plans the experience. The application owns the trip. Verified services own the facts. A human advisor confirms every booking.

The problem

Travel planning is highly fragmented, and traditional travel search is good at filtering inventory but does not fully understand conversational intent.

  • Assistants invent facts: general-purpose AI assistants may generate outdated or unverified prices, availability or opening hours.
  • Unstable regeneration: regenerating an entire itinerary after every message creates unpredictable changes.
  • Unrealistic daily plans: activities may be geographically inefficient or scheduled while attractions are closed.

My role

I worked as an AI engineer on Layla's trip-planning and booking platform. I owned three areas: the agent and tool layer, the JSON Patch flow through which the AI edits the structured trip, and the AI evaluation pipeline.

What I built

Agents and tools

  • Planner and booking agents on the OpenAI Agents SDK, with GPT-4.1 for the agents and GPT-4.1 mini for intent routing and simple edits.
  • Zod-typed tools that return invalid calls as errors, and an output guardrail rejecting any price or availability not backed by a tool result.
  • Booking tools pause the run until the traveler confirms and a travel advisor approves, keeping payment details out of the model's context.

AI trip editing

  • JSON Patch (RFC 6902) edits, so a change recomputes only the affected dates, hotels, activities and budget.
  • Every generated patch is validated before a city or day is sent, so the traveler never sees a failed plan.

AI evaluation

  • Langfuse datasets per capability with recorded supplier responses, so every run is reproducible.
  • Deterministic validators for tool calls, schedule feasibility, price grounding and edit stability, and a Claude Sonnet 4 judge for subjective dimensions, calibrated against travel-expert labels.
  • Pull-request and release gates, and weekly triage that turns production failures into dataset cases.

Results

  • Tool calls: 95–98% of agent tool calls were correct on the evaluation datasets; 90–95% of full booking-flow sequences were correct end to end.
  • Grounded prices: no price or availability statement without a supplier source reached a traveler; the output guardrail stopped one in 0.3–1% of agent runs before it was shown.
  • Schedule feasibility: 85–95% of itineraries passed schedule validation on the first pass; every itinerary shown to a traveler had passed.
  • Edit stability: 97–99% of conversational edits changed only the trip components the request targeted.
  • Edit success: 95–97% of edits applied on the first try, and 98–99.5% after the single retry on GPT-4.1.
  • Speed: the first validated patch of a new trip streamed in 3–8 seconds (p50); a full 10-day multi-city itinerary completed in 30–60 seconds (p50).
  • Model cost: routing simple edits to GPT-4.1 mini cut their model cost by 70–80% compared with GPT-4.1.
  • LLM judge: agreed with travel-expert labels on 85–92% of rubric scores on the calibration set.

Tech stack

LayerTechnologies
FrontendNext.js on Vercel, React, TypeScript, Tailwind CSS, shadcn/ui, Zustand, Mapbox GL JS
MobileFlutter (Dart), Mapbox Maps SDK, Firebase Authentication and Cloud Messaging
Backend and dataNode.js, Express, ws WebSockets, Zod, JSON Patch, MongoDB Atlas + Vector Search, Redis, BullMQ
AIOpenAI Agents SDK, GPT-4.1, GPT-4.1 mini, Claude Sonnet 4 and Gemini 2.5 Flash on Vertex AI, Langfuse
Travel APIsSkyscanner, Booking.com Demand API, Viator, Google Places, Mapbox, NAVITIME, Open-Meteo, Sherpa°
InfrastructureGCP Cloud Run, Memorystore, Cloud Storage, Pulumi, GitHub Actions, Sentry, OpenTelemetry

Related case studies