Design an AI Travel Planning Agent

0%

Editorial Solution

Agent requirements

Why a Conversational Agent Instead of a Form-Based Search?

Agent Objective

Key Capabilities

Autonomy and Constraints

Cost and Latency Constraints

Tool & action design

Tool Inventory

Read vs Write Actions

Tool Selection Strategy

Memory & state design

Memory Layers

Conversation History

State Transitions

Preference Learning

Agent architecture

Architecture Overview

The Planning State Machine

Why Sequential Booking (Not Parallel)

Context Window Management

Execution flows

Flow 1: Initial Planning

Flow 2: Refinement

Flow 3: Booking

Flow 4: Price Change During Booking

Flow 5: Booking Failure with Rollback

Core reasoning design

Constraint Satisfaction

Temporal Reasoning

Preference Learning and Conflict Resolution

When to Present Options vs Ask Questions

Safety & permission model

Payment Handling

Booking Confirmation Flow

Cancellation Transparency

Rate Limiting

Data Privacy

Observability & monitoring

The Core Problem

Key Metrics

Session Tracing

Common Anti-Patterns in Travel Agent Monitoring

Alerting

Failure modes & recovery

Failure Mode 1: Price Change Between Search and Booking

Failure Mode 2: API Timeout from Provider

Failure Mode 3: Sold-Out Availability

Failure Mode 4: Conflicting Schedules

Failure Mode 5: User Changes Destination Mid-Planning

Failure Mode 6: LLM Reasoning Error

Degraded Mode Operation

Evaluation & future

Evaluation Framework

Automated Testing

Comparison to Manual Planning

Future Directions

Table of Contents

Agent requirements

Why a Conversational Agent Instead of a Form-Based Search?

Agent Objective

Key Capabilities

Autonomy and Constraints

Cost and Latency Constraints

Tool & action design

Tool Inventory

Read vs Write Actions

Tool Selection Strategy

Memory & state design

Memory Layers

Conversation History

State Transitions

Preference Learning

Agent architecture

Architecture Overview

The Planning State Machine

Why Sequential Booking (Not Parallel)

Context Window Management

Execution flows

Flow 1: Initial Planning

Flow 2: Refinement

Flow 3: Booking

Flow 4: Price Change During Booking

Flow 5: Booking Failure with Rollback

Core reasoning design

Constraint Satisfaction

Temporal Reasoning

Preference Learning and Conflict Resolution

When to Present Options vs Ask Questions

Safety & permission model

Payment Handling

Booking Confirmation Flow

Cancellation Transparency

Rate Limiting

Data Privacy

Observability & monitoring

The Core Problem

Key Metrics

Session Tracing

Common Anti-Patterns in Travel Agent Monitoring

Alerting

Failure modes & recovery

Failure Mode 1: Price Change Between Search and Booking

Failure Mode 2: API Timeout from Provider

Failure Mode 3: Sold-Out Availability

Failure Mode 4: Conflicting Schedules

Failure Mode 5: User Changes Destination Mid-Planning

Failure Mode 6: LLM Reasoning Error

Degraded Mode Operation

Evaluation & future

Evaluation Framework

Automated Testing

Comparison to Manual Planning

Future Directions

Before designing anything, ask: what does this agent actually do, and why is it hard?

Travel planning is inherently iterative. A user rarely knows exactly what they want upfront. They say "find me a 5-day trip to Tokyo under $3000 for 2 people in April" and then refine: "actually, can we do 7 days if we find cheaper flights?" A form-based search (like traditional travel sites) forces users to fill out rigid fields, submit, review, change fields, resubmit. A conversational agent lets users express constraints naturally, change their mind mid-planning, and get recommendations that account for trade-offs they did not think to specify.

The key difference: a form handles one search at a time. An agent handles a planning session that involves dozens of searches, comparisons, and trade-offs across flights, hotels, and activities, all while tracking a shared budget.

What makes travel planning uniquely hard for agents:

  • Real-time pricing: A flight that costs $450 at 2pm costs $520 at 2:05pm. The agent must handle price volatility gracefully.
  • Cross-domain coordination: Flights, hotels, and activities have interdependent constraints. A flight arriving at 11pm means the hotel check-in must support late arrival. A hotel in Shinjuku means activities should be accessible from there.
  • Budget allocation: $3000 total does not mean $1000 per category. Cheap flights free up budget for a nicer hotel, or vice versa. The agent needs to reason about budget trade-offs.
  • Temporal reasoning: A 3-hour layover in a connecting city is not enough time for a side excursion. An activity ending at 6pm and dinner at 6:15pm across town is not feasible. The agent must understand time and geography.

Agent Objective

The agent helps users plan complete trips through natural language conversation. It searches flights (via Skyscanner or Amadeus API), hotels (via Booking.com API), and activities (via Viator or GetYourGuide API). It builds itineraries under budget and time constraints. It handles real-time pricing changes. It books with explicit user confirmation.

Core task: Given a natural language description of a desired trip, iteratively search, compare, and book flights, hotels, and activities while satisfying budget, schedule, and preference constraints.

Success criteria:

  • Complete trip planning sessions in under 15 minutes of conversation (vs 2-3 hours manually)
  • Final booked trip within 5% of the user's stated budget
  • Zero unauthorized bookings (every charge requires explicit confirmation)
  • Greater than 90% of itineraries have no scheduling conflicts (overlapping events, impossible transit times)

Key Capabilities

  • Multi-turn planning: Maintain context across a long conversation. "Find flights to Tokyo" followed by "what about Osaka instead?" should not lose the budget and date constraints.
  • Parallel search: Search flights and hotels simultaneously when constraints are independent, reducing wait time.
  • Constraint propagation: When the user picks a flight arriving April 5 at 3pm, the hotel search automatically adjusts to check-in April 5.
  • Budget tracking: Continuously show remaining budget as selections are made. "You have $1,200 left for activities after flights ($980) and hotel ($820)."
  • Price monitoring: Between search and booking, prices change. Detect changes and notify the user before proceeding.
  • Preference learning: If the user rejects two budget hotels, stop suggesting budget options and shift to mid-range.

Example interaction:

 
1User: "Find me a 5-day trip to Tokyo under $3000 for 2 people in April"
2Agent: Searches flights and hotels in parallel, presents top 3 options for each
3User: "The second flight looks good. Can we find a hotel near Shibuya?"
4Agent: Locks in flight ($890 for 2), searches hotels near Shibuya, shows remaining budget ($2,110)
5User: "That hotel is too expensive. Something cheaper?"
6Agent: Re-searches with lower price ceiling, adjusts recommendations
7User: "Perfect. Now what can we do there?"
8Agent: Searches activities in Tokyo for those dates, suggests an itinerary respecting arrival/departure times
9User: "Book everything"
10Agent: Shows complete itinerary with total cost, requests confirmation, books sequentially

Autonomy and Constraints

This agent is semi-autonomous with a human-in-the-loop for payments. It can search, compare, and recommend freely. It cannot spend money without explicit user approval.

Autonomy boundaries:

  • Can do freely: Search flights, hotels, activities. Build and modify itineraries. Suggest alternatives. Track budget. Re-search when constraints change.
  • Requires confirmation: Any booking that involves payment. Cancellations. Itinerary changes after booking.
  • Cannot do: Store credit card numbers. Book without confirmation. Share user data with third parties. Make assumptions about unstated preferences.

