DEV Community

Ritik Raj
Ritik Raj

Posted on

Agentic AI: Itinerary Planner

Building an AI-Powered Travel Itinerary Planner Using Ollama, Node.js, and React

Introduction

Travel planning is time-consuming — comparing routes, deciding daily activities, balancing pace, and estimating budgets.
To solve this, I built an AI-powered travel itinerary planner that generates realistic, structured, and customizable travel plans based on user preferences.

This article explains:

What the system does
How it was designed
The technologies used
Key engineering challenges and solutions
How I Structured the System
From the beginning, I knew one thing:

The AI should not talk directly to the UI.

So I designed the system like this:

Press enter or click to view image in full size

Each layer has one job:

UI receives input and displays response data
Listener controls logic, generates a custom prompt, and receives a response
Ollama receives the prompt on model lamma3
Why I Used Ollama (and Not OpenAI APIs)
If you wanted:

Local execution
No API costs
No data leaving my machine
Full control over models
That’s where Ollama came in. Checkout my stats-

Press enter or click to view image in full size

Ollama lets you run LLMs locally, inside Docker, and switch models easily.
I tested models like:

mistral
quantized llama3
This also forced me to deal with real-world constraints like memory limits, which honestly made the project better.

Backend: The Real Workhorse
The backend (Node.js + Express) does most of the heavy lifting. It calls Ollama, enforces strict JSON output, safely parses responses, validates the schema, and handles missing or partial data.

A classic bug taught an important lesson: the AI returned perfect JSON, but I accidentally sent it as a string instead of an object 😄. Fixing it reinforced how critical backend validation is in AI systems.

Frontend: Simple and Honest
The frontend uses React and Material UI, focusing on clarity over flashiness. Each day of the itinerary is displayed as a card with morning, afternoon, and evening sections.

Everything is rendered conditionally. If the AI skips a field, the UI adapts instead of crashing. This is how real AI products should behave.

About Accuracy
AI outputs aren’t “100% accurate.” Instead of pretending otherwise, this project defines accuracy as usability and completeness, not perfection. The system validates structure and stays transparent in the UI.

Is This Agentic AI?
Yes — functionally, but not hype-driven.

It’s a goal-oriented, planner-style agent that reasons, plans, and produces structured output. It’s not a fully autonomous or multi-agent system yet, but it clearly demonstrates agentic behavior in a controlled, production-ready way.

Top comments (0)