# rpsahu12/ai_trip_planner architecture

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

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

## Overview

AI Trip Planner is a Streamlit and FastAPI travel-planning application. Users submit solo questions or collaborate through group rooms; the backend sends requests to a tool-using LangGraph agent, returns itinerary text, and can convert plans into map locations. The documented group workflow includes room creation, private preference submissions, consensus planning, and shared conversational refinement. The graph includes the major planning tools and model/configuration layer; some connections come from the README or SOURCE INDEX because those source files were not excerpted.

Main entry points: [`agent/agentic_workflow.py`](https://github.com/rpsahu12/ai_trip_planner/blob/master/agent/agentic_workflow.py) (Agent Workflow), [`main.py`](https://github.com/rpsahu12/ai_trip_planner/blob/master/main.py) (FastAPI Endpoints), [`app.py`](https://github.com/rpsahu12/ai_trip_planner/blob/master/app.py) (Streamlit Frontend), [`utils/model_loader.py`](https://github.com/rpsahu12/ai_trip_planner/blob/master/utils/model_loader.py) (LLM Provider Loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User Experience"]
  node_frontend["Streamlit Frontend<br/>[app.py]"]
end

subgraph group_planning["Planning Backend"]
  node_api["FastAPI Endpoints<br/>[main.py]"]
  node_rooms[("Group Rooms and Preferences<br/>[main.py]")]
end

subgraph group_agent["Agent and Models"]
  node_agent_workflow["Agent Workflow"]
  node_map_conversion["Itinerary Map Conversion"]
  node_system_prompt["Travel Planning Prompt<br/>[prompt.py]"]
  node_model_loader["LLM Provider Loader<br/>[model_loader.py]"]
  node_config_loader["Configuration Loader<br/>[config_loader.py]"]
end

subgraph group_capabilities["Travel Capabilities"]
  node_place_tools["Place Search Tools"]
  node_place_search["Tavily Place Search"]
  node_weather_tools["Weather Tools"]
  node_weather_service["Weather Service<br/>[weather_info.py]"]
  node_expense_tools["Expense Calculator Tools"]
  node_expense_calculator["Expense Calculator"]
  node_currency_tools["Currency Conversion Tool"]
  node_currency_service["Currency Converter"]
end

node_traveler(("Traveler or Group"))
node_llm{{"LLM Provider"}}
node_tavily{{"Tavily Search"}}
node_weather_api{{"Weather API"}}

node_traveler -->|"uses"| node_frontend
node_frontend -->|"submits requests"| node_api
node_api -->|"manages preferences"| node_rooms
node_api -->|"invokes agent"| node_agent_workflow
node_api -->|"converts plan"| node_map_conversion
node_agent_workflow -->|"loads prompt"| node_system_prompt
node_agent_workflow -->|"loads model"| node_model_loader
node_model_loader -->|"loads configuration"| node_config_loader
node_agent_workflow -.->|"invokes model"| node_llm
node_agent_workflow -->|"registers tools"| node_place_tools
node_agent_workflow -->|"registers tools"| node_weather_tools
node_agent_workflow -->|"registers tools"| node_expense_tools
node_agent_workflow -->|"registers tools"| node_currency_tools
node_place_tools -->|"delegates searches"| node_place_search
node_place_search -->|"queries"| node_tavily
node_weather_tools -->|"calls forecast methods"| node_weather_service
node_weather_service -->|"requests weather"| node_weather_api
node_expense_tools -->|"calls calculations"| node_expense_calculator
node_currency_tools -->|"calls conversion"| node_currency_service

click node_frontend "https://github.com/rpsahu12/ai_trip_planner/blob/master/app.py"
click node_api "https://github.com/rpsahu12/ai_trip_planner/blob/master/main.py"
click node_rooms "https://github.com/rpsahu12/ai_trip_planner/blob/master/main.py"
click node_agent_workflow "https://github.com/rpsahu12/ai_trip_planner/blob/master/agent/agentic_workflow.py"
click node_map_conversion "https://github.com/rpsahu12/ai_trip_planner/blob/master/agent/agentic_workflow.py"
click node_system_prompt "https://github.com/rpsahu12/ai_trip_planner/blob/master/prompt_library/prompt.py"
click node_model_loader "https://github.com/rpsahu12/ai_trip_planner/blob/master/utils/model_loader.py"
click node_config_loader "https://github.com/rpsahu12/ai_trip_planner/blob/master/utils/config_loader.py"
click node_place_tools "https://github.com/rpsahu12/ai_trip_planner/blob/master/tools/place_search_tool.py"
click node_place_search "https://github.com/rpsahu12/ai_trip_planner/blob/master/utils/place_info_search.py"
click node_weather_tools "https://github.com/rpsahu12/ai_trip_planner/blob/master/tools/weather_info_tool.py"
click node_weather_service "https://github.com/rpsahu12/ai_trip_planner/blob/master/utils/weather_info.py"
click node_expense_tools "https://github.com/rpsahu12/ai_trip_planner/blob/master/tools/expense_calculator_tool.py"
click node_expense_calculator "https://github.com/rpsahu12/ai_trip_planner/blob/master/utils/expense_calculator.py"
click node_currency_tools "https://github.com/rpsahu12/ai_trip_planner/blob/master/tools/currency_conversion_tool.py"
click node_currency_service "https://github.com/rpsahu12/ai_trip_planner/blob/master/utils/currency_converter.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_frontend toneBlue
class node_api,node_rooms toneAmber
class node_agent_workflow,node_map_conversion,node_system_prompt,node_model_loader,node_config_loader,node_weather_api toneMint
class node_place_tools,node_place_search,node_weather_tools,node_weather_service,node_expense_tools,node_expense_calculator,node_currency_tools,node_currency_service toneRose
class node_traveler,node_llm,node_tavily toneIndigo
```

## Components

### User Experience

- [Streamlit Frontend](https://github.com/rpsahu12/ai_trip_planner/blob/master/app.py): `app.py`

### Planning Backend

- [FastAPI Endpoints](https://github.com/rpsahu12/ai_trip_planner/blob/master/main.py): `main.py`
- [Group Rooms and Preferences](https://github.com/rpsahu12/ai_trip_planner/blob/master/main.py): `main.py`

### Agent and Models

- [Agent Workflow](https://github.com/rpsahu12/ai_trip_planner/blob/master/agent/agentic_workflow.py): `agent/agentic_workflow.py`
- [Itinerary Map Conversion](https://github.com/rpsahu12/ai_trip_planner/blob/master/agent/agentic_workflow.py): `agent/agentic_workflow.py`
- [Travel Planning Prompt](https://github.com/rpsahu12/ai_trip_planner/blob/master/prompt_library/prompt.py): `prompt_library/prompt.py`
- [LLM Provider Loader](https://github.com/rpsahu12/ai_trip_planner/blob/master/utils/model_loader.py): `utils/model_loader.py`
- [Configuration Loader](https://github.com/rpsahu12/ai_trip_planner/blob/master/utils/config_loader.py): `utils/config_loader.py`

### Travel Capabilities

- [Place Search Tools](https://github.com/rpsahu12/ai_trip_planner/blob/master/tools/place_search_tool.py): `tools/place_search_tool.py`
- [Tavily Place Search](https://github.com/rpsahu12/ai_trip_planner/blob/master/utils/place_info_search.py): `utils/place_info_search.py`
- [Weather Tools](https://github.com/rpsahu12/ai_trip_planner/blob/master/tools/weather_info_tool.py): `tools/weather_info_tool.py`
- [Weather Service](https://github.com/rpsahu12/ai_trip_planner/blob/master/utils/weather_info.py): `utils/weather_info.py`
- [Expense Calculator Tools](https://github.com/rpsahu12/ai_trip_planner/blob/master/tools/expense_calculator_tool.py): `tools/expense_calculator_tool.py`
- [Expense Calculator](https://github.com/rpsahu12/ai_trip_planner/blob/master/utils/expense_calculator.py): `utils/expense_calculator.py`
- [Currency Conversion Tool](https://github.com/rpsahu12/ai_trip_planner/blob/master/tools/currency_conversion_tool.py): `tools/currency_conversion_tool.py`
- [Currency Converter](https://github.com/rpsahu12/ai_trip_planner/blob/master/utils/currency_converter.py): `utils/currency_converter.py`

### Other components

- **Traveler or Group**
- **LLM Provider**
- **Tavily Search**
- **Weather API**

## Connections

- Traveler or Group → Streamlit Frontend: uses (evidence: `README.md`)
- Streamlit Frontend → FastAPI Endpoints: submits requests (evidence: `README.md`)
- FastAPI Endpoints → Group Rooms and Preferences: manages preferences (evidence: `main.py`)
- FastAPI Endpoints → Agent Workflow: invokes agent (evidence: `main.py`)
- FastAPI Endpoints → Itinerary Map Conversion: converts plan (evidence: `main.py`)
- Agent Workflow → Travel Planning Prompt: loads prompt (evidence: `agent/agentic_workflow.py`)
- Agent Workflow → LLM Provider Loader: loads model (evidence: `agent/agentic_workflow.py`)
- LLM Provider Loader → Configuration Loader: loads configuration (evidence: `utils/model_loader.py`)
- Agent Workflow → LLM Provider: invokes model
- Agent Workflow → Place Search Tools: registers tools (evidence: `agent/agentic_workflow.py`)
- Agent Workflow → Weather Tools: registers tools (evidence: `agent/agentic_workflow.py`)
- Agent Workflow → Expense Calculator Tools: registers tools (evidence: `agent/agentic_workflow.py`)
- Agent Workflow → Currency Conversion Tool: registers tools (evidence: `agent/agentic_workflow.py`)
- Place Search Tools → Tavily Place Search: delegates searches (evidence: `tools/place_search_tool.py`)
- Tavily Place Search → Tavily Search: queries (evidence: `utils/place_info_search.py`)
- Weather Tools → Weather Service: calls forecast methods (evidence: `tools/weather_info_tool.py`)
- Weather Service → Weather API: requests weather (evidence: `utils/weather_info.py`)
- Expense Calculator Tools → Expense Calculator: calls calculations (evidence: `tools/expense_calculator_tool.py`)
- Currency Conversion Tool → Currency Converter: calls conversion (evidence: `tools/currency_conversion_tool.py`)