Constraints:

  • Must handle sessions lasting 30+ minutes with 50+ messages without losing context
  • API rate limits vary by provider (Amadeus: 10 req/s, Booking.com: 5 req/s, Viator: 20 req/s)
  • Booking APIs have different cancellation windows and confirmation formats
  • Currency conversion must use real-time rates, not cached values older than 1 hour

Cost and Latency Constraints

Every planning interaction involves multiple API calls and LLM invocations. Understanding the cost structure helps make architectural decisions:

  • LLM inference: $0.002-0.01 per message (depending on model). At 30 messages per session, that is $0.06-0.30 per planning session. The LLM is the largest variable cost.
  • Flight search API: $0.01-0.05 per call (Amadeus). A session makes 3-5 flight searches. Total: $0.03-0.25.
  • Hotel search API: $0.005-0.03 per call (Booking.com). 2-4 searches per session. Total: $0.01-0.12.
  • Activity search API: $0.003-0.01 per call (Viator). 2-3 searches per session. Total: $0.006-0.03.
  • Booking API calls: Free (providers earn commission on bookings).

Total cost per session: $0.10-0.70. At 1,000 sessions/day, that is $100-700/day. The revenue model must account for this: a commission on bookings (5-10% from providers) or a subscription fee.

Latency targets: Users tolerate longer waits during planning than during simple search because they understand the agent is doing complex work. But there are limits:

  • Search results: <5 seconds (users see a "Searching..." indicator)
  • Conversational response (no search): <2 seconds
  • Booking confirmation: <10 seconds (users expect payment processing to take a moment)
  • Overall session: <15 minutes from first message to final booking

The bottleneck is the external API calls, not the LLM. Amadeus flight search can take 2-4 seconds. Running flight and hotel searches in parallel cuts perceived latency significantly.

Cost optimization levers: Use a smaller model (GPT-4o-mini, Claude Haiku) for routine tasks (constraint extraction, result formatting) and reserve the frontier model for complex reasoning (conflict resolution, temporal planning). This hybrid approach cuts LLM costs by 50-70% with minimal quality impact on the routine tasks.

Interview Tip

Travel planning has a unique property: the cost of a wrong booking is real money. Unlike a search engine where a bad result wastes time, a mistaken flight booking wastes hundreds of dollars. This is why every booking action requires explicit user confirmation.

Parallel API search: flight, hotel, and activity searches run concurrently, reducing total search time from 10 seconds to 4 seconds

Tools are how the agent interacts with the travel ecosystem. Each tool wraps an external API with a clear interface, and the distinction between read-only tools and booking actions is critical.

Tool Inventory

1. Flight Search

Searches available flights across carriers using Skyscanner or Amadeus API.

 
1Input: {
2  origin: string, // IATA code, e.g., "SFO"
3  destination: string, // IATA code, e.g., "NRT"
4  departure_date: string, // ISO date
5  return_date?: string, // ISO date (omit for one-way)
6  passengers: number,
7  cabin_class?: "economy" | "premium_economy" | "business" | "first",
8  max_price?: number, // per person
9  preferred_airlines?: string[]
10}
11Output: {
12  flights: [{
13      id: string,
14      airline: string,
15      departure: datetime,
16      arrival: datetime,
17      duration_minutes: number,
18      stops: number,
19      price_per_person: number,
20      price_total: number,
21      cabin_class: string,
22      booking_url: string,
23      price_expires_at: datetime // when this quote expires
24  }]
25}

The price_expires_at field is essential. Flight prices are volatile, and you need to know when a quoted price is no longer guaranteed. Typical expiry: 15-30 minutes.

Common Pitfall

Every search result has a hidden expiration. Flight prices can change within 15 minutes. If the agent presents an option that has expired, the user selects it, and the price jumps at booking, trust is destroyed. Track price_expires_at and re-search before booking confirmation.

2. Hotel Search

Searches available hotels via Booking.com or similar API.

 
1Input: {
2  destination: string, // city or coordinates
3  check_in: string, // ISO date
4  check_out: string, // ISO date
5  guests: number,
6  rooms: number,
7  max_price_per_night?: number,
8  min_rating?: number, // e.g., 4.0
9  location_preference?: string, // e.g., "near Shibuya station"
10  amenities?: string[] // e.g., ["wifi", "breakfast", "pool"]
11}
12Output: {
13  hotels: [{
14      id: string,
15      name: string,
16      rating: number,
17      price_per_night: number,
18      price_total: number,
19      location: { lat: number, lng: number, area: string },
20      amenities: string[],
21      cancellation_policy: string,
22      booking_url: string,
23      price_expires_at: datetime
24  }]
25}

3. Activity Search

Searches tours, excursions, and experiences via Viator or GetYourGuide.

 
1Input: {
2  destination: string,
3  date: string,
4  categories?: string[], // e.g., ["food", "culture", "outdoor"]
5  max_price?: number,
6  duration_hours?: { min: number, max: number },
7  time_of_day?: "morning" | "afternoon" | "evening"
8}
9Output: {
10  activities: [{
11      id: string,
12      name: string,
13      description: string,
14      duration_hours: number,
15      price_per_person: number,
16      start_times: string[],
17      rating: number,
18      location: { lat: number, lng: number },
19      cancellation_policy: string
20  }]
21}

4. Booking Action

Executes a booking. This is the only tool that costs money.

 
1Input: {
2  item_type: "flight" | "hotel" | "activity",
3  item_id: string,
4  payment_token: string, // tokenized payment, never raw card data
5  travelers: [{ name: string, passport?: string, email: string }],
6  special_requests?: string
7}
8Output: {
9  confirmation_code: string,
10  status: "confirmed" | "pending" | "failed",
11  total_charged: number,
12  cancellation_deadline: datetime,
13  details: object
14}

5. Budget Tracker

Internal tool (no external API) that tracks spending across the trip.

 
Input: { action: "set" | "deduct" | "release" | "status", amount?: number, category?: string }
Output: { total_budget: number, spent: { flights: number, hotels: number, activities: number }, remaining: number }

6. Weather Lookup

Checks weather forecasts for destination dates.

 
Input: { destination: string, date_range: { start: string, end: string } }
Output: { daily: [{ date: string, high_c: number, low_c: number, condition: string, rain_chance: number }] }

7. Currency Converter

Converts between currencies using real-time rates.

 
Input: { amount: number, from: string, to: string }
Output: { converted_amount: number, rate: number, rate_timestamp: datetime }

Read vs Write Actions

This distinction is the most important architectural boundary in the agent:

Read-only tools (search, weather, currency): The agent calls these freely, in parallel, multiple times. They are safe to retry, safe to call speculatively, and produce no side effects.

Write actions (booking): The agent must never call these without explicit user confirmation. They are not idempotent (booking twice means paying twice), they involve real money, and they may be irreversible.

The implementation enforces this at the tool level: booking tools require a confirmation_token that the agent can only obtain by presenting a summary to the user and receiving explicit approval. This is not just a prompt instruction ("always ask before booking") because LLMs can ignore instructions. It is a hard code-level gate.

Key Insight

Never rely on prompt instructions alone to prevent unauthorized bookings. Enforce the confirmation gate in code: the booking tool physically cannot execute without a user-provided confirmation token.

