Development of An Intelligent Travel Chatbot
Development of An Intelligent Travel Chatbot
Abstract—In the context of increasing travel demand, tourists and efficiently. This chatbot is built on the DeepSeek R1
frequently face challenges in finding reliable and suitable infor- model, an advanced artificial intelligence platform, combined
mation when planning trips to new destinations. The absence of a with the K-Nearest Neighbors (KNN) algorithm to analyze
flexible, support tool creates a significant barrier, affecting their
overall experience. The primary objective is to facilitate easier and filter relevant information based on two main factors: cost
and more effective trip planning. This proposal puts forward and the user’s personal preferences. This combination enables
an intelligent chatbot system for tourism based on state-of- the chatbot to provide personalized travel recommendations,
the-art Retrieval-Augmented Generation (RAG) architecture, a helping users save time and have experiences that better align
hybrid framework designed to mitigate the factual unreliability with their desires. The project not only meets practical needs
of standalone language models. This architecture strategically
synergizes the generative capabilities of the DeepSeek R1 large but also contributes to the application of modern technologies
language model with a robust K-Nearest Neighbors (k-NN) in the tourism industry.
retrieval algorithm. To specialize the model for the domain,
the DeepSeek R1 generator was fine-tuned on a meticulously II. R ELATED W ORK
curated dataset of 1,000 question-answer pairs, covering key A. Evolution of Intelligent Agents
aspects of Vietnamese tourism such as destinations, activities,
and local costs, thereby enhancing its ability to produce fluent The origin of intelligent conversational agents, or chatbots,
and contextually aware dialogue. In parallel, the k-NN retriever developed in the 1960s by Joseph Weizenbaum’s ELIZA.
component actively searches a dedicated knowledge base, filtering This pioneering system was designed to simulate mental
and retrieving the most relevant informational chunks based on health–focused dialogue, using a constrained knowledge base
multi-faceted criteria including user-defined cost constraints and and predefined conversational pathways to navigate or prevent
travel preferences. This knowledge-grounding process ensures
that the final output is not only conversational but also factually conversational impasses. While foundational, early iterations
accurate. The resulting system is a sophisticated chatbot capable like ELIZA were characterized by their reliance on scripted re-
of delivering highly personalized recommendations and precise sponses, offering no real understanding or adaptability beyond
answers, providing a practical 24/7 support tool that significantly predefined responses. Another early example was PARRY,
enhances user satisfaction and showcases a scalable application developed in 1972 by psychiatrist Kenneth Colby, which
of modern AI in the tourism sector
Index Terms—Chatbot, Travel, Tourism, Vietnamese NLP, simulated a person with paranoid schizophrenia and was more
Python, Dialogue System advanced in its conversational strategy. These early systems
were fundamentally rule-based, their responses dictated by a
I. I NTRODUCTION predefined script.
In the context of the growing demand for travel, most people The following decades were marked by steady, step-by-step
aspire to take a trip to relax after a long period of hard work. improvements. The 1990s brought the rise of the internet and
Many seek out new destinations to gain exciting experiences. with it, chatbots like A.L.I.C.E. (Artificial Linguistic Internet
However, exploring unfamiliar places is not always easy, as Computer Entity), which utilized the Artificial Intelligence
travelers often lack sufficient information about the locations Markup Language (AIML) to create more complex rule-
they plan to visit. Therefore, through this course project, we based conversational flows. These bots were capable of more
aim to develop a chatbot that acts as a virtual tour guide, intricate interactions but were still fundamentally limited by
helping people access travel destination information more their pre-programmed knowledge and inability to learn from
flexibly. This chatbot will support tourists in searching for new interactions.
information anytime, anywhere, ensuring they have the best Throughout the late 20th century and early 2000s, chatbot
possible experience on their journey development was mainly limited to experimental academic
As part of a course project, we has developed a travel settings or basic customer service applications. It wasn’t
chatbot designed to help users plan their trips more easily until the late 2010s that the technology gained significant
commercial traction, particularly within the tourism industry. data is then passed to a Dialogue Manager, which performs
Initial applications focused on providing instant responses to state tracking, manages conversational context, and executes a
common inquiries—such as attraction operating hours, book- policy to determine the optimal subsequent action. This action
ing confirmations, and local suggestions—through predefined is then rendered into a coherent, human-readable response by
answer sets. Despite being limited in personalization, these a Natural Language Generation (NLG) model. The incorpo-
systems represented a major milestone in bringing conversa- ration of advanced deep learning architectures, most notably
tional agents into practical, real-world use. the Transformer (Vaswani et al., 2017), has been particu-
larly transformative. The self-attention mechanisms inherent
B. Traditional Approaches to intelligent tourism chatbot to Transformers allow the model to dynamically weigh the
The initial wave of chatbot technology was dominated significance of all words in an input relative to each other,
by systems that operated on explicit, pre-programmed logic, enabling a superior comprehension of nuance, ambiguity, and
offering control and predictability at the expense of natural long-range dependencies within the conversational history.
interaction. The foundational architectures for early conversa-
tional agents within the tourism sector were predominantly ar- III. M ETHODOLOGY
chitected around deterministic, rule-based frameworks. These Our chatbot is retrieval-based. User input is matched against
systems were, in essence, practical implementations of Finite- a list of pre-defined questions. The response will be filtered
State Machines (FSMs), which model dialogue as a directed through the K-Nearest Neighbors (KNN) algorithm before
graph of discrete, predefined states. Within this model, each delivering the most accurate and optimal reply.
state corresponds to a specific juncture in the conversation,
and transitions between states are triggered by user inputs that A. Data Collection
match explicit, hard-coded rules. The logic governing these The dataset used for fine-tuning the DeepSeek R1 model
transitions typically relied on rudimentary techniques such as has been manually compiled. It consists of 3,000 questions
keyword matching or regular expressions (regex), wherein user and answers that travelers frequently encounter when visiting
utterances were scanned for recognized lexical patterns (e.g., famous tourist destinations such as Da Nang, Da Lat, Nha
IF input CONTAINS ”book flight” THEN TRANSITIONTO Trang, and more. This dataset includes key features, entertain-
flightbookingstate). ment activities at tourist sites, entrance ticket prices, estimated
While this paradigm afforded a high degree of predictability dining expenses, and other essential travel information. With
and control for linear, task-oriented dialogues, it was con- this rich dataset, the chatbot will assist users in easily access-
strained by significant and inherent limitations. The principal ing information, enhancing their travel experience in a more
constraint was its lack of robustness; any input deviating from convenient and efficient manner.
the predefined patterns would precipitate an interaction failure
or a generic fallback response (e.g., ”I’m sorry, I don’t un- B. Method
derstand”). Moreover, these systems were inherently stateless The model fine-tuning process was conducted based on the
with respect to conversational history, lacking the capacity to DeepSeek R1 language model, an advanced deep learning
recall information from previous user turns. This resulted in model with robust natural language processing capabilities.
disjointed interactions. Scalability also presented a formidable This model was retrained on the tourism dataset to optimize its
challenge, as the introduction of new functionalities or conver- ability to generate accurate, contextually relevant, and highly
sational paths necessitated a manual, labor-intensive expansion localized responses. The fine-tuning process involved adjusting
and reconfiguration of the entire state diagram, a process the model’s parameters to enhance its accuracy and semantic
susceptible to logical errors and inconsistencies [1], [2]. understanding of questions related to tourism in Vietnam.
To improve the quality of responses, the K-Nearest Neigh-
C. Modern Advances in intelligent tourism chatbot bors (KNN) algorithm was employed to select optimal answers
A paradigm shift in the development of conversational based on two primary criteria: cost and user preferences.
agents has been catalyzed by the integration of data-driven Specifically, each response in the dataset was labeled with
methodologies, principally from the fields of Natural Language features such as estimated cost levels (low, medium, high)
Processing (NLP) and machine learning (ML). Modern agents and preference types (adventure, relaxation, culture, cuisine).
operate on a sophisticated processing pipeline that substitutes The KNN algorithm utilized Euclidean distance to identify the
probabilistic models for rigid rules. User input is first pro- responses closest to the user’s requirements, ensuring that the
cessed by a Natural Language Understanding (NLU) module, answers were not only accurate but also aligned with the user’s
which executes two critical sub-tasks: budget and personal preferences. The K parameter was tested
Intent Classification: The user’s primary objective (e.g., and optimized through cross-validation techniques to achieve
findhotel, planitinerary) is inferred by classifying the utterance the highest performance.
into a pretrained category. Entity Extraction: Key parameters
and informational units—such as dates (next April), locations IV. I MPLEMENTATION
(Japan), and user preferences (history, good food)—are iden- The implementation of the tourism question-answering sys-
tified and extracted from the unstructured text. This structured tem was carried out in two main phases: fine-tuning the
DeepSeek R1 model and integrating the K-Nearest Neighbors
(KNN) algorithm to select optimal responses. The dataset,
comprising 3,000 question-answer pairs related to tourism at
famous destinations in Vietnam, was preprocessed to ensure
consistency and quality. Preprocessing steps included text nor-
malization (removing unnecessary punctuation, converting to
lowercase), deduplication, and context labeling (e.g., location,
type of tourism). The dataset was then split into three subsets:
80
The DeepSeek R1 model was fine-tuned using transfer
learning techniques. Specifically, the pre-trained model’s pa- Fig. 2. Train/learning rate
rameters were retained as a foundation, while the final layers
were adjusted to align with the tourism dataset. Training was
conducted using the cross-entropy loss function and optimized
with the Adam algorithm, with an initial learning rate of 2e-5.
After the DeepSeek R1 model generated potential responses,
the KNN algorithm was implemented to filter and select the
most suitable answers based on cost and user preferences.
Each response in the dataset was represented as a feature
vector, incorporating numerical values for cost and one-hot
encoded preferences (adventure, relaxation, culture, cuisine).
Fig. 1. Train/loss