Katelyn, your Travel Agent Chatbot
My journey crafting a Streamlit-hosted, AI-driven chatbot for effortless, personalized travel planning. Innovating a new era of travel planning.
Project Overview
Developing Katelyn, the travel agent chatbot, was not just about creating a tool for planning travel itineraries, but also about diving deep into the intricacies of AI development and learning how to make complex technologies accessible to all users.
Katelyn marked my return to programming in Python after a hiatus of five years, and the 40-hour sprint evolved into a whirlwind of intense, fast-paced iteration. The sprint included user testing, feedback incorporation, and continuous refinement. This hands-on experience reinforced the importance of user-centered design, especially in AI projects where user interaction with technology can be unpredictable.
Tech Stack
Python: rapid development and integration abilities
ChatGPT-3.5: natural language processing capabilities
Streamlit: accessibility to a wider audience
Skills
Advanced Prompt Engineering
Web Application Development
API Integration and Environmental Management
Timeline
Passion project completed over the course of 2 weeks
Inside the Code
In Short
In the initialization phase of the program, I retrieve the OpenAI API key from environment variables, in order to speak with the GPT-3.5-turbo model while keeping the key secure. I chose to build an interface with a chat-like layout as users are familiar with that interaction. As users send messages, the chatbot dynamically generates responses based on their input. Prompt engineering plays a pivotal role in this process, as I carefully craft the "setup" variable to provide initial instructions to guide the chatbot's behavior, which creates a coherent and contextually relevant conversation flow from the outset. This approach shows the importance of prompt engineering in tailoring the chatbot's responses to user input, making the interaction feel human and natural.
The variable called “setup”
It’s not hyperbole to say the entire concept of Katelyn hinges on this one variable called setup. Despite its simplicity as a string, this variable serves as the linchpin of the entire system. With each user message, "setup" is passed along with the entire chat conversation to GPT-3.5. This way, GPT-3.5 is constantly “reminded” of what questions to ask and what its goal is: to create a day-by-day itinerary based on the user’s inputs.
Generating a message with ChatGPT-3.5
When the code is first run, it creates a type of variable called an array to store chat messages. The first message is the one that tells ChatGPT that it’s a virtual travel agent named Katelyn. Then, the chatbot prints a predetermined first message: “Hi, I’m Katelyn. I’m excited to help you plan…”
Once the user responds to Katelyn’s first message, the array is updated with the user’s response. The array then gets forwarded to ChatGPT, and the conversation continues.
Reflections and Learnings
This project provided valuable insights into developing AI-driven applications, particularly through working with OpenAI's GPT-4. Delving into prompt engineering was both challenging and rewarding, prompting creative and strategic thinking in human-AI interaction.
Overcoming these challenges reinforced the importance of continuous learning and problem-solving, highlighting that effective software development goes beyond technical skills to understanding people and processes.
The project significantly expanded my technical skillset, encompassing AI, prompt engineering, web development, and user interface design. It also deepened my appreciation for the human aspects of technology development, including empathy for users, clear communication, and useful design.
In retrospect, creating Katelyn reminded me what I love about technology: its potential to solve real-world problems, the continuous learning process, and the ability to create meaningful connections with people. This experience enhanced my technical abilities and deepened my appreciation for technology's impact on everyday life.