Tool Selection Strategy

Unlike the fixed pipeline of a RAG agent, the travel planning agent must dynamically select tools based on conversation context. The agent decides what to search based on what information it already has and what the user is asking for.

Decision logic:

  • User provides destination + dates + budget → search flights and hotels in parallel
  • User has selected a flight → use arrival time to constrain hotel check-in, then search hotels
  • User has selected a hotel → use hotel location to constrain activity search area
  • User says "book everything" → present confirmation summary, then book sequentially (flight, hotel, activities) with rollback plan if any booking fails
  • User asks "what's the weather like?" → call weather lookup, then use results to suggest indoor/outdoor activities

Memory for a travel planning agent is more complex than for a simple Q&A bot. The agent must track user preferences, trip constraints, search results, selections, and booking status across a conversation that can last 30+ minutes.

Memory Layers

The agent maintains four distinct memory layers, each with different lifetimes and purposes:

1. User Preferences (persistent, cross-session)

These are learned over time and persist across trips:

 
1{
2  user_id: "u-7821",
3  seat_preference: "window",
4  hotel_min_rating: 4.0,
5  hotel_blacklist: ["hostels", "motels"],
6  dietary_restrictions: ["vegetarian"],
7  airline_loyalty: "United MileagePlus",
8  preferred_cabin: "economy",
9  currency: "USD",
10  typical_budget_range: { min: 2000, max: 5000 }
11}

Store these in a user profile database (PostgreSQL or DynamoDB). Update them when the user explicitly states a preference ("I always prefer window seats") or when you infer from repeated behavior (rejected 3 budget hotels in a row implies a preference for mid-range or higher).

2. Trip Context (session-scoped)

The current trip's constraints, set at the start of the conversation and refined throughout:

 
1{
2  session_id: "s-4f2a",
3  destination: "Tokyo",
4  dates: { departure: "2026-04-10", return: "2026-04-15" },
5  travelers: 2,
6  budget: { total: 3000, currency: "USD" },
7  trip_purpose: "leisure",
8  flexibility: { dates: "fixed", destination: "flexible", budget: "hard_limit" }
9}

The flexibility field matters. A hard budget limit means the agent must never suggest options that exceed it. Flexible dates mean the agent can suggest "flying a day earlier saves $200."

3. Itinerary State (session-scoped, evolving)

Tracks what has been searched, selected, and booked:

 
1{
2  flights: {
3    searched: [{ query: {...}, results: [...], timestamp: "..." }],
4    selected: { id: "FL-123", price: 890, status: "selected_not_booked" },
5    booked: null
6  },
7  hotels: {
8    searched: [...],
9    selected: null,
10    booked: null
11  },
12  activities: {
13    searched: [...],
14    selected: [],
15    booked: []
16  },
17  budget_remaining: 2110,
18  schedule: [
19    { date: "2026-04-10", events: [{ type: "flight", details: "..." }] },
20    { date: "2026-04-11", events: [] },
21    ...
22  ]
23}

This is the most complex state object. Every user action modifies it: selecting a flight deducts from budget, rejecting a hotel clears the selection, adding an activity inserts it into the schedule.

4. Price Cache (short TTL)

Search results are cached briefly to avoid redundant API calls, but prices change rapidly:

 
1{
2  cache_key: "flights:SFO:NRT:2026-04-10:2:economy",
3  results: [...],
4  cached_at: "2026-03-28T14:22:00Z",
5  expires_at: "2026-03-28T14:37:00Z" // 15-minute TTL
6}

The TTL is aggressive: 15 minutes for flights, 30 minutes for hotels, 1 hour for activities. Flight prices are the most volatile. When the cache expires, the agent must re-search before presenting results or attempting to book.

Conversation History

For multi-turn refinement, the agent needs conversation history. But travel planning conversations are long (30+ messages), so you cannot stuff everything into the LLM context.

Strategy: Keep the last 10 messages in full. For older messages, maintain a running summary:

 
1{
2  summary: "User is planning a 5-day Tokyo trip for 2 in April, budget $3000.
3  Selected United flight SFO->NRT Apr 10 ($890). Rejected Hotel Sunroute
4  (too expensive) and Hotel MyStays (bad location). Prefers Shibuya area.
5  Looking for mid-range hotels $100-150/night.",
6  recent_messages: [last 10 messages]
7}

The summary captures decisions, rejections, and preferences. This is more useful than raw message history because it distills what matters for the next search.

State Transitions

When the user changes direction mid-planning, the agent must handle state transitions cleanly:

  • Destination change (Tokyo to Seoul): Preserve trip-level constraints (dates, budget, travelers). Discard destination-specific search results and selections. If anything was already booked, warn about cancellation costs.
  • Date change: Invalidate all search results (availability changes by date). Preserve destination and preferences. Re-search everything.
  • Budget change: Recalculate remaining budget. If the new budget is lower than what's already selected/booked, flag the conflict: "Your selected flight ($890) and hotel ($820) total $1,710, which exceeds the new $1,500 budget."
Interview Tip

Separate trip-level state (dates, budget, travelers) from destination-specific state (search results, selections). When the user changes destination, trip-level state transfers cleanly while destination state resets.

Preference Learning

The agent should learn from user behavior within a session, not just from explicit statements:

  • User rejects 2 hotels under $80/night → infer minimum price preference, stop showing budget options
  • User always picks morning flights → note preference for future searches
  • User skips all museum activities → deprioritize cultural activities

Implementation: After each user rejection or selection, update a session-level preference model. Use this to re-rank future search results before presenting them. Do not update persistent preferences from a single session; wait for patterns across 3+ sessions.

Booking state machine: the agent progresses through gathering requirements, searching, presenting options, refining, and sequential booking with price change handling

The travel planning agent follows a conversational loop architecture with a state machine governing the planning lifecycle. Unlike a simple request-response system, the agent maintains a planning session that evolves across many turns.

Architecture Overview

The agent is a single LLM-powered controller that selects and calls tools based on conversation context and current state. There is no need for a multi-agent architecture (separate flight agent, hotel agent, etc.) because the planning logic is inherently sequential and interdependent. A flight selection constrains hotel timing, which constrains activity scheduling. Splitting this across agents would require complex inter-agent coordination with no real benefit.

Core components:

  • Conversation Manager: Handles message history, context window management, and the running summary of older messages.
  • State Machine: Tracks the planning lifecycle (gathering requirements, searching, presenting, refining, booking, confirmed). Determines valid next actions.
  • Tool Executor: Dispatches tool calls, manages API rate limits, handles retries and timeouts. Enforces the read/write action boundary.
  • Budget Engine: Tracks allocations, validates that selections fit within budget, and computes remaining budget after each decision.
  • Itinerary Builder: Assembles selected items into a coherent schedule, checks for time conflicts, and validates feasibility.

The Planning State Machine

The agent moves through these states:

 
1[Gathering Requirements] → [Searching] → [Presenting Options]
2↑ ↓
3←──────────── [Refining] ←───────────────
4↓
5[Booking] → [Confirmed]

Gathering Requirements: The agent asks clarifying questions until it has enough constraints to search. Minimum: destination, dates, travelers, budget. This state is active at session start and re-entered when the user changes a fundamental constraint.

