AI-Powered Travel Assistant for Rail and Coach Platform

trainline · Tech · 2025 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Rail and coach travel support

Trainline needed to support customers during travel disruptions and long-tail journey questions at a scale that phone or web support could not cover, without trapping users in a deterministic chatbot that only handled a narrow FAQ set.

Constraints:

Architecture

Trainline built a production travel assistant around a single central orchestrator agent working in a loop with tools. The first proof of concept used a vector database, terms-and-conditions tool, and mock refund endpoint to test whether the agent could route questions correctly. The production system expanded to information retrieval over about 700,000 Trainline-curated pages, realtime train and station APIs, terms and conditions, refund/action tools, guardrail checks at input and output, contextual grounding checks, a retrieval-judge LLM, clean prompts, and seamless human handoff for sensitive or unsupported situations.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  free-text-chat-ui["free-text-chat-ui"] --> central-orchestrator-agent["central-orchestrator-agent"]
  free-text-chat-ui["free-text-chat-ui"] --> human-support-handoff["human-support-handoff"]
  central-orchestrator-agent["central-orchestrator-agent"] --> terms-and-conditions-tool["terms-and-conditions-tool"]
  central-orchestrator-agent["central-orchestrator-agent"] --> information-retrieval-service["information-retrieval-service"]
  central-orchestrator-agent["central-orchestrator-agent"] --> realtime-train-api["realtime-train-api"]
  central-orchestrator-agent["central-orchestrator-agent"] --> refund-action-tool["refund-action-tool"]
  central-orchestrator-agent["central-orchestrator-agent"] --> guardrail-layer["guardrail-layer"]
  central-orchestrator-agent["central-orchestrator-agent"] --> human-support-handoff["human-support-handoff"]
  information-retrieval-service["information-retrieval-service"] --> curated-content-vector-store["curated-content-vector-store"]
  information-retrieval-service["information-retrieval-service"] --> retrieval-judge-llm["retrieval-judge-llm"]
  guardrail-layer["guardrail-layer"] --> human-support-handoff["human-support-handoff"]
  evaluation-and-monitoring-harness["evaluation-and-monitoring-harness"] --> central-orchestrator-agent["central-orchestrator-agent"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
free-text-chat-ui Open customer interface that lets travelers ask anything during or around their journey. central-orchestrator-agent, human-support-handoff
central-orchestrator-agent Looping agent that manages customer inputs, calls tools, decides when it is done, and emits responses. free-text-chat-ui, terms-and-conditions-tool, information-retrieval-service, realtime-train-api, refund-action-tool, guardrail-layer, human-support-handoff
terms-and-conditions-tool Policy lookup tool for ticket parameters, operator terms, and refund constraints. central-orchestrator-agent
information-retrieval-service RAG service over processed Trainline content, with an LLM judge that filters relevance before passing summarized context back. central-orchestrator-agent, curated-content-vector-store, retrieval-judge-llm
curated-content-vector-store Vector database containing processed Trainline support and SEO material. information-retrieval-service
retrieval-judge-llm Specialized LLM inside retrieval that determines whether candidate information is relevant to the customer problem. information-retrieval-service
realtime-train-api Realtime train, station, disruption, and journey-state data source for current travel questions. central-orchestrator-agent
refund-action-tool Action tool for refund workflows, initially mocked in the proof of concept and later integrated. central-orchestrator-agent
guardrail-layer Input/output guardrails, prompt directives, validation checks, and contextual grounding controls. central-orchestrator-agent, human-support-handoff
human-support-handoff Escalation path for unsupported, sensitive, or high-empathy cases while preserving chat context. free-text-chat-ui, central-orchestrator-agent, guardrail-layer
evaluation-and-monitoring-harness Human eval, red teaming, semantic checks, Braintrust monitoring, and synthetic realtime ticket simulation. central-orchestrator-agent

Data flow

A customer opens free-text chat and asks a travel question. The central orchestrator receives the conversation and decides which tool to call: terms and conditions, information retrieval, realtime train data, station data, refund/action flows, or human handoff. The retrieval service summarizes only relevant context back to the orchestrator. Guardrail checks run on the way in and out, including contextual grounding against tool-provided information. If the assistant cannot help safely, the chat is handed to a human with the conversation context.

4 supporting quotes
“a single central orchestrator with tools around it. They could be agents or they could be simple API calls”transcript, stated
“Nope. It was an agent working in a loop deciding where when it was done.”transcript, stated
“we have a real time API and the assistant can in real time call this API and get exact positioning of the train”transcript, stated
“The G rail check out does a contextual grounding check to check that the assistance response is actually based on the information it's been given”transcript, stated

Why this architecture

Trainline chose a fully agentic orchestrator because customers needed flexible support for a long tail of unpredictable travel questions rather than a deterministic decision tree. Separation of concerns kept tools and services maintainable. Guardrails, retrieval judging, and human handoff reduced safety risk, while realtime APIs allowed the assistant to answer live journey questions rather than static FAQs.

4 supporting quotes
“customers were concerned with the idea of a chatbot that was very deterministic that could only answer a certain subset of questions.”transcript, stated
“we wanted to stick to good engineer principles have a separation of concerns both in terms of the way we structured the tools and structured the agents”transcript, stated
“We have a guardrail check out. The G rail check out does a contextual grounding check to check that the assistance response is actually based on the information it's”transcript, stated
“if we weren't able to help a customer, we could hand over to a human agent really seamlessly.”transcript, stated

Models used: LLM · RAG · vector database · LLM-as-judge · Braintrust · AWS inference routing

Scale

Alternatives considered (roads not taken)

Deterministic chatbot or decision tree

Rejected because: Users expected unique answers and would lose trust if the assistant only handled a narrow subset of questions.

“customers were concerned with the idea of a chatbot that was very deterministic that could only answer a certain subset of questions.”transcript, stated
“we actually have to be able to answer unique questions.”transcript, stated

Human support for every UK customer

Rejected because: Trainline could not put 18 million UK customers at the end of the phone, so AI offered 24/7 scalable support.

“We can't have 18 million people at the end of the phone although that would be really nice to support them.”transcript, stated
“we knew that with AI that we could be really scalable and we could be available to customers 247.”transcript, stated

Static FAQ/terms-only assistant

Rejected because: The system needed realtime train position, station, disruption, and action tools, not just terms and conditions.

“the early days we wanted to cover the frequently asked questions.”transcript, stated
“it's also real-time information. So we have a real time API and the assistant can in real time call this API”transcript, stated

Optimize only for fastest response

Rejected because: The team accepted several seconds of latency because a correct answer was more valuable than a wrong instant response.

“if a customer has to wait an extra 5 seconds to get the right answer is that the end of work probably not.”transcript, stated
“If we give them a wrong answer within 1 second that's not very useful.”transcript, stated

Patterns

multi-agent-orchestration (agent architecture)

A central loop orchestrator manages input, output, and tool calls, with tools that can themselves be agents or APIs.

“a single central orchestrator with tools around it. They could be agents or they could be simple API calls”transcript, stated

rag-retrieval (retrieval)

Trainline processes hundreds of thousands of curated pages into a vector database for assistant retrieval.

“we do some clever processing and we put that into a vector database.”transcript, stated

llm-as-judge (evaluation)

A specialized LLM judges retrieved information relevance before summarized context reaches the orchestrator, and another simulator helps test realtime ticket scenarios.

“we have an specific LLM there that is basically almost a judge in a sense it takes the information in considers if it's actually relevant to the problem”transcript, stated
“a judge that we essentially specialize to pretend to be our customers.”transcript, stated

guardrails-io-filtering (safety)

The assistant uses input/output guardrails, contextual grounding, prompts, tool validation checks, and human escalation.

“You can do it in a prompt. You can build an external guardrail. You can change the structure of the tools you use. You can add validation checks on the tools you use. We do all of those things.”transcript, stated

human-in-the-loop-gate (safety)

Unsupported or sensitive cases are handed to human agents inside the same chat context.

“if we weren't able to help a customer, we could hand over to a human agent really seamlessly.”transcript, stated
“if people say I need a refund because someone has passed away or I'm really ill or things like that, just straight away we're handing over to a human agent”transcript, stated

Tradeoffs

Expose open free-text chat.

Chose Unprompted open chat over Heavily guided prompts and button flows.

Rationale: Open chat built trust that the assistant was not just a decision tree and generated valuable product discovery data.

“So I just wanted to say you were saying that you could ask anything that was actually a conscious design choice when we were looking into the UX to have just an open free text chat that people could type anything in.”transcript, stated
“it's really valuable data for us as product managers.”transcript, stated

Launch with an agent-plus-tools architecture early.

Chose Single orchestrator agent loop from the start over Wait for agent patterns to mature or build only deterministic workflows.

Rationale: The team needed to validate whether LLM reasoning could choose tools and handle diverse customer situations at scale.

“So you have this, you started from the very beginning with kind of an agents agent plus tools architecture.”transcript, stated
“We we we took a very bold approach”transcript, stated

Prioritize correctness over lowest latency.

Chose Five-to-six second average response with better answer quality over One-second incorrect answers.

Rationale: For travel support, a slightly slower correct answer is more useful than an instant wrong answer.

“If we give them a wrong answer within 1 second that's not very useful.”transcript, stated

Gotchas (what bit them)

Open-ended travel chat can loop or call tools indefinitely.

Root cause: A central agent loop may keep reasoning and trying tools if it cannot satisfy an objective.

Resolution: Use guardrails, validation checks, prompt directives, and human handoff rather than relying only on the loop.

“We gave it the directive to help the customer and at times it was very persistent in that and would not give up and eventually get stuck in a loop

of keep trying to call tools to achieve its objective.”transcript, stated

“it's a very kind of open graph and it allows for a lot of creativity but within the safety of several layers of guardrail checks.”transcript, stated

Latency is dominated by reasoning calls.

Root cause: Each reasoning call waits for model output before the next tool or step can run.

Resolution: Optimize inference routing with AWS and manage the user's expectation with product UX while preserving answer quality.

“the bottleneck of that is like the number of reasoning calls”transcript, stated
“using different I guess ways of doing inference like being able to route to different different servers across the EU and UK.”transcript, stated

Evaluation is harder than normal model testing.

Root cause: A general-purpose assistant can receive a million and one questions tied to realtime ticket and journey context.

Resolution: Combine human evaluation, red teaming, semantic checks, monitoring, and synthetic realtime ticket simulations.

3 supporting quotes
“evaluation has always been and is in my opinion the most challenging area.”transcript, stated
“customers could ask a million and one questions”transcript, stated
“red teaming where you unleash your chaos and try and break the system”transcript, stated

Evaluation

Trainline evaluates the assistant through human evaluation, small-scale automated semantic checks, third-party and internal red teaming, groundedness/relevance/helpfulness/consistency principles, Braintrust monitoring, and a synthetic realtime ticket simulator that generates customer-like queries against current train-ticket context.

Metrics: groundedness · factuality · relevance · helpfulness · consistency · toxicity/safety · latency · human handoff quality · synthetic realtime ticket scenario pass/fail

4 supporting quotes
“the first was like groundedness or factuality. Is it offering factual responses? The second was is it offering relevant responses? Are the responses helpful? And then finally, are they consistent?”transcript, stated
“we first leaned on human evaluation and what I'd call smallcale automated tests”transcript, stated
“We did outsource some bread teaming. We felt that like checking for toxicity check making the system safe was the most important.”transcript, stated
“we can just utilize all of the judges we've got in there and the monitoring.”transcript, stated

Outcomes

Trainline serves more than 27 million customers across 40 countries, including 18 million in the UK, and the assistant now operates over hundreds of thousands of monthly conversations.

4 supporting quotes
“we went from zero to delivery into production in front of our customers in in roughly February 2025.”transcript, stated
“We since expanded that to about 700,000 pages of train line curated material”transcript, stated
“We've got 300,000 people having conversations every month.”transcript, stated
“we've managed to get latency actually down to I think last time I checked the average was about five to six seconds”transcript, stated