# sunnysavita10/ai_trip_planner architecture

> Architecture diagram of the GitHub repository sunnysavita10/ai_trip_planner, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sunnysavita10/ai_trip_planner
- Repository: https://github.com/sunnysavita10/ai_trip_planner

## Overview

This is an AI travel-planning and expense assistant exposed through a FastAPI query endpoint, with a documented Streamlit entry point. The principal workflow sends a question to a LangGraph agent, which can dispatch tools for destination research, weather, currency conversion, and expense calculations before returning a response. The prompt also specifies itinerary, lodging, and budget recommendations. Source evidence shows several tool-to-service calls; unsampled UI and some utility internals limit further connection detail.

Main entry points: [`agent/agentic_workflow.py`](https://github.com/sunnysavita10/ai_trip_planner/blob/main/agent/agentic_workflow.py) (Tool dispatch), [`utils/model_loader.py`](https://github.com/sunnysavita10/ai_trip_planner/blob/main/utils/model_loader.py) (Model loader), [`utils/place_info_search.py`](https://github.com/sunnysavita10/ai_trip_planner/blob/main/utils/place_info_search.py) (Place search services), [`main.py`](https://github.com/sunnysavita10/ai_trip_planner/blob/main/main.py) (Query API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_fastapi["Query API<br/>[main.py]"]
  node_streamlit["Streamlit app<br/>[streamlit_app.py]"]
end

subgraph group_agent["Agent workflow"]
  node_graph["Agent graph"]
  node_prompt["Travel prompt<br/>[prompt.py]"]
  node_model["Model loader<br/>[model_loader.py]"]
  node_config["Model config<br/>[config_loader.py]"]
  node_dispatch["Tool dispatch"]
end

subgraph group_tools["Planning tools"]
  node_place_tool["Place search"]
  node_weather_tool["Weather tools"]
  node_expense_tool["Expense calculator"]
  node_currency_tool["Currency converter"]
end

subgraph group_services["Service implementations"]
  node_places["Place search services"]
  node_weather["Weather service<br/>[weather_info.py]"]
  node_expense["Expense calculations"]
  node_currency["Currency conversion"]
  node_export["Markdown exporter"]
end

node_traveler(("Traveler"))
node_llm["LLM provider"]
node_google["Google Places"]
node_tavily["Tavily search"]
node_openweather["OpenWeather API"]

node_traveler -->|"submits query"| node_fastapi
node_traveler -->|"opens app"| node_streamlit
node_fastapi -->|"builds and invokes"| node_graph
node_graph -->|"loads model"| node_model
node_model -->|"loads settings"| node_config
node_model -->|"creates provider"| node_llm
node_graph -->|"uses prompt"| node_prompt
node_graph -->|"configures tools"| node_dispatch
node_dispatch -->|"dispatches calls"| node_place_tool
node_dispatch -->|"dispatches calls"| node_weather_tool
node_dispatch -->|"dispatches calls"| node_expense_tool
node_dispatch -->|"dispatches calls"| node_currency_tool
node_place_tool -->|"queries places"| node_places
node_weather_tool -->|"requests forecasts"| node_weather
node_expense_tool -->|"calculates costs"| node_expense
node_currency_tool -->|"converts amounts"| node_currency
node_places -->|"searches places"| node_google
node_places -->|"fallback search"| node_tavily
node_weather -->|"requests weather"| node_openweather

click node_fastapi "https://github.com/sunnysavita10/ai_trip_planner/blob/main/main.py"
click node_streamlit "https://github.com/sunnysavita10/ai_trip_planner/blob/main/streamlit_app.py"
click node_graph "https://github.com/sunnysavita10/ai_trip_planner/blob/main/agent/agentic_workflow.py"
click node_prompt "https://github.com/sunnysavita10/ai_trip_planner/blob/main/prompt_library/prompt.py"
click node_model "https://github.com/sunnysavita10/ai_trip_planner/blob/main/utils/model_loader.py"
click node_config "https://github.com/sunnysavita10/ai_trip_planner/blob/main/utils/config_loader.py"
click node_dispatch "https://github.com/sunnysavita10/ai_trip_planner/blob/main/agent/agentic_workflow.py"
click node_place_tool "https://github.com/sunnysavita10/ai_trip_planner/blob/main/tools/place_search_tool.py"
click node_weather_tool "https://github.com/sunnysavita10/ai_trip_planner/blob/main/tools/weather_info_tool.py"
click node_expense_tool "https://github.com/sunnysavita10/ai_trip_planner/blob/main/tools/expense_calculator_tool.py"
click node_currency_tool "https://github.com/sunnysavita10/ai_trip_planner/blob/main/tools/currency_conversion_tool.py"
click node_places "https://github.com/sunnysavita10/ai_trip_planner/blob/main/utils/place_info_search.py"
click node_weather "https://github.com/sunnysavita10/ai_trip_planner/blob/main/utils/weather_info.py"
click node_expense "https://github.com/sunnysavita10/ai_trip_planner/blob/main/utils/expense_calculator.py"
click node_currency "https://github.com/sunnysavita10/ai_trip_planner/blob/main/utils/currency_converter.py"
click node_export "https://github.com/sunnysavita10/ai_trip_planner/blob/main/utils/save_to_document.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_fastapi,node_streamlit toneBlue
class node_graph,node_prompt,node_model,node_config,node_dispatch toneAmber
class node_place_tool,node_weather_tool,node_expense_tool,node_currency_tool,node_openweather toneMint
class node_places,node_weather,node_expense,node_currency,node_export toneRose
class node_traveler,node_llm,node_google,node_tavily toneIndigo
```

## Components

### User entry points

- [Query API](https://github.com/sunnysavita10/ai_trip_planner/blob/main/main.py): `main.py`
- [Streamlit app](https://github.com/sunnysavita10/ai_trip_planner/blob/main/streamlit_app.py): `streamlit_app.py`

### Agent workflow

- [Agent graph](https://github.com/sunnysavita10/ai_trip_planner/blob/main/agent/agentic_workflow.py): `agent/agentic_workflow.py`
- [Travel prompt](https://github.com/sunnysavita10/ai_trip_planner/blob/main/prompt_library/prompt.py): `prompt_library/prompt.py`
- [Model loader](https://github.com/sunnysavita10/ai_trip_planner/blob/main/utils/model_loader.py): `utils/model_loader.py`
- [Model config](https://github.com/sunnysavita10/ai_trip_planner/blob/main/utils/config_loader.py): `utils/config_loader.py`
- [Tool dispatch](https://github.com/sunnysavita10/ai_trip_planner/blob/main/agent/agentic_workflow.py): `agent/agentic_workflow.py`

### Planning tools

- [Place search](https://github.com/sunnysavita10/ai_trip_planner/blob/main/tools/place_search_tool.py): `tools/place_search_tool.py`
- [Weather tools](https://github.com/sunnysavita10/ai_trip_planner/blob/main/tools/weather_info_tool.py): `tools/weather_info_tool.py`
- [Expense calculator](https://github.com/sunnysavita10/ai_trip_planner/blob/main/tools/expense_calculator_tool.py): `tools/expense_calculator_tool.py`
- [Currency converter](https://github.com/sunnysavita10/ai_trip_planner/blob/main/tools/currency_conversion_tool.py): `tools/currency_conversion_tool.py`

### Service implementations

- [Place search services](https://github.com/sunnysavita10/ai_trip_planner/blob/main/utils/place_info_search.py): `utils/place_info_search.py`
- [Weather service](https://github.com/sunnysavita10/ai_trip_planner/blob/main/utils/weather_info.py): `utils/weather_info.py`
- [Expense calculations](https://github.com/sunnysavita10/ai_trip_planner/blob/main/utils/expense_calculator.py): `utils/expense_calculator.py`
- [Currency conversion](https://github.com/sunnysavita10/ai_trip_planner/blob/main/utils/currency_converter.py): `utils/currency_converter.py`
- [Markdown exporter](https://github.com/sunnysavita10/ai_trip_planner/blob/main/utils/save_to_document.py): `utils/save_to_document.py`

### Other components

- **Traveler**
- **LLM provider**
- **Google Places**
- **Tavily search**
- **OpenWeather API**

## Connections

- Traveler → Query API: submits query (evidence: `main.py`)
- Traveler → Streamlit app: opens app (evidence: `README.md`)
- Query API → Agent graph: builds and invokes (evidence: `main.py`)
- Agent graph → Model loader: loads model (evidence: `agent/agentic_workflow.py`)
- Model loader → Model config: loads settings (evidence: `utils/model_loader.py`)
- Model loader → LLM provider: creates provider (evidence: `utils/model_loader.py`)
- Agent graph → Travel prompt: uses prompt (evidence: `agent/agentic_workflow.py`)
- Agent graph → Tool dispatch: configures tools (evidence: `agent/agentic_workflow.py`)
- Tool dispatch → Place search: dispatches calls (evidence: `agent/agentic_workflow.py`)
- Tool dispatch → Weather tools: dispatches calls (evidence: `agent/agentic_workflow.py`)
- Tool dispatch → Expense calculator: dispatches calls (evidence: `agent/agentic_workflow.py`)
- Tool dispatch → Currency converter: dispatches calls (evidence: `agent/agentic_workflow.py`)
- Place search → Place search services: queries places (evidence: `tools/place_search_tool.py`)
- Weather tools → Weather service: requests forecasts (evidence: `tools/weather_info_tool.py`)
- Expense calculator → Expense calculations: calculates costs (evidence: `tools/expense_calculator_tool.py`)
- Currency converter → Currency conversion: converts amounts (evidence: `tools/currency_conversion_tool.py`)
- Place search services → Google Places: searches places (evidence: `utils/place_info_search.py`)
- Place search services → Tavily search: fallback search (evidence: `utils/place_info_search.py`)
- Weather service → OpenWeather API: requests weather (evidence: `utils/weather_info.py`)