Searching: The agent calls search tools. This is a background state; the user sees "Searching for flights..." During this state, the agent determines which searches to run in parallel (flights + hotels when independent) vs sequentially (activities after hotel location is known).

Presenting Options: The agent formats search results into a digestible summary. It does not dump raw API responses. It presents top 3-5 options per category with key attributes (price, duration, rating) and highlights trade-offs ("Flight A is $200 cheaper but has a 4-hour layover").

Refining: The user reacts to presented options. "Cheaper hotel," "earlier flight," "add a food tour." The agent updates constraints and transitions back to Searching for the specific category. This is where most conversation turns happen.

Booking: Triggered when the user says "book it" or "confirm." The agent presents a complete summary (all items, total cost, cancellation policies), requests explicit confirmation, then books sequentially: flights first, then hotels, then activities. Sequential booking matters because if the flight booking fails, there is no point booking the hotel.

Common Pitfall

Book sequentially, not in parallel. If the flight booking fails, there is no trip and the hotel should not be booked. If you book in parallel and the flight fails, you have an orphaned hotel reservation the user may not even know about.

Confirmed: Terminal state. The agent presents the complete itinerary with all confirmation codes, a cost summary, and next steps (check-in reminders, cancellation deadlines).

Why Sequential Booking (Not Parallel)

When the user confirms, why not book flights, hotels, and activities simultaneously? Because bookings have dependencies and rollback requirements:

  1. If the flight booking fails (sold out), there is no trip. Do not book the hotel.
  2. If the hotel booking fails after the flight succeeds, the user has a flight but no accommodation. The agent must inform them and offer alternatives, not just report an error.
  3. If an activity booking fails, the trip still works. The agent can suggest alternatives without rolling back flights or hotels.

Sequential booking with dependency checks is slower (3 API calls in series vs parallel) but dramatically simpler to handle when things go wrong. The latency cost is 5-10 seconds total, which is acceptable for a booking confirmation step.

Context Window Management

Travel planning conversations generate a lot of context: search results, itinerary drafts, budget calculations. The LLM context window must be managed carefully.

Priority allocation:

  1. System prompt and tool definitions: about 800 tokens (fixed)
  2. Current itinerary state: about 500 tokens (grows as selections are made)
  3. Active search results: about 1,000 tokens (the latest search being discussed)
  4. Conversation summary: about 300 tokens (compressed history)
  5. Recent messages: about 2,000 tokens (last 8-10 turns)
  6. User preferences: about 200 tokens

Total: about 4,800 tokens reserved for context. The remaining context window (varies by model) is available for the LLM's response and tool calls.

Old search results that are no longer relevant (e.g., hotel searches from before the user changed the destination) are evicted from context. Only the active search and previous selections remain.

Key Insight

A travel planning agent spends most of its time in the Presenting-Refining loop. Design this loop to be fast: pre-compute trade-off summaries, cache formatted results, and minimize redundant searches when only one constraint changes.

Itinerary timeline: a 3-day trip with activities scheduled around transit times, meals, and check-in/check-out constraints

Let us trace through the concrete execution flows that make up a travel planning session. Each flow shows the sequence of tool calls, state changes, and user interactions.

Flow 1: Initial Planning

The user starts with: "Find me a 5-day trip to Tokyo under $3000 for 2 people in April."

 
11. Parse constraints:
2destination=Tokyo, dates=April (5 days), travelers=2, budget=$3000
3
42. Set trip context:
5budget_tracker.set(total=3000, currency="USD")
6
73. Parallel search (flights + hotels are independent at this stage):
8flight_search({ origin: "SFO", destination: "NRT",
9departure: "2026-04-10", return: "2026-04-15",
10passengers: 2, max_price: 1500 })
11hotel_search({ destination: "Tokyo",
12check_in: "2026-04-10", check_out: "2026-04-15",
13guests: 2, rooms: 1, max_price_per_night: 200 })
14
154. Format and present top 3 flights + top 3 hotels:
16"I found several options. Here are the top flights:
171. United direct, $445/person ($890 total), departs 11am arrives 3pm+1
182. ANA direct, $520/person ($1040 total), departs 5pm arrives 9pm+1
193. JAL via Seoul, $380/person ($760 total), 14hr with layover
20And top hotels: ..."
21
225. State: Gathering Requirements → Searching → Presenting Options

Note how the agent sets a max_price on each search rather than using the full budget. It allocates 50% for flights, 40% for hotels, leaving 10% for activities. These are initial heuristics, not hard limits; the agent adjusts as selections are made.

Flow 2: Refinement

The user says: "The second flight looks good. Can we find a hotel near Shibuya?"

 
11. Lock in flight selection:
2itinerary.flights.selected = ANA flight ($1040 total)
3budget_tracker.deduct(amount=1040, category="flights")
4Remaining budget: $1960
5
62. Constrained hotel search (uses flight arrival to set check-in):
7hotel_search({ destination: "Tokyo, Shibuya",
8check_in: "2026-04-10", // arrival day
9check_out: "2026-04-15",
10guests: 2, rooms: 1,
11max_price_per_night: 250, // $1960 remaining / 5 nights = $392 max, leave room for activities
12location_preference: "near Shibuya station" })
13
143. Present hotel options with budget context:
15"Great choice! With the ANA flight ($1,040), you have $1,960 remaining.
16Here are hotels near Shibuya:
171. Hotel Sequence Shibuya - $145/night ($725 total), 4.2 stars
182. Shibuya Stream Hotel - $195/night ($975 total), 4.5 stars
193. Cerulean Tower - $280/night ($1,400 total), 4.7 stars
20After hotel, you would have $1,235 / $985 / $560 for activities."
21
224. State: Presenting Options → Refining → Searching → Presenting Options

The key here is budget-aware presentation. The agent does not just show prices; it shows how each choice affects the remaining budget for activities. This helps the user make informed trade-offs.

Flow 3: Booking

The user says: "Book the Sequence hotel and the ANA flight. And that Tsukiji food tour we saw."

 
11. Build confirmation summary:
2"Here is your complete trip:
3✈ ANA flight SFO→NRT, Apr 10-15, $1,040
4🏨 Hotel Sequence Shibuya, 5 nights, $725
5🎯 Tsukiji Fish Market Food Tour, Apr 12, $90/person ($180)
6─────────────────────────────
7Total: $1,945 of $3,000 budget
8Remaining: $1,055
9
10Cancellation policies:
11- Flight: free cancellation until Apr 3
12- Hotel: free cancellation until Apr 7
13- Tour: full refund until 24hr before
14
15Confirm booking? (yes/no)"
16
172. User confirms: "yes"
18
193. Sequential booking with dependency checks:
20a. book_flight(ANA, payment_token, travelers) → confirmation: "UA-78234"
21✓ Flight confirmed
22
23b. book_hotel(Sequence, payment_token, travelers) → confirmation: "BK-45612"
24✓ Hotel confirmed
25
26c. book_activity(Tsukiji, payment_token, travelers) → confirmation: "VT-89123"
27✓ Activity confirmed
28
294. Present final itinerary with all confirmation codes
30
315. State: Presenting Options → Booking → Confirmed

Flow 4: Price Change During Booking

