Planning a trip within India usually means jumping between travel blogs, map apps, booking sites and WhatsApp groups, and still ending up with a plan that does not fit the budget or the time available. This paper presents Safar AI, a web-based system that turns a few inputs (destination, number of days, budget in Indian Rupees, group type, pace and interests) into a day-wise itinerary. The system uses the Gemini API to draft the plan in a fixed JSON format and then checks the draft before the user sees it: the structure is validated against a schema, each suggested place is matched against Google Maps data, stops are ordered to keep travel time reasonable, and the costs are added up and compared with the budget. The front end is built with Next.js, React and TypeScript, the back end with Node.js and Express, data is stored in PostgreSQL through Prisma, and sign-in is handled by Clerk. We describe the architecture, the prompt and verification design, and an evaluation plan with measurable metrics. The central idea is that a language model is more dependable for travel planning when its output is checked by ordinary code instead of being trusted directly.
Introduction
India offers a wide variety of travel destinations, including mountains, beaches, historical sites, religious places, wildlife reserves, and metropolitan cities. However, planning a trip involves several challenges, such as selecting destinations, managing travel time, estimating expenses, and considering personal interests. Existing travel applications, booking platforms, and blogs provide useful information but often fail to combine all these factors into a single personalized itinerary. Although Large Language Models (LLMs) can generate travel plans, they may produce inaccurate information about destinations, travel distances, opening hours, and budgets.
This paper presents Safar AI, an AI-powered travel planning system designed to generate personalized, practical, and budget-friendly itineraries for travellers in India. The system combines LLM-based itinerary generation with Google Maps services and automated verification to improve the accuracy and feasibility of travel recommendations.
The literature review examines research on automated travel planning, route optimization, recommender systems, Transformer-based language models, chain-of-thought prompting, tool-using AI agents, and Retrieval-Augmented Generation (RAG). These studies highlight the importance of personalization, constraint handling, external data retrieval, and route optimization in developing reliable AI-based travel planning systems.
The proposed methodology follows a four-stage process: request, draft, verify, and store. Its major components are:
1. User input and personalization: Travellers provide their destination, trip duration, total budget in Indian rupees (INR), group type, travel style, preferred pace, and interests, such as heritage, food, nature, spirituality, and adventure.
2. AI-based itinerary generation: The Gemini API generates a structured, day-wise itinerary in JSON format based on the user's requirements. Prompt instructions specify budgeting rules, the number of daily stops, time for meals and rest, and preferences regarding opening hours.
3. Place verification and route optimization: Google Maps Platform verifies destinations, retrieves place details and coordinates, and estimates travel times between stops. A nearest-neighbour algorithm reorders daily destinations. If a destination cannot be verified or the day's travel time exceeds the permitted limit, the system removes unsuitable stops or regenerates the affected itinerary.
4. Budget estimation and validation: The system estimates expenses for accommodation, food, local transportation, entry tickets, activities, and contingency. The server calculates the total independently and regenerates the plan if it exceeds the user's budget. Estimated costs are displayed in INR, with any remaining budget shown as spare money.
The system uses a modern web architecture. The frontend is developed using Next.js, React, and TypeScript, while the backend uses Node.js and Express. Clerk manages authentication, PostgreSQL stores trips and itinerary details through Prisma ORM, Gemini generates itineraries, Google Maps provides location and routing information, and Cloudinary manages travel images. The API handles external service calls securely, while the database stores destinations, daily plans, activities, coordinates, schedules, and estimated expenses.
The results section presents an illustrative three-day itinerary for a couple visiting Jaipur with a budget of ?15,000. The proposed plan includes Hawa Mahal, City Palace, Jantar Mantar, Amber Fort, Nahargarh Fort, Albert Hall Museum, local markets, and food experiences. The estimated allocation is ?4,800 for Day 1, ?4,600 for Day 2, ?3,900 for Day 3, and ?1,700 as a contingency reserve, totalling ?15,000. These figures demonstrate the intended output format rather than experimentally verified travel costs or performance results.
The system also incorporates a validation mechanism for structured output, retries when the generated JSON is invalid, and displays a disclaimer reminding users to confirm prices, opening hours, weather conditions, and official travel advisories before travelling.
Conclusion
This paper described Safar AI, an AI-powered itinerary planner for Indian destinations. The system uses the Gemini API to draft plans and ordinary code to validate the structure, verify places, order stops and check the INR budget. The architecture is built from common web technologies that a small team can deploy and maintain.
Future work includes a pilot user study based on the metrics in Table III, support for Hindi and other regional languages, train and bus timings where licensed data is available, collaborative planning for groups, and premium features through Stripe payments. Caching verified places should also reduce cost and response time.
References
J. Xie et al., “TravelPlanner: A benchmark for real-world planning with language agents,” in Proc. 41st Int. Conf. Machine Learning (ICML), 2024.
[2] P. Vansteenwegen, W. Souffriau, G. Vanden Berghe, and D. Van Oudheusden, “The orienteering problem: A survey,” Eur. J. Oper. Res., vol. 209, no. 1, pp. 1–10, 2011.
[3] D. Gavalas, C. Konstantopoulos, K. Mastakas, and G. Pantziou, “A survey on algorithmic approaches for solving tourist trip design problems,” J. Heuristics, vol. 20, no. 3, pp. 291–328, 2014.
[4] F. Ricci, L. Rokach, and B. Shapira, Eds., Recommender Systems Handbook, 2nd ed. New York, NY, USA: Springer, 2015.
[5] A. Vaswani et al., “Attention is all you need,” in Advances in Neural Information Processing Systems (NeurIPS), vol. 30, 2017.
[6] T. B. Brown et al., “Language models are few-shot learners,” in Advances in Neural Information Processing Systems (NeurIPS), vol. 33, 2020, pp. 1877–1901.
[7] J. Wei et al., “Chain-of-thought prompting elicits reasoning in large language models,” in Advances in Neural Information Processing Systems (NeurIPS), vol. 35, 2022.
[8] S. Yao et al., “ReAct: Synergizing reasoning and acting in language models,” in Proc. Int. Conf. Learning Representations (ICLR), 2023.
[9] P. Lewis et al., “Retrieval-augmented generation for knowledge-intensive NLP tasks,” in Advances in Neural Information Processing Systems (NeurIPS), vol. 33, 2020, pp. 9459–9474.