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.
After reading this tutorial, you will be able to:
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.
In Nomado, we have three core features where we are using the GradientAI platform:
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:
You enter:
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.
The request hits the serverless inference service:
The entire code that is used to generate the itinerary can be found here.
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
User enters in browser:
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.`
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:
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.
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:
User enters in browser:
The parent accommodation agent:
Response flow varies based on query type:
For accommodation queries:
For travel/local info queries:
Local-info
child agentNomado 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:
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.
A Developer Advocate by profession. I like to build with Cloud, GenAI and can build beautiful websites using JavaScript.
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
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!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.