Between search and booking, a price changes:

 
11. User confirms booking at presented prices
2
32. Agent attempts to book flight:
4book_flight(ANA, payment_token) → Error: price_changed
5New price: $1,140 (was $1,040, increased by $100)
6
73. Agent does NOT proceed silently. It notifies:
8"The ANA flight price has increased from $1,040 to $1,140 (+$100).
9This brings your total from $1,945 to $2,045.
10You still have room in your $3,000 budget.
11Would you like to:
121. Proceed at the new price ($2,045 total)
132. Search for alternative flights
143. Cancel and keep browsing"
15
164. If user confirms: re-attempt booking at new price
17If user wants alternatives: transition back to Searching for flights

This flow demonstrates why the booking confirmation gate exists. Silently booking at a higher price would violate user trust and could exceed their budget on a tighter trip.

Flow 5: Booking Failure with Rollback

The hotel is sold out after the flight was already booked:

 
11. Flight booked successfully: UA-78234 ✓
22. Hotel booking fails: "No availability for selected dates"
3
43. Agent does NOT automatically cancel the flight. It presents options:
5"Your flight is confirmed (UA-78234), but the Hotel Sequence is no
6longer available for those dates.
7Options:
81. Search for alternative hotels near Shibuya
92. Search for hotels in a different Tokyo area
103. Cancel the flight (free cancellation until Apr 3) and start over"
11
124. The agent keeps the booked flight and continues hotel search

The key principle: never automatically roll back a successful booking. The user wants to keep the flight and find a different hotel. Let them decide.

Interview Tip

When a booking fails partway through, present the user with the current state (what is booked, what failed) and let them decide the next step. Never silently cancel successful bookings to 'clean up' a partial failure.

Budget allocation: the agent splits the total budget across flights, hotels, activities, and buffer, rebalancing when the user changes preferences

The reasoning layer is where the agent goes from "calling APIs" to "planning trips intelligently." This is the difference between a travel search wrapper and an actual planning agent.

Constraint Satisfaction

Every trip is a constraint satisfaction problem. The agent juggles multiple constraints simultaneously:

  • Budget constraint: Total spend must not exceed the stated budget (hard or soft depending on user)
  • Temporal constraints: Activities must fit within available hours, accounting for transit time between locations
  • Availability constraints: Flights, hotels, and activities must be available on the specified dates
  • Preference constraints: User preferences (window seat, 4-star minimum, no hostels) are soft constraints that should be satisfied when possible

The agent handles these through a constrain-then-search approach: before calling any search tool, translate all known constraints into search parameters. This is more efficient than searching broadly and filtering afterward because the APIs return fewer, more relevant results.

Level Expectations

Junior: describe the agent as a search wrapper that calls flight and hotel APIs.

Senior: design the constraint satisfaction engine: budget allocation across categories, temporal reasoning that accounts for transit times and jet lag, and a feasibility checker that catches impossible itineraries before presenting them.

Budget allocation strategy: Rather than splitting the budget equally across categories, the agent uses a priority-weighted allocation:

 
1Default allocation (adjustable):
2Flights: 40-50% (least flexible, prices vary most)
3Hotels: 30-40% (moderate flexibility)
4Activities: 10-20% (most flexible, easiest to cut)

As the user makes selections, the allocation becomes concrete. If a flight deal saves $300, that $300 flows to other categories. The budget tracker recalculates remaining budget and updates max_price parameters for subsequent searches.

Temporal Reasoning

This is where most travel agents fail. The agent must understand time:

Flight arrival and first-day planning: A flight arriving at 11pm means:

  • No dinner plans for that evening
  • Hotel must support late check-in
  • First real activity day is the next morning
  • Jet lag may affect the first morning (the agent could suggest a relaxed morning)

Activity scheduling: The agent builds a daily schedule that respects:

  • Activity duration (a 3-hour cooking class blocks 3 hours plus transit)
  • Transit time between locations (Shibuya to Asakusa is 30-40 minutes by train)
  • Meal times (do not schedule an activity from 12pm-2pm unless lunch is included)
  • Operating hours (temples close at 5pm)
  • User energy levels (do not stack five activities back-to-back)

Implementation: The itinerary builder maintains a time-slot grid for each day:

 
1April 11 (Day 2):
208:00-09:00 Breakfast (hotel)
309:00-09:45 Transit to Tsukiji
409:45-12:00 Tsukiji Fish Market Food Tour
512:00-13:00 Lunch (near Tsukiji)
613:00-13:30 Transit to Senso-ji
713:30-15:30 Senso-ji Temple & Asakusa
815:30-16:00 Transit to Shibuya
916:00-17:30 Free time / shopping
1018:00-19:30 Dinner (Shibuya area)

Transit times are estimated using the Google Maps API or a simplified distance-based heuristic. Buffer time (15-30 minutes) is added between activities to account for delays.

Preference Learning and Conflict Resolution

The agent learns preferences from two sources:

Explicit statements: "I prefer window seats," "no hostels," "we are vegetarian." These are recorded directly in the user preference model.

Behavioral signals: The user's choices and rejections reveal preferences:

  • Rejected 3 hotels under $100 → minimum hotel budget is $100+
  • Always picks morning departures → prefers morning flights
  • Skipped all museum suggestions → deprioritize cultural activities
  • Chose the restaurant with vegetarian options → reinforce dietary preference

Handling conflicting constraints: Users sometimes ask for contradictory things:

"I want a cheap but luxury hotel": The agent should not silently pick one side. Instead, surface the conflict: "Luxury hotels in Shibuya start at $250/night. Your remaining budget allows $150/night. I can show you: (1) mid-range hotels with great reviews near Shibuya, or (2) luxury hotels in a less central area where prices are lower. Which trade-off do you prefer?"

"I want to visit 10 attractions in 2 days": The agent should flag the feasibility issue: "With transit time, each attraction takes about 2-3 hours. In 2 days, you can comfortably visit 5-6. Here is a suggested selection of the top-rated ones. Would you like to extend the trip or prioritize your must-see list?"

When to Present Options vs Ask Questions

The agent needs to decide at each turn: should I search and present results, or should I ask a clarifying question first?

Ask first when: Critical constraints are missing (no destination, no dates, no budget). Constraints are ambiguous ("somewhere warm in Asia" - need to narrow the destination). The user's request is contradictory (surface the conflict before searching).

Search first when: Enough constraints exist to produce useful results. The user gave a specific request ("find flights to Tokyo for April 10-15"). Better to show results and let the user react than to interrogate them with more questions.

The heuristic: if you have destination + approximate dates + budget, search. Otherwise, ask. Users prefer seeing options over answering questions, so err on the side of searching when you have enough to work with.

Key Insight

The best travel agents ask fewer questions and show more options. If the user says 'I want to go somewhere warm for a week under $2000,' search popular warm destinations within budget rather than asking 'Which continent?' The options themselves help the user clarify what they want.

A travel planning agent handles real money and personal information. The safety model must be robust because failures are not just inconvenient - they are expensive.

Payment Handling

The agent must never see, store, or log raw credit card numbers. Payment is handled through tokenization:

 
11. User adds payment method through a secure frontend (Stripe Elements, etc.)
22. Frontend sends card data directly to payment processor (never touches agent server)
33. Payment processor returns a payment_token
44. Agent uses payment_token for booking API calls
55. Agent only sees: last 4 digits, card type, expiration status

