3.2 - Travel Agency Use Case
Overview
Let's explore a hypothetical scenario.
Our client runs a travel agency who wants to enhance their customer experience using AI. n addition to answering general user queries via their documentation, this client wants to provide personalized travel recommendations—specifically, what to wear based on current weather forecasts.
We’ll explore two methods for building this solution in mAIstro:
- Using a prebuilt NeuralSeek Example Agent to get a quick-start demonstration.
- Building a fully customized mAIstro agent tailored to user queries.
Example Agent
NeuralSeek's Example Agents allow users to quickly get up and running with a prebuilt working agent you can adapt to your use case or use as inspiration.
- Navigate to the mAIstro tab.
- Click on the Example Agents icon to open the library.
- Select the
Recommend Clothes Based on the Weather Forecast
agent.
The Agent will appear in the Editor:
NTL
{{ post | url: "https://api.weather.gov/gridpoints/TOP/32,81/forecast" | operation: "GET" | jsonToVars: "true" }}
{{ LLM | prompt: "The weather << name: properties.periods[0].name , prompt: false >> is going to be:
<< name: properties.periods[0].detailedForecast , prompt: false >>
and becoming << name: properties.periods[1].name , prompt: false >>
<< name: properties.periods[1].detailedForecast , prompt: false >>
Recap the forecast and make some recommendations on what should I wear." }}
You can expand each node by clicking the gear icon in the top corner. Let's walk through each node:
- We start with a REST node with a prefilled URL to send the POST to, to recieve the current weather data.
- Next we have a Send to LLM node with a prompt to output various weather variables with detailed forecast data for a concise recap and recommend attire to wear accordingly.
- Click Run Agent and view the generated response.
This gives a strong starting point. From here, we will explore how we can build the agent to utilized in Seek as a mAIstro-led category.
Weather Recap Agent
We will walk through building a custom mAIstro agent to perform a similar function, but with more flexibility and the ability to scale to real-world use cases. This agent will:
- Gather the user’s query.
- Pull real-time weather data via a REST call.
- Recap the weather forecast in plain language based on the user query.
- Make a recommendation on appropriate attire based on the forecast.
Gather User Query
First, we will gather the user's query enhanced with NeuralSeek context keeping to be stored as a variable for later processing.
- Add a Seek Input node.
- Drag and drop a Set a Variable to chain together. Click the gear icon to set the variable name as
query
. Directly set the value to a new variable:<< name: seekIn.contextQuery, prompt: true >>
Next, we will add a fallback for multi-turn interactions. The condition here states that if the query variable is blank, then set it to the original user input.
- Add a Condition node. Click the gear icon and add this condition to evaluate:
'<< name: query, prompt: false >>' == ''
- Drag and drop a Set a Variable to chain together. Click the gear icon to set the variable name as
query
. Directly set the value to a new variable:<< name: seekIn.originalQuery, prompt: false >>
Send a REST Request
Now we need to grab the weather forecast data.
- Add a REST. Click the gear icon to set the URL to send the POST to as:
https://api.weather.gov/gridpoints/TOP/32,81/forecast
. This retrieves a JSON response with detailed weather information for a specific location and set them to flattened variabled for downstream use.
Generate the Weather Recap and Attire Recommendation
Finally, we will convert the weather data into a user-friendly response as a recap and attire recommendation.
- Add a Send to LLM node. Click the gear icon to add this prompt:
The weather << name: properties.periods[0].name , prompt: false >> is going to be:
<< name: properties.periods[0].detailedForecast , prompt: false >>
and becoming << name: properties.periods[1].name , prompt: false >>
<< name: properties.periods[1].detailedForecast , prompt: false >>
Recap the forecast based on the question: << name: query, prompt: false >>.
Make some recommendations on what should I wear based on this: << name: properties.periods[0].detailedForecast , prompt: false >>
- Set Cache to
false
so that fresh responses are generated each time based on the current forecast.
Test in mAIstro
Now that our agent is fully built, let's test it directly from the mAIstro interface.
Weather Agent NTL
{{ seekIn }}=>{{ variable | name: "query" | value: "<< name: seekIn.contextQuery, prompt: true >>" }}
{{ condition | value: "'<< name: query, prompt: false >>' == ''" }}=>{{ variable | name: "query" | value: "<< name: seekIn.originalQuery, prompt: false >>" }}
{{ post | url: "https://api.weather.gov/gridpoints/TOP/32,81/forecast" | operation: "GET" | jsonToVars: "true" }}
{{ LLM | prompt: "The weather << name: properties.periods[0].name , prompt: false >> is going to be:
<< name: properties.periods[0].detailedForecast , prompt: false >>
and becoming << name: properties.periods[1].name , prompt: false >>
<< name: properties.periods[1].detailedForecast , prompt: false >>
Recap the forecast based on the question: << name: query, prompt: false >>.
Make some recommendations on what should I wear based on this: << name: properties.periods[0].detailedForecast , prompt: false >>" | cache: "false" }}
- Click the Run Agent. An Explore Parameter will populate. Add a query and click evaluate:
What is the weather today?
- Click the Save icon at the bottom of the screen to save the agent. Provide a unique name and description.
Create a mAIstro-led Category
To integrate the agent into chatbot routing logic, we’ll create a custom category that uses this agent when weather-related queries are detected.
- Navigate to the Configure tab. Ensure that Multi-Agent Routing is enabled in the bottom right corner.
- Click Add a Category.
- Name the new category
Weather
, add a brief description, set the Action to take on match tomAIstro-led
. Click Save Category. - Click on the Default Action and select your newly created mAIstro Agent from the drop-down list. Click save.
Test in Seek
With the mAIstro-led category active, you can now test the entire experience in Seek.
- Navigate to the Seek tab.
- Type in a question, such as:
What is the weather like today?
- Review the AI-generated response, which includes a recap of current weather conditions and personalized clothing recommendations.
- Type in a follow-up question, such as:
Should I bring an umbrella?
- Review the AI-generated response and confirm that the system responds contextually.