Inspiration

Airline customer support has always frustrated me — rigid menus, long wait times, and repetitive questions that any intelligent system should handle automatically. I wanted to build a real autonomous agent, not just a scripted chatbot. The idea of combining multiple LLMs — each doing what it does best — in a single pipeline felt like the right way to simulate a real enterprise AI workflow.

What it does

Swiss Airlines AI Assistant autonomously handles the complete airline customer service workflow in plain English — flight search, hotel booking, car rentals, excursion recommendations, and policy queries — with zero human involvement. It detects user intent, routes to the correct specialist agent, executes real bookings saved to a database with ticket numbers, and responds naturally. Any passenger ID is auto-registered — no authentication wall.

How we built it

Built around a hybrid 3-LLM architecture:

  • OpenAI GPT-4o-mini — intent classification via structured JSON tool calling, zero keyword matching
  • DeepSeek R1 via Ollama — runs 100% locally for natural language responses, fully private
  • Google Gemini 1.5 Flash — optional response refinement layer
  • FAISS + OpenAI embeddings — RAG pipeline for airline policy lookups
  • Tavily API — live web search for real-time flight status

Each domain has a specialist agent (flights, hotels, cars, excursions, policy) orchestrated by a primary assistant that manages full conversation state. A custom BookingSimulator writes every booking to a JSON database with generated ticket numbers, seat assignments, and confirmation records.

Challenges we ran into

1. Token explosion across multiple LLMs Running intent classification, conversation generation, embeddings, and web search simultaneously burned tokens incredibly fast — the conversational layer alone consumed more than everything else combined. Solution: hybrid architecture. DeepSeek R1 runs locally via Ollama at zero API cost. OpenAI is used only for intent classification and embeddings where accuracy matters most.

2. Hallucination from web search data mixing After adding Tavily, the bot started mixing live web results with database data — inventing flight details that didn't exist. Solution: a strict system prompt that instructs DeepSeek to use only the structured tool results passed in context, with web and database results clearly labeled and separated.

3. IATA code recognition — the location parser problem The bot worked with airport codes like ZRH or JFK but completely failed for city names like "Zurich" or "New York". Solution: built a custom LocationParser class that loads the full airport database, builds a city→IATA reverse lookup, handles aliases ("NYC"/"Manhattan" → JFK), uses difflib fuzzy matching for typos, and extracts locations from natural phrases like "flights from Zurich to New York".

Accomplishments that we're proud of

  • Zero keyword routing anywhere in the codebase — 100% LLM-driven intent detection
  • A fully working booking engine that writes real records with ticket numbers to a persistent database
  • A custom IATA location parser that resolves city names, aliases, and fuzzy typos
  • A hybrid LLM pipeline that cuts token costs while improving response quality
  • Full conversation state persistence — passenger ID, last flight, last booking — across every message

What we learned

  • How to design a multi-agent state machine where each agent is a specialist and the orchestrator manages routing and context
  • The real cost of token management at scale — and why hybrid local/cloud LLM architectures are a genuinely better design pattern
  • How to build a production-grade RAG pipeline with FAISS — chunking, embedding, nearest-neighbor search, and context injection
  • That prompt engineering directly controls hallucination — the difference between a grounded model and one that makes things up is almost entirely in prompt structure
  • That location parsing is harder than it looks — fuzzy matching, aliases, regex, and database lookups all need to work together

What's next for Swiss Airlines AI Assistant

  • Connect to real airline APIs (Amadeus, Sabre) for live flight data
  • Add voice interface for hands-free booking
  • Multi-language support for international passengers
  • Deploy as a production SaaS with airline white-labeling
  • Extend the multi-agent architecture to other travel verticals — cruise lines, train networks, hotel chains

Built With

  • deepseek-r1
  • faiss
  • google-gemini-1.5-flash
  • json
  • langchain
  • ollama
  • openai-gpt-4o-mini
  • python
  • streamlit
  • tavily-api
Share this project:

Updates