This architecture ensures PCI compliance. The agent server never handles cardholder data, so it does not need PCI DSS Level 1 certification. The payment processor (Stripe, Adyen) handles compliance.

Why tokenization is non-negotiable: If a user types "my card number is 4111-1111-1111-1111" in the chat, the agent must not store this in conversation history, logs, or memory. The message should be intercepted before reaching the LLM, the card number redacted, and the user redirected to the secure payment form. A PII detection layer on inbound messages catches this.

Booking Confirmation Flow

Every booking follows a strict confirmation protocol:

 
11. Agent presents booking summary (items, prices, cancellation policies)
22. User explicitly confirms (typed "yes", "confirm", "book it")
33. Agent generates a confirmation_token tied to the specific items and prices
44. If prices changed since step 1, the token is invalid - return to step 1
55. Booking API is called with confirmation_token
66. Result (success/failure) is presented to user

The confirmation_token is price-bound. If the flight price changed between the user saying "confirm" and the API call, the token is invalidated and the user must re-confirm at the new price. This prevents the race condition where prices change during the confirmation flow.

Cancellation Transparency

When presenting booking options, the agent must always show cancellation policies. Users need to know what they are committing to:

  • Free cancellation until X date: Show the date prominently
  • Non-refundable: Flag clearly: "This rate is non-refundable. Once booked, no refunds."
  • Partial refund: Show the refund amount and deadline
  • Different policies per item: A trip has a refundable flight, non-refundable hotel, and 24-hour cancellation for activities. Show each separately.

Rate Limiting

The agent must respect API provider rate limits to avoid being blocked:

 
1Provider rate limits:
2Amadeus (flights): 10 requests/second, 1000/hour
3Booking.com (hotels): 5 requests/second, 500/hour
4Viator (activities): 20 requests/second, 2000/hour
5Google Maps (transit): 50 requests/second

Implementation: Per-provider rate limiters (token bucket algorithm) in the tool executor layer. When a limit is approached, the agent queues requests rather than dropping them. If a provider is temporarily unavailable, the agent should inform the user: "Hotel search is temporarily slow. I will show results as soon as they are available."

Data Privacy

  • No cross-session data sharing without consent: User preferences persist only if the user opts in. Trip details are not shared across users.
  • Data retention: Conversation history is deleted after 30 days. Booking confirmations are retained for 1 year (for customer support). Payment tokens expire after use.
  • Third-party data: Search queries sent to flight/hotel APIs reveal the user's travel plans. The agent should use batch queries or anonymized identifiers where possible to limit tracking.
  • GDPR compliance: Users can request deletion of all their data (preferences, history, bookings). The system must be able to purge a user completely.
Interview Tip

The fastest way to lose user trust is a surprise charge. Always show the total cost and cancellation policy before any booking confirmation, and re-confirm if any price changes during the booking flow.

A travel planning agent that books real trips with real money needs more than uptime monitoring. You need to know whether the agent is actually planning good trips, not just responding quickly.

The Core Problem

Traditional monitoring (HTTP status codes, response latency, error rates) misses the most important failures in a travel agent:

  • The agent suggests a hotel that is 2 hours from the city center - no error, just a bad recommendation
  • The agent builds an itinerary with 6 activities on the first day (arrival day with a late flight) - no crash, just poor temporal reasoning
  • The agent allocates 80% of the budget to flights, leaving barely enough for a hostel - technically works, but terrible experience
  • Search results are cached and stale: prices shown are $200 lower than actual booking price - 200 OK response, but user trust is destroyed

These failures produce valid responses with no error codes. You need planning-quality observability to catch them.

Common Pitfall

Traditional monitoring (latency, error rates, uptime) catches zero percent of the most impactful travel agent failures: bad hotel location, impossible schedules, budget misallocation. You need planning-quality metrics that evaluate the itinerary itself, not just the HTTP responses.

Key Metrics

Conversion metrics:

  • Search-to-selection rate: What percentage of presented options does the user select? Low rate means search results are off-target.
  • Selection-to-booking rate: What percentage of selected items get booked? Low rate means price changes or second thoughts are killing conversions.
  • Session completion rate: What percentage of planning sessions end with at least one booking? Below 20% suggests the agent is not effective.

Planning quality metrics:

  • Budget accuracy: (estimated trip cost at presentation) vs (actual charged amount). If these diverge by more than 5%, the agent is showing stale prices.
  • Itinerary feasibility score: Percentage of generated itineraries with no scheduling conflicts. Target: greater than 90%.
  • Constraint satisfaction rate: Did the final booked trip satisfy all stated constraints (budget, dates, preferences)? Track per-constraint to identify which ones the agent struggles with.

Operational metrics:

  • API response times per provider: Track P50, P95, P99 for each external API. If Amadeus P95 goes from 800ms to 3s, it degrades the user experience even if uptime is 100%.
  • Price change rate: How often does the price change between search and booking? High rates suggest the cache TTL is too long.
  • Session duration: Average time from first message to final booking. Target: under 15 minutes. If average is 30 minutes, the agent is asking too many questions or presenting poor options.

User experience metrics:

  • Refinement cycles: How many times does the user say "cheaper," "different," "something else" before selecting? More than 3 refinements per category suggests the initial search is not well-targeted.
  • Abandonment point: Where in the flow do users drop off? If most leave during hotel selection, the hotel search quality needs work.
  • User satisfaction: Post-booking survey (1-5 stars), or implicit signals (user returns for next trip, user shares the itinerary).

Session Tracing

Every planning session should produce a trace that captures the full decision chain:

 
1trace_id: "t-9a2f1c"
2session_id: "s-4f2a"
3user_id: "u-7821" (hashed)
4
5steps:
6- step: "parse_constraints"
7input: "5-day trip to Tokyo under $3000 for 2 in April"
8output: { destination: "Tokyo", days: 5, budget: 3000, travelers: 2 }
9latency_ms: 180
10
11- step: "flight_search"
12input: { origin: "SFO", dest: "NRT", ... }
13output: { results_count: 12, top_price: 380, bottom_price: 890 }
14api: "amadeus"
15latency_ms: 1240
16cache_hit: false
17
18- step: "hotel_search"
19input: { destination: "Tokyo, Shibuya", ... }
20output: { results_count: 8, top_price: 95, bottom_price: 320 }
21api: "booking.com"
22latency_ms: 890
23cache_hit: false
24
25- step: "user_selection"
26selected: "flight:ANA-direct-1040"
27budget_remaining: 1960
28
29- step: "booking_attempt"
30item: "flight:ANA-direct-1040"
31original_price: 1040
32booking_price: 1040
33price_changed: false
34result: "confirmed"
35confirmation: "UA-78234"
36latency_ms: 3200

This trace lets you debug any session after the fact. If a user complains about a bad itinerary, you can replay the exact sequence of searches, selections, and decisions.

Common Anti-Patterns in Travel Agent Monitoring

Teams building travel agents fall into these monitoring traps:

Monitoring API uptime but not result quality: The Amadeus API returns 200 OK, but the results are stale or incomplete. Traditional uptime monitoring shows green, but users see wrong prices. Fix: validate a sample of search results against direct API calls periodically.

Averaging session metrics: "Average session length is 12 minutes" hides the bimodal distribution: some users finish in 5 minutes (simple trip, knew what they wanted), others take 30+ minutes (complex multi-destination trip). Track percentiles (P25, P50, P75, P90) instead of averages.

