NashTech Blog

Akka Agentic AI: Secret to Planning a Perfect Trip – Part 6

Table of Contents

Welcome back to our journey of Akka Agentic AI! The last blog, Akka Agentic AI: Secret to Planning a Perfect Trip – Part 5, provides a step-by-step guide to add a Dynamic Plan, which orchestrates multiple AI Agents and use a Workflow to execute the plan. Also, in future, more AI Agents can be added to the application without updating the orchestration workflow.

Dynamic orchestration is a good addition, it will make the AI Agents work autonomously. But who will evaluate, whether the dynamic orchestration is catering to the User preferences? Having it evaluated by a human would be expensive in terms of both – time and money. Also, as the application will scale, manual evaluation might become an overhead. Hence, getting the results/recommendations evaluated by an AI Agent would be a much better approach.

This article will guide us to:

  • Add an agent that will evaluate the quality of the AI recommendation, given the original request and the updated user preferences.
  • Use a Consumer to trigger evaluation when the User preferences are changed.

Add Evaluator Agent

Adding an EvaluatorAgent is a 3-step process:

  1. Define detailed instructions of how to evaluate the user preferences.
  2. Retrieve user preferences.
  3. And, at last provide evaluation of AI Agents’ results in a structured format.

Handle Preference Changes

Since, we are using “LLM as Judge” pattern. Hence, any changes to User Preferences, should be handled. For handling the same, we need a PreferencesConsumer which will consume PreferencesEntity and trigger the LlmAsJudge.

Note: For a real-time application, evaluating only the relevant suggestions, like last 3 suggestions, would be a better approach. Since, real-time applications are time sensitive and require minimal response times.

Let’s Plan a Trip!

1. Set OpenAI API Key as environment variable

2. Start the service locally

3. Plan Trip

4. Update Preferences

As soon as we update the preferences, the PreferencesConsumer evaluates the previous trip suggestions to update them according to changes in preferences. This can be seen in application logs.

5. Retrieve Updated Plan

In the image above, we can notice that Akka Agentic AI application has updated the trip plan as per the User preferences and removed the “Art Gallery” recommendation.

Conclusion

Finally, we have completed our first Akka Agentic AI application. If anyone is interested in experimenting with the code, then you can download it from the following link – akka-agentic-ai-trip-planner.

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