Report this

What is the reason for this report?

How I built a smart travel app using the GradientAI Platform

Published on July 11, 2025
How I built a smart travel app using the GradientAI Platform

Introduction

If everything is getting smarter, why can’t travel? This is the exact mindset with which I started building Nomado. Traveling is more than just booking flight tickets and being in beautiful locations. You need to look for a visa, build an itinerary, research the culture, find places to stay, and so much more. Nomado solves all of these, and each of these features is supported by DigitalOcean’s GradientAI Platform.

In this article, we will see how we can build AI-enabled applications that automate the boring parts. Before getting into the “How’s”, let’s learn more about the GradientAI Platform and its features.

Key Takeaways

After reading this tutorial, you will be able to:

  • Understand what the GradientAI Platform is and how it can be used to build AI-powered applications, including its key features like serverless inference, agent routing, and knowledge bases
  • Understand how to use the GradientAI Platform to build a travel app that generates personalized itineraries, provides flight information, and offers accommodation recommendations using AI
  • Understand how to use the GradientAI Platform to build an intelligent chatbot that can handle both accommodation queries and general travel questions through specialized agent routing

What is the GradientAI platform?

The GradientAI Platform is a complete toolkit to build and run GPU-powered AI agents without the hassle. Whether you’re using pre-built models or training your own, you can connect them with function calls, agent routes, and even Retrieval Augmented Generation (RAG) pipelines that pull in the right information when you need it. With built-in features like agent routing, knowledge bases, guardrails, serverless inference, the GradientAI Platform makes it easier to launch powerful AI agents that actually get things done. Using the GradientAI platform, you can build chatbots very easily, or you can even use the APIs to build AI-powered applications.

How GradientAI is being used in Nomado

In Nomado, we have three core features where we are using the GradientAI platform:

  • Generating travel itineraries: Once you are done with visa research, Nomado helps you build a personalized travel itinerary based on your travel destination, number of days, and month of travel. Itinerary
  • Getting flight information: Nomado follows a journey in itself. After your visa is sorted and you have an itinerary, the next thing you want to do is book flights. This is where we are using the GradientAI platform to fetch flight details for us. Flight info
  • Chat interface: Visa sorted, flights booked, itinerary ready. Now comes the final part, finding the right place to stay and understanding the culture, local tips, and what to expect when you arrive. This is where our chat interface steps in. It’s built to answer all your accommodation and travel questions. chat interface

Understanding how we are using Serverless inferencing to generate the itineraries

To generate the itineraries, we are using Serverless inferencing through the GradientAI platform, and this is how the infrastructure is setup:

const SECURE_AGENT_KEY = process.env.SECURE_AGENT_KEY
const AGENT_BASE_URL = "https://inference.do-ai.run/v1" //the inference endpoint


const client = hasRequiredEnvVars
  ? new OpenAI({
      apiKey: SECURE_AGENT_KEY,
      baseURL: AGENT_BASE_URL,
    })
  : null

Serverless inferencing lets you run AI models on demand without worrying about servers. You just send a request, the model runs in the cloud, and you get results back instantly.

When you plan a trip with Nomado, here’s what’s happening under the hood:

architecture diagram

Step 1: Your input (Browser)

You enter:

  • Destination: e.g Paris
  • Duration: e.g 3 days
  • Month: e.g June

Step 2: Next.js server action for itinerary generation

The server action receives the user input and creates a detailed prompt:

const prompt = `Your task is to generate a comprehensive travel plan for a ${duration}-day trip to ${destination} in ${visitMonth}. Make sure to bold the headings.
    
Please provide:
1. A ${duration}-day itinerary with day-by-day activities
2. A detailed packing list tailored to this destination in ${visitMonth} (considering the local weather and conditions)
3. Local customs and cultural tips
4. Must-try local foods
5. Transportation recommendations

Format your response in markdown with clear sections.`

And calls the DigitalOcean GradientAI API through the serverless inference endpoint.

Step 3: DigitalOcean GradientAI processing

The request hits the serverless inference service:

  • Loads the llama-3.1-8b-instruct model
  • Runs the model with the prompt above
  • Generates your complete travel plan
  • Sends the result back

The entire code that is used to generate the itinerary can be found here.

Using function routing in GradientAI to get real-time flight information

Next up is getting flight information, for that we are using the function routing feature in GradientAI platform. The function is built to fetch real-time flight data from the Tripadvisor API and allow the agent to call this function whenever a user asks about flight-related information. This creates a context-aware system that provides real-time, actionable flight data.

Function routing is a feature in DigitalOcean’s GradientAI platform that allows AI agents to call external functions when they need real-time data or specific computations. Instead of the AI making up flight information, it can invoke a deployed function that fetches actual flight data from APIs.

Here’s how it works:

1. Function Invocation: The AI agent receives a user query and automatically calls a deployed function (our flight-func/flight) 2. Real Data Fetching: The function calls the Tripadvisor API with user parameters 3. Data Processing: Real flight data is returned and formatted by the AI agent 4. User Response: The agent provides accurate, bookable flight information

architecture diagram of function routing

User enters in browser:

  • From City: “New York”
  • To City: “London”
  • Departure Date: “2024-06-15”
  • Trip Type: “round-trip” or “one-way”
  • Return Date: “2024-06-22” (for round-trip)

The server action receives the user input and creates a detailed prompt:

const prompt = `You are a travel agent and your task is to show users flights along with flight numbers based on the source and destination they input.
Please provide flight information in the following format:
Outbound Flights (${fromCity} to ${toCity} on ${departureDate}):
Airline FlightNumber: Departing [Airport] at [Time], arriving [Airport] at [Time] (Flight Duration: [Duration], non-stop/with layover)
${tripType === "round-trip" ? `Return Flights (${toCity} to ${fromCity} on ${returnDate}):
Airline FlightNumber: Departing [Airport] at [Time], arriving [Airport] at [Time] (Flight Duration: [Duration], non-stop/with layover)` : ""}
For each flight, include:
- The type of flight (Boeing 737, Airbus A320, etc.)
- Airline name and flight number
- Airport codes
- Exact departure and arrival times
- Flight duration
- Layover information if applicable
- Direct booking links from Skyscanner, Kayak, or Expedia
Format your response in markdown with clear sections. Do NOT include any extra notes, disclaimers, or introductory text. Only output the flight details as described.`

Step 3: DigitalOcean GradientAI agent function routing

The DigitalOcean GenAI agent:

1. Receives the prompt and user parameters

2. Detects that real flight data is needed (airlines, flight numbers, times, etc.)

3. Invokes the function route:

  • Calls the deployed function (`flight-func/flight`) in the flight-info folder
  • The function executes code that calls the Tripadvisor API with the user’s flight search parameters
  • Returns real-time flight data (airlines, flight numbers, times, etc.)

4. The GenAI agent receives this data and formats it into a user-friendly response

5. Returns the complete flight information to your server action

Response flow:

1. Agent sends back flight information with real data from Tripadvisor API

2. Server receives and processes the response:

const response = await client.chat.completions.create({
model: "Llama 3.3 Instruct",
messages: [
{
role: "system",
content: "You are an expert travel agent who specializes in finding specific flight information and providing direct booking links. Your responses should be practical and focused on helping travelers find and book their flights easily. Use real-time flight data and provide accurate information.",
},
{ role: "user", content: prompt },
],
temperature: 0.7,
max_tokens: 2000,
})
const content = response.choices[0]?.message?.content || "No response from AI"
return content

3. The browser displays the flight options and users get to see real, bookable flights for their journey.

The entire code that is used to get the flight information can be found here.

Building a Chat Interface using the GradientAI Platform

Nomado also has a chatbot that you can use to chat about accommodation options and also tips and tricks of your place of visit. In the backend, we are using agent routing between two agents to get the information and web-crawling Nomad stays as a knowledge base for the accommodation agent.

Agent routing is the ability to reference other agents from the instruction of an agent. Different agents may be trained or optimized for specific tasks or have different domain expertise to handle different types of requests. It usually consists of two types of agent:

  • Parent agents (Accommodation agent in this case) handle general conversation and route specific requests to specialized child agents
  • Child agents (Local info agent)are optimized for specific domains or tasks

Architecture diagram of chatbot

Step-by-Step Process

Step 1: Browser input for chat

User enters in browser:

  • Accommodation Query: “Find me accommodation in Paris” OR
  • General Travel Query: “What should I pack for Japan?”

Step 2: Parent accommodation agent & agent routing

The parent accommodation agent:

  • Receives the user query through the chatbot interface
  • Analyzes the intent and content of the query
  • Determines the appropriate routing based on query type:
    • Accommodation queries → Processes directly using the Nomad stays knowledge base
    • Travel/local info queries → Routes to the Local-info child agent with OpenAI 4o models
  • For accommodation queries: Generates response using scraped data from Nomad stays
  • For other queries: Delegates to specialized child agent

Step 3: Response processing

Response flow varies based on query type:

For accommodation queries:

  • Parent agent processes the query directly
  • Searches through the Nomad stays knowledge base
  • Generates accommodation recommendations

For travel/local info queries:

  • Parent agent routes to Local-info child agent
  • Child agent processes using OpenAI 4o models
  • Generates travel tips, cultural information, or local advice
  • Sends response back to parent agent

Step 4: Response back to browser for chat

  • User receives specific, data-driven recommendations
  • Response maintains conversational context through the parent agent

Ending Notes

Nomado is an example of how you can connect real-world tasks with AI features using the GradientAI platform, without managing heavy infrastructure. If you’re planning to build something similar, here are a few things that might help:

  • Use serverless inference for tasks like generating text or summaries.
  • Use function routing to plug in real-time APIs so your AI stays accurate with the latest data and is contextually aware.
  • Use agent routing and knowledge bases to keep your answers consistent, especially if you have domain-specific content or multiple use cases.

If you’d like to learn more or extend what I built, here are a few useful resources to check out:

I hope this gives you a starting point for building your own AI-powered workflows. If you’d like to see how Nomado works under the hood, feel free to check out the open-source code and adapt it to your own ideas.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author(s)

Haimantika Mitra
Haimantika Mitra
Author
Engineer & Writer
See author profile

A Developer Advocate by profession. I like to build with Cloud, GenAI and can build beautiful websites using JavaScript.

Anish Singh Walia
Anish Singh Walia
Editor
Sr Technical Writer
See author profile

Helping Businesses stand out with AI, SEO, & Technical content that drives Impact & Growth | Senior Technical Writer @ DigitalOcean | 2x Medium Top Writers | 2 Million+ monthly views & 34K Subscribers | Ex Cloud Engineer @ AMEX | Ex SRE(DevOps) @ NUTANIX

Category:
Tags:

Still looking for an answer?

Was this helpful?


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Creative CommonsThis work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.