How the AI works
The AI copilot is read-only and context-aware. It analyzes your trip data (destination, dates, travelers, budget) and the current page you’re viewing to provide targeted recommendations. It never modifies your bookings or expenses—only you can make those changes.The AI assistant is available on every trip page. Open the AI panel from the bottom-right corner to start a conversation.
Page-aware assistance
The copilot adapts its guidance based on which page you’re viewing:Overview page
Overview page
- Suggests the highest-impact next action based on trip progress
- Identifies missing essentials (flights, hotels, budget)
- Recommends prioritized checklist items
Flights page
Flights page
- Provides live flight status when you share a flight number and date (e.g., “AC123 2025-06-15”)
- Compares price-time tradeoffs for different routes
- Flags tight connection risks
Transit page
Transit page
- Fetches bus and rail options when you use the format “from Berlin to Munich”
- Compares reliability, duration, and transfers
- Recommends best route based on your trip timeline
Finance page
Finance page
- Analyzes budget adherence and major cost drivers
- Suggests practical cutback levers when over budget
- Quantifies impact of daily spending pace
Itinerary page
Itinerary page
- Proposes realistic day sequencing to reduce backtracking
- Flags overpacked days and suggests buffer time
- Validates feasibility of planned activities
Group page
Group page
- Recommends decisions that reduce coordination overhead
- Suggests explicit owner and deadline for next actions
- Helps clarify approval workflows
Agent planner (trip creation)
When you start a new trip, the Agent planner helps you build an initial draft through conversation.Share trip basics
Tell the agent your destination, travel dates (or month), traveler count, and must-do experiences.Example: “Planning a solo trip to Tokyo in April, budget around $3000, want to visit museums and try authentic ramen.”
Review draft plan
The agent generates a structured draft including:
- Destination and country
- Start and end dates (inferred from conversation)
- Traveler count
- Budget estimate
- Activities list
- Day-by-day itinerary skeleton
PlannerDraft in the response.What the agent infers
The planner extracts structured data from your conversation:- Destination: Inferred from phrases like “to Paris” or “in Barcelona”
- Dates: Detects YYYY-MM-DD patterns or month references
- Travelers: Recognizes “solo”, “2 people”, “family of 4”
- Budget: Parses amounts like “budget $2000” or “spend 1500”
- Activities: Pulls from must-do experiences you mention
AI system prompts
TripLoom uses model selection to choose the appropriate LLM based on prompt complexity and conversation length. The system prompt is built dynamically for each page.Core principles
Frombackend/internal/ai/prompt.go:10-31:
- Read-only assistant: Never claims to modify bookings, itinerary, or finance data
- Transparent about uncertainty: States when data is missing, stale, or degraded
- Page-aware guidance: Uses
pageKeyto provide contextual recommendations - Concise and decision-oriented: Focuses on tradeoffs and next steps
- Natural tone: Avoids robotic templates, matches user energy
Degraded mode
When live data sources fail (e.g., flight status API is down), the AI enters degraded mode. It continues to provide guidance but prepends a confidence note and avoids overconfident language. Example fallback frombackend/internal/ai/service.go:258-278:
Real-time context refresh
The AI can fetch live data to enhance recommendations. This happens automatically when you enable refresh mode in your chat request.Supported real-time sources
Frombackend/internal/ai/service.go:322-369:
| Page Key | Source | Required Input | Example |
|---|---|---|---|
flights | next_flight_status | Flight number + date | ”AA1234 2025-06-15” |
transit | next_transit_suggest | Origin + destination | ”from Berlin to Munich” |
finance | finance_guardrail | Current trip totals | Auto-computed |
itinerary | itinerary_risk | Current snapshot | Auto-derived |
If required inputs are missing, the AI skips the real-time fetch and provides guidance based on trip context alone.
Suggested actions
Every AI response includes suggested actions tailored to the current page. These are hardcoded recommendations frombackend/internal/ai/service.go:394-405.
Examples:
- Flights: “Share exact flight number and date for live status”, “Compare price-time tradeoff before selecting”
- Transit: “Provide ‘from X to Y’ for route options”, “Save top route to itinerary notes”
- Finance: “Review highest-spend category”, “Set per-day budget target”
Using the AI panel
The AI panel is accessible from every trip page infrontend/components/trips/trip-ai-panel.tsx.
Open the panel
Click the AI icon in the bottom-right corner of any trip page. The panel slides in from the right.
Ask a question
Type your question or request in the text area. Use Cmd+Enter (Mac) or Ctrl+Enter (Windows) to send.Example prompts:
- “What is my next best step?”
- “Compare FlixBus vs rail from Berlin to Munich”
- “Am I over budget?”
Review context used
After the AI responds, expand the Context used section to see which data sources were consulted:
trip_db_context: Core trip data (destination, dates, budget)next_flight_status: Live flight status (if applicable)next_transit_suggest: Live transit options (if applicable)
ok, error, skipped_missing_inputs) and fetch timestamp.Context passed to AI
Fromfrontend/components/trips/trip-ai-panel.tsx:40-46, the AI receives:
tripId: Current trip identifierpageKey: Current page (e.g., “flights”, “finance”)pageContext: Page-specific metadata (title, subtitle, path, details)messages: Full conversation historyrefresh: Boolean to enable real-time data fetching
Best practices
- Be specific: Include flight numbers, dates, and route details for best results
- Ask for tradeoffs: Instead of “best flight”, try “compare price vs duration for morning flights”
- Check sources: Review the Context used section to understand data freshness
- Use natural language: The AI is trained to handle conversational input, not rigid commands
- Iterate: Follow up with clarifying questions to refine recommendations
Limitations
- Read-only: The AI cannot modify your trip data, bookings, or expenses
- No booking confirmations: It will never claim to have made a reservation or purchase
- Live data availability: Real-time sources may be unavailable (degraded mode activates automatically)
- Token limits: Very long conversations may hit model context limits
Technical implementation
The AI service is implemented in Go atbackend/internal/ai/service.go and uses:
- Model selection:
ModelSelectorchooses the LLM based on prompt characteristics - Conversation storage: All messages are persisted in the database via
AIRepository - Audit logging: Every AI interaction is logged with
tripId,pageKey,model, anddegradedstatus - Context snapshots: Page context is saved to enable future conversation replay
frontend/components/trips/trip-ai-panel.tsx handles:
- Real-time streaming (if enabled)
- Message display with role-based styling
- Error handling and retry logic
- Source attribution and timestamp formatting