An intelligent travel planning application that generates personalized trip itineraries using AI agents, real-time data, and interactive maps.
AI-generated 3-day Paris itinerary with interactive map, weather forecasts, and optimized routes
- Features
- Tech Stack
- Architecture
- Prerequisites
- Installation
- API Keys Setup
- Running the Application
- Project Structure
- How It Works
- Future Enhancements
- ๐ค AI-Powered Itinerary Generation - Uses Google Gemini to create personalized travel plans
- ๐บ๏ธ Interactive Map - Visualize attractions, restaurants, and optimized routes
- ๐ค๏ธ Real-Time Weather - Get weather forecasts for your destination
- ๐ฝ๏ธ Restaurant Recommendations - Discover top-rated dining options
- ๐ Route Optimization - Optimized travel routes using Google Routes API
- ๐ฌ AI Chatbot - Ask questions about your itinerary
- ๐ฑ Responsive UI - Beautiful, modern interface built with Next.js and Tailwind CSS
| Technology | Purpose | Version |
|---|---|---|
| Python | Core language | 3.11+ |
| FastAPI | Web framework for HTTP endpoints | Latest |
| FastMCP | Model Context Protocol server | Latest |
| LangGraph | Agent orchestration framework | Latest |
| LangChain | LLM integration | Latest |
| Google Gemini | Large Language Model | gemini-2.0-flash-exp |
| Uvicorn | ASGI server | Latest |
| Technology | Purpose | Version |
|---|---|---|
| Next.js | React framework | 16.0.3 |
| React | UI library | 19.2.0 |
| TypeScript | Type safety | 5.x |
| Tailwind CSS | Styling | 4.x |
| Shadcn UI | Component library | Latest |
| Leaflet | Interactive maps | 1.9.4 |
| Framer Motion | Animations | 12.23.24 |
| Lucide React | Icons | Latest |
- Geoapify - Geocoding and place search
- Open-Meteo - Weather forecasts
- Foursquare - Attraction and restaurant data
- Google Routes API - Route optimization
- Google Gemini API - AI-powered content generation
The application uses a multi-agent architecture powered by LangGraph:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ User Input โ
โ (Destination Name) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FastAPI Backend โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ LangGraph Agent Workflow โ โ
โ โ โ โ
โ โ 1. Geocoder Node โ Get coordinates โ โ
โ โ 2. Weather Node โ Fetch weather forecast โ โ
โ โ 3. Places Node โ Search attractions/restaurantsโ โ
โ โ 4. Route Node โ Optimize travel route โ โ
โ โ 5. Cost Node โ Estimate travel costs โ โ
โ โ 6. Synthesizer Node โ Generate AI itinerary โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Next.js Frontend โ
โ - Interactive Map (Leaflet) โ
โ - Itinerary Cards (Shadcn UI) โ
โ - AI Chatbot โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The backend uses LangGraph to orchestrate a series of specialized agents:
- Geocoder Agent - Converts destination name to coordinates
- Weather Agent - Fetches 3-day weather forecast
- Places Agent - Searches for attractions and restaurants (50km radius with fallback)
- Route Agent - Calculates optimized route using Google Routes API
- Cost Agent - Estimates travel costs
- Synthesizer Agent - Uses Google Gemini to generate a structured JSON itinerary
Each agent is a node in the graph, and they execute sequentially, passing state between them.
Before you begin, ensure you have the following installed:
git clone https://github.com/yourusername/inkle.git
cd inkle# Navigate to backend directory
cd backend
# Create a virtual environment (recommended)
python -m venv venv
# Activate virtual environment
# On macOS/Linux:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt# Navigate to frontend directory
cd ../frontend
# Install dependencies
npm install
# or
pnpm installYou'll need to obtain API keys from the following services:
| Service | Purpose | Get API Key |
|---|---|---|
| Google Gemini | AI itinerary generation | Google AI Studio |
| Geoapify | Geocoding & place search | Geoapify |
| Foursquare | Attraction & restaurant data | Foursquare Developers |
| Google Routes API | Route optimization | Google Cloud Console |
- Create a
.envfile in thebackenddirectory:
cd backend
touch .env- Add your API keys to the
.envfile:
# Google Gemini API Key
GOOGLE_API_KEY=your_gemini_api_key_here
# Geoapify API Key
GEOAPIFY_API_KEY=your_geoapify_api_key_here
# Foursquare API Key
FOURSQUARE_API_KEY=your_foursquare_api_key_here
# Google Routes API Key (from Google Cloud Console)
GOOGLE_ROUTES_API_KEY=your_google_routes_api_key_here- Go to Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy the key and paste it into your
.envfile
- Go to Geoapify
- Sign up for a free account
- Navigate to "My Projects" โ "API Keys"
- Copy your API key
- Go to Foursquare Developers
- Create a new app
- Copy your API key from the app dashboard
- Go to Google Cloud Console
- Create a new project (or select existing)
- Enable the Routes API
- Go to "Credentials" โ "Create Credentials" โ "API Key"
- Copy the API key
# From the backend directory
cd backend
python -m backend.serverThe backend will start on http://localhost:8000
# From the frontend directory (in a new terminal)
cd frontend
npm run dev
# or
pnpm devThe frontend will start on http://localhost:3000
Open your browser and navigate to:
http://localhost:3000
inkle/
โโโ backend/
โ โโโ tools/
โ โ โโโ geocoding.py # Geoapify geocoding
โ โ โโโ weather.py # Open-Meteo weather API
โ โ โโโ places.py # Foursquare places search
โ โ โโโ routing.py # Google Routes API
โ โ โโโ costs.py # Cost estimation
โ โโโ graph.py # LangGraph agent workflow
โ โโโ server.py # FastAPI + FastMCP server
โ โโโ llm_factory.py # Google Gemini LLM setup
โ โโโ requirements.txt # Python dependencies
โ โโโ .env # API keys (not in repo)
โ
โโโ frontend/
โ โโโ app/
โ โ โโโ page.tsx # Main page
โ โ โโโ layout.tsx # Root layout
โ โ โโโ globals.css # Global styles
โ โโโ components/
โ โ โโโ MapComponent.tsx # Leaflet map
โ โ โโโ ItineraryCards.tsx # Itinerary display
โ โ โโโ Chatbot.tsx # AI chatbot
โ โ โโโ ui/ # Shadcn UI components
โ โโโ lib/
โ โ โโโ useMCP.ts # API client hook
โ โโโ package.json # Node dependencies
โ
โโโ README.md
User enters a destination (e.g., "Paris", "Tokyo", "Mysore")
The LangGraph workflow executes the following nodes sequentially:
# Simplified workflow
workflow = StateGraph(AgentState)
workflow.add_node("geocoder", geocode_node) # Get coordinates
workflow.add_node("fetch_weather", weather_node) # Fetch weather
workflow.add_node("fetch_places", places_node) # Search attractions
workflow.add_node("calculate_route", route_node) # Optimize route
workflow.add_node("calculate_cost", cost_node) # Estimate costs
workflow.add_node("synthesizer", synthesizer_node) # Generate itinerary
workflow.set_entry_point("geocoder")
workflow.add_edge("geocoder", "fetch_weather")
workflow.add_edge("fetch_weather", "fetch_places")
workflow.add_edge("fetch_places", "calculate_route")
workflow.add_edge("calculate_route", "calculate_cost")
workflow.add_edge("calculate_cost", "synthesizer")
workflow.add_edge("synthesizer", END)The Synthesizer Node uses Google Gemini to:
- Analyze all gathered data (weather, places, routes, costs)
- Generate a structured JSON itinerary
- Create day-by-day plans with activities
- Provide descriptions for each attraction
The Next.js frontend:
- Displays itinerary in beautiful cards
- Renders an interactive Leaflet map with markers
- Shows optimized route as a polyline
- Provides an AI chatbot for questions
- Hotel Search - Integrate Amadeus or Google Hotels API
- PDF Export - Download itinerary as PDF
- User Accounts - Save and manage multiple trips
- Docker Deployment - Containerize the application
- Multi-day Itineraries - Support for longer trips
- Budget Customization - Filter by budget preferences
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
- LangGraph for the agent orchestration framework
- FastMCP for the Model Context Protocol implementation
- Google Gemini for AI-powered content generation
- Shadcn UI for beautiful React components
- Leaflet for interactive maps
For questions or feedback, please open an issue on GitHub.
Happy Travels! ๐