Ignoring silent failures: The agent builds an itinerary with a 3-hour gap on Day 3 because no activities were found for that afternoon. It presents the itinerary without mentioning the gap. The user does not notice until they are on the trip. Fix: track "itinerary completeness" - does every day have a reasonable schedule, or are there unexplained gaps?

Not tracking what users do after abandonment: A user abandons the agent and books manually on Kayak. This is the most valuable signal: the agent failed, and you need to know why. Exit surveys or post-session follow-up emails can capture this.

Alerting

Set alerts on these thresholds:

  • Budget accuracy below 95%: Prices shown to users differ significantly from actual booking prices. Indicates stale cache or API pricing bugs.
  • Session completion rate below 15%: The agent is failing to help users complete trips.
  • API P95 latency above 3s for any provider: Degraded user experience.
  • Price change rate above 30%: Cache TTL is too long; users are frequently surprised by price changes.
  • Itinerary feasibility below 85%: The temporal reasoning or constraint propagation has bugs.
Key Insight

The most dangerous failure mode for a travel agent is a bad trip that was technically 'successfully booked.' Monitor planning quality (budget accuracy, schedule feasibility, constraint satisfaction), not just system health.

Price change handling: the agent detects price differences between search and booking, presenting options before charging

Travel planning involves multiple external APIs, volatile pricing, and real money. Things will go wrong. The question is whether the agent handles failures gracefully or leaves the user stranded.

Failure Mode 1: Price Change Between Search and Booking

This is the most common failure. The user confirms a booking at $1,040 but the actual price is now $1,140.

Detection: The booking API returns a price_changed error or the agent compares the booking price against the cached search price before confirming.

Recovery: Never book at the new price without user consent. Present the change clearly: "The price increased from $1,040 to $1,140 (+$100). Your total would be $2,045 instead of $1,945. Confirm at the new price or search for alternatives?" If the new price exceeds the budget, flag that specifically.

Prevention: Use aggressive cache TTLs (15 minutes for flights). Before presenting the booking confirmation, re-validate prices with a lightweight API call. Show the user "prices valid for 15 minutes" so they understand urgency.

Failure Mode 2: API Timeout from Provider

External APIs have variable reliability. Amadeus times out during peak booking periods.

Detection: API call exceeds timeout threshold (e.g., 10 seconds for search, 30 seconds for booking).

Recovery strategy by API type:

  • Search timeout: Retry once. If still failing, inform the user: "Flight search is temporarily slow. Would you like me to try again, or proceed with hotel search first?" Do not block the entire session on one failed search.
  • Booking timeout: This is critical because you do not know if the booking succeeded. Do NOT retry blindly (risk of double booking). Instead: check booking status with a status API call. If status is unknown, inform the user and escalate to manual support with the transaction details.

Fallback: If the primary provider is down, switch to a secondary provider (e.g., Kiwi.com instead of Amadeus for flights). The results may differ slightly, but some results are better than none.

Failure Mode 3: Sold-Out Availability

The user selects a hotel, but by the time they confirm, it is no longer available.

Recovery: "The Hotel Sequence Shibuya is no longer available for your dates. Here are similar options: [re-search with same constraints]. Your other bookings (flight UA-78234) are not affected."

The key: immediately offer alternatives rather than just reporting the failure. The user's momentum (they are ready to book) should be channeled into selecting an alternative, not starting over.

Failure Mode 4: Conflicting Schedules

The agent builds an itinerary with an activity that overlaps with the flight departure.

Detection: The itinerary feasibility checker catches this during the validation step before presenting to the user.

Recovery: If caught before presentation, silently fix it (move the activity to an earlier time slot or a different day). If caught after the user selects the conflicting schedule, explain: "The Tsukiji tour runs until 2pm, but your flight departs at 1pm. I can move the tour to April 11 instead, or find an earlier morning option."

Failure Mode 5: User Changes Destination Mid-Planning

The user has been planning a Tokyo trip for 15 minutes and says "actually, what about Barcelona?"

Recovery: This is not a failure but a significant state transition:

  1. Preserve trip-level state: dates, budget, travelers, preferences
  2. Discard destination-specific state: all Tokyo searches, selections
  3. If anything is booked, warn about cancellation implications before proceeding
  4. Transition to Gathering Requirements state to confirm the preserved constraints still apply to Barcelona
  5. Begin searching for Barcelona

The agent should not express frustration or make the user feel bad for changing their mind. This is normal travel planning behavior.

Failure Mode 6: LLM Reasoning Error

The LLM misinterprets a user request or makes a planning mistake:

  • Misunderstanding "2 people" as 2 rooms instead of 1 room for 2 guests
  • Calculating the wrong remaining budget
  • Suggesting an activity in the wrong city

Prevention: Use structured output for critical calculations (budget math should use the budget tracker tool, not LLM arithmetic). Validate LLM outputs against the itinerary state before presenting to the user.

Recovery: If the user catches the error ("No, I said 1 room for 2 people"), acknowledge, correct the state, and re-search. Log the error for prompt improvement.

Degraded Mode Operation

When external services degrade but do not fail completely, the agent should adjust its behavior rather than showing errors:

  • Slow API response: If Amadeus is responding in 6 seconds instead of the usual 2, show a progress indicator ("Searching flights... this is taking a bit longer than usual") rather than timing out.
  • Partial results: If the hotel API returns only 3 results instead of the usual 15, present them but note: "Showing limited results. Some hotels may not be available right now. Try again in a few minutes for more options."
  • Stale cache: If the cache cannot be refreshed (API down), serve cached results but mark them: "These prices are from 30 minutes ago and may have changed. I will verify the exact price before booking."
  • Provider outage: If one provider is down entirely (e.g., Booking.com), switch to a fallback provider (e.g., Hotels.com) and inform the user: "I am searching an alternative hotel provider due to temporary unavailability."

The principle: partial service is better than no service. Degrade gracefully and communicate clearly about any limitations.

Interview Tip

The golden rule of failure recovery: never leave the user without a next step. Every error message should include what the agent will do next or offer options for how to proceed.

How do you know if the travel planning agent is actually good? User satisfaction is the north star, but you need quantifiable metrics to measure progress and catch regressions.

Evaluation Framework

1. Itinerary Quality

The primary output of the agent is an itinerary. Evaluate it across these dimensions:

  • Constraint satisfaction: Did the final trip meet all stated constraints? Track per-constraint: budget (within 5%?), dates (correct?), travelers (right number?), preferences (window seat booked? No hostels?). Target: 95%+ satisfaction across all constraints.
  • Schedule feasibility: Are all activities schedulable without conflicts? No overlapping events, reasonable transit times, meals accounted for. Automated check: run the feasibility checker on every generated itinerary.
  • Logical ordering: Does the itinerary make sense geographically (not zigzagging across the city)? Temporally (not scheduling a sunset cruise at 10am)? Contextually (not planning outdoor activities on a known rainy day)?

2. Booking Success Rate

  • Search-to-booking conversion: What percentage of planning sessions result in at least one booking? Industry benchmark for travel sites: 2-3%. An agent should achieve 15-25% because it actively helps the user through the process.
  • Booking failure rate: What percentage of booking attempts fail? Track by reason: price change, sold out, API error, user cancellation. Each reason drives a different fix.
  • Price accuracy: How often does the booked price match the presented price? Target: 95%+ match rate.

3. User Satisfaction

  • Post-booking survey: "How would you rate your planning experience?" (1-5 stars). Target: 4.2+ average.
  • Return rate: Do users come back for their next trip? The strongest signal of satisfaction.
  • Recommendation rate: Do users share the agent with others?
  • Comparison to manual: "Was this faster/easier than planning the trip yourself?" Target: 80%+ say yes.

4. Cost Efficiency

  • Agent cost per booking: LLM tokens + API calls + infrastructure, divided by successful bookings. Track to ensure the agent is economically viable.
  • User savings: Does the agent find better deals than the user would find manually? Measure by comparing agent-found prices to average prices on comparison sites.

Automated Testing

Build a test suite of synthetic planning scenarios:

 
1Scenario 1: "2 people, Tokyo, 5 days, $3000, April"
2Expected: Finds flights under $600/person, hotel under $200/night, 3+ activities
3Validates: Budget allocation, search quality, itinerary feasibility
4
5Scenario 2: "Solo traveler, Paris, 3 days, $1500, flexible dates"
6Expected: Suggests cheapest date range, finds central hotel, suggests iconic activities
7Validates: Date flexibility reasoning, solo traveler handling
8
9Scenario 3: "Family of 4, beach destination, 7 days, $5000"
10Expected: Suggests destinations, finds family-friendly hotels, kid-appropriate activities
11Validates: Open-ended destination handling, family-specific preferences
12
13Scenario 4: "Change destination mid-planning from Tokyo to Seoul"
14Expected: Preserves constraints, discards Tokyo results, searches Seoul correctly
15Validates: State transition handling

Run these nightly. Flag any scenario where the agent fails to produce a valid itinerary.

Comparison to Manual Planning

The ultimate benchmark: is the agent faster and better than doing it yourself?

  • Time: Average planning session with the agent: 12-15 minutes. Manual planning (browsing multiple sites, comparing options, building an itinerary): 2-3 hours. The agent should be 8-10x faster.
  • Cost: The agent should find comparable or better prices because it searches multiple providers simultaneously and can spot deals the user misses.
  • Quality: Manually planned trips have scheduling gaps (no transit time budgeted), budget overruns (forgot to account for activities), and missed opportunities (did not know about a highly-rated activity nearby). The agent catches these systematically.
Key Insight

The agent does not just save time on searching. It eliminates the cognitive load of juggling constraints: budget limits, transit times, operating hours, time zones, and meal schedules. This is why an agent outperforms manual planning even when the user is an experienced traveler.

Future Directions

  • Multi-modal input: Let users share screenshots of travel inspiration ("plan a trip like this Instagram post"), upload documents (conference schedule to plan around), or share location pins from maps. The agent extracts constraints from visual and document inputs.
  • Proactive re-planning: After booking, monitor for changes. If a flight is cancelled, the agent proactively notifies the user and presents rebooking options. If a hotel drops in price, offer a rebooking at the lower rate. If weather forecasts change dramatically, suggest itinerary adjustments.
  • Group coordination: Multiple users collaborate on a shared trip. The agent mediates preferences, manages a shared budget, and coordinates confirmations across the group. The key challenge is conflict resolution when participants have different preferences.
  • Loyalty program integration: Connect with airline and hotel loyalty programs. Factor in points and status benefits when searching. "You have 50,000 United miles. Using them on this flight saves $400 and you still earn status qualifying miles."
  • Post-trip learning: After the trip, ask for feedback on each element. Was the hotel as expected? Was the activity worth it? Were the restaurants good? Feed this back into the preference model and recommendation engine. Over time, the agent learns not just what the user says they want, but what they actually enjoy.
  • Real-time itinerary adjustments: During the trip, the agent monitors live conditions (transit delays, weather changes, venue closures) and suggests real-time alternatives. "The Tsukiji market is closed today for a holiday. Here are two alternative food experiences nearby."
Try this problem yourself

Reading a solution is not the same as producing one under interview pressure. Design it on the whiteboard and get scored feedback.


Markdown supported

0%

Editorial Solution

Agent requirements

Why a Conversational Agent Instead of a Form-Based Search?

Agent Objective

Key Capabilities

Autonomy and Constraints

Cost and Latency Constraints

Tool & action design

Tool Inventory

Read vs Write Actions

Tool Selection Strategy

Memory & state design

Memory Layers

Conversation History

State Transitions

Preference Learning

Agent architecture

Architecture Overview

The Planning State Machine

Why Sequential Booking (Not Parallel)

Context Window Management

Execution flows

Flow 1: Initial Planning

Flow 2: Refinement

Flow 3: Booking

Flow 4: Price Change During Booking

Flow 5: Booking Failure with Rollback

Core reasoning design

Constraint Satisfaction

Temporal Reasoning

Preference Learning and Conflict Resolution

When to Present Options vs Ask Questions

Safety & permission model

Payment Handling

Booking Confirmation Flow

Cancellation Transparency

Rate Limiting

Data Privacy

Observability & monitoring

The Core Problem

Key Metrics

Session Tracing

Common Anti-Patterns in Travel Agent Monitoring

Alerting

Failure modes & recovery

Failure Mode 1: Price Change Between Search and Booking

Failure Mode 2: API Timeout from Provider

Failure Mode 3: Sold-Out Availability

Failure Mode 4: Conflicting Schedules

Failure Mode 5: User Changes Destination Mid-Planning

Failure Mode 6: LLM Reasoning Error

Degraded Mode Operation

Evaluation & future

Evaluation Framework

Automated Testing

Comparison to Manual Planning

Future Directions

Table of Contents

Agent requirements

Why a Conversational Agent Instead of a Form-Based Search?

Agent Objective

Key Capabilities

Autonomy and Constraints

Cost and Latency Constraints

Tool & action design

Tool Inventory

Read vs Write Actions

Tool Selection Strategy

Memory & state design

Memory Layers

Conversation History

State Transitions

Preference Learning

Agent architecture

Architecture Overview

The Planning State Machine

Why Sequential Booking (Not Parallel)

Context Window Management

Execution flows

Flow 1: Initial Planning

Flow 2: Refinement

Flow 3: Booking

Flow 4: Price Change During Booking

Flow 5: Booking Failure with Rollback

Core reasoning design

Constraint Satisfaction

Temporal Reasoning

Preference Learning and Conflict Resolution

When to Present Options vs Ask Questions

Safety & permission model

Payment Handling

Booking Confirmation Flow

Cancellation Transparency

Rate Limiting

Data Privacy

Observability & monitoring

The Core Problem

Key Metrics

Session Tracing

Common Anti-Patterns in Travel Agent Monitoring

Alerting

Failure modes & recovery

Failure Mode 1: Price Change Between Search and Booking

Failure Mode 2: API Timeout from Provider

Failure Mode 3: Sold-Out Availability

Failure Mode 4: Conflicting Schedules

Failure Mode 5: User Changes Destination Mid-Planning

Failure Mode 6: LLM Reasoning Error

Degraded Mode Operation

Evaluation & future

Evaluation Framework

Automated Testing

Comparison to Manual Planning

Future Directions