NashTech Blog

Table of Contents

Welcome back to our journey to Akka Agentic AI! The last blog, Akka Agent AI: Secret to Planning a Perfect Trip – Part 2, provides a step-by-step guide to add a personalized touch to an Akka AI Agent for each User. But a trip’s success heavily depends on weather as well. If weather is not favorable, then User might not enjoy the trip.

This article will guide us on adding a Weather AI Agent that will help us retrieve weather forecast information and plan a trip accordingly.

Add Weather AI Agent

In case, if you don’t want to use real weather forecast information, you can change the implementation to return a hard-coded weather, such as “It’s always sunny”. But that would beat the real purpose of adding a Weather AI Agent, working along with Planning Agent, to plan an enjoyable trip.

Test the Weather AI Agent

Before integrating the Weather AI Agent, with Planning Agent, we would like to see if the WeatherAgent works in isolation or not.

Here we don’t have much to assert, since the weather is different every day, but at least we can see the result & verify that it doesn’t fail.

Since, the test is using a real LLM request, hence we must set our OpenAI API key as an environment variable:

Test can be executed using:

Test Results!

Orchestrate the agents

We have two agents now, the PlanningAgent and the WeatherAgent. Next we need to introduce a workflow that will call the Weather AI Agent before calling the Planning AI Agent to consider weather before planning a trip. To do so, we need to follow a 2-step process.

1. Add a Workflow

  • The workflow starts, and keeps track of the userId and original query in the state of the workflow.
  • First step is to retrieve the weather forecast.
  • Weather forecast is retrieved by the WeatherAgent, which must extract the location from the user query.
  • Next step is to plan the trip via PlanningAgent.
  • The final result is stored in a workflow state.

Just wondering, how PlanningAgent will come to know about the weather forecast, if it is not passed as a parameter? The answer lies in the session memory which is shared by both, PlanningAgent and WeatherAgent. Hence, the PlanningAgent will have weather forecast information present in the context that is sent to the AI Model.

2. Update/Add the Endpoints

A point to be noted, since the workflow is running in the background we can’t wait for the final answer. Hence, we need another endpoint to retrieve the recommended plan.

Let’s Plan a Trip!

1. Set OpenAI API Key as environment variable

2. Start the service locally

3. Plan Trip! Considering Weather

In the suggested plan, weather forecast (considerations) are taken into account as well.

Next Steps

Till now we have been working around one suggestion per session. What if we need to see all suggestions provided by the Akka AI Agents to a User. Would Akka Agentic AI be able to help us? We will explore that option in our next blog, so stay tuned 🙂

Further Reading

Picture of Himanshu Gupta

Himanshu Gupta

Himanshu Gupta is a Principal Architect passionate about building scalable systems, AI‑driven solutions, and high‑impact digital platforms. He enjoys exploring emerging technologies, writing technical articles, and creating accelerators that help teams move faster. Outside of work, he focuses on continuous learning and sharing knowledge with the tech community.

Leave a Comment

Your email address will not be published. Required fields are marked *

Suggested Article

Scroll to Top