AI-Trip-Planner is an advanced, agentic travel planning application that leverages the power of LangGraph and LangChain to orchestrate complex, tool-augmented workflows for generating detailed, real-time travel plans. Designed for AI engineers and enthusiasts, this project demonstrates modular tool integration, graph-based agent workflows, and seamless API/streamlit UI interaction.
- Agentic Workflow: Utilizes LangGraph to build a stateful, tool-augmented agent for travel planning.
- Tool Integration: Modular tools for weather, currency, expense calculation, and place search, each encapsulated and reusable.
- LLM Orchestration: Integrates LLMs (OpenAI, Groq) via LangChain for dynamic, context-aware responses.
- API & UI: FastAPI backend with a Streamlit frontend for interactive user experience.
- Automatic Markdown Export: Each travel plan is saved as a well-formatted Markdown file.
The core of the system is a graph-based agent built with LangGraph. The agent receives user queries, orchestrates tool calls, and composes a comprehensive travel plan using LLM reasoning and real-time data.
Description:
- The workflow starts with user input, passes through the agent node, which can invoke any of the available tools as needed, and iterates until a complete plan is generated.
- The graph structure enables flexible, multi-step reasoning and tool use.
Below is the diagram of how the agent interacts with all tools:
User Query
|
v
Agent (LangGraph)
|---> WeatherInfoTool (weather, forecast)
|---> PlaceSearchTool (attractions, restaurants, activities, transport)
|---> CalculatorTool (hotel cost, total cost, daily budget)
|---> CurrencyConverterTool (currency conversion)
v
Composed Travel Plan (Markdown)
The agent is equipped with the following modular tools, each implemented as a class and exposed to the agent via LangChain's tool interface:
File: tools/weather_info_tool.py
Depends on: utils/weather_info.py
Purpose: Fetches current weather and multi-day forecasts for any city using the OpenWeatherMap API.
Exposed Functions:
get_current_weather(city: str) -> str: Returns current temperature and description.get_weather_forecast(city: str) -> str: Returns a 10-period forecast summary.
File: tools/place_search_tool.py
Depends on: utils/place_info_search.py
Purpose: Finds attractions, restaurants, activities, and transportation options using Google Places and Tavily APIs.
Exposed Functions:
search_attractions(place: str) -> strsearch_restaurants(place: str) -> strsearch_activities(place: str) -> strsearch_transportations(place: str) -> str
File: tools/expense_calculator_tool.py
Depends on: utils/expense_calculator.py
Purpose: Performs expense calculations for trip planning.
Exposed Functions:
estimate_total_hotel_cost(price_per_night: float, total_days: float) -> floatcalculate_total_cost(*costs: float) -> floatcalculate_daily_expense_budget(total_cost: float, days: int) -> float
File: tools/currency_conversion_tool.py
Depends on: utils/currency_convertor.py
Purpose: Converts amounts between currencies using the ExchangeRate API.
Exposed Functions:
convert_currency(amount: float, from_currency: str, to_currency: str) -> float
The agent is guided by a system prompt (see prompt_library/prompt.py) that instructs it to provide:
- Two travel plans (classic and off-beat)
- Day-by-day itinerary
- Hotel, restaurant, activity, and transportation recommendations
- Cost breakdowns and weather details
- All output in clean Markdown
This project integrates LangSmith for tracing and monitoring all agentic workflows and tool calls. LangSmith provides detailed visibility into LLM reasoning, tool usage, and execution paths, making it easier to debug, optimize, and understand agent behavior. All interactions and tool invocations are automatically logged for analysis.
The project is organized for clarity, modularity, and extensibility:
AI-Trip-Planner/
├── agent/ # Agent workflow logic (LangGraph integration)
│ ├── __init__.py
│ └── agentic_workflow.py
├── app_streamlit.py # Streamlit frontend app
├── config/ # Configuration files
│ ├── __init__.py
│ └── config.yaml
├── main.py # FastAPI backend entrypoint
├── my_graph.png # Workflow graph image
├── notebook/ # Experiments and research notebooks
│ └── experiment.ipynb
├── output/ # Auto-saved Markdown travel plans
│ ├── AI_Trip_Planner_*.md
├── prompt_library/ # Prompt engineering and system prompt
│ ├── __init__.py
│ └── prompt.py
├── requirements.txt # Project dependencies
├── pyproject.toml # Python project metadata
├── setup.py # Setup script for packaging
├── tools/ # All modular agent tools
│ ├── __init__.py
│ ├── currency_conversion_tool.py
│ ├── expense_calculator_tool.py
│ ├── place_search_tool.py
│ └── weather_info_tool.py
├── utils/ # Utility modules for tool logic
│ ├── __init__.py
│ ├── config_loader.py
│ ├── currency_convertor.py
│ ├── expense_calculator.py
│ ├── model_loader.py
│ ├── place_info_search.py
│ ├── save_to_document.py
│ └── weather_info.py
├── .env_example # Example environment variables
├── .gitignore
├── .python-version
├── AI_TRAVEL_PLANNER.egg-info/
├── uv.lock
- Install dependencies:
uv pip install requirements.txt # or add individually: uv add <package-name>
- Set up environment variables:
- Copy
.env_exampleto.envand fill in your API keys.
- Copy
- Start the backend:
uvicorn main:app --reload --port 8000
- Start the frontend:
streamlit run app_streamlit.py
MIT License. See LICENSE file for details.
