# deveshksrivastava/ai-travel-planning-system architecture

> Architecture diagram of the GitHub repository deveshksrivastava/ai-travel-planning-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/deveshksrivastava/ai-travel-planning-system
- Repository: https://github.com/deveshksrivastava/ai-travel-planning-system

## Overview

This is a LangGraph travel-planning application with CLI and Streamlit entry points, a sequential flight-to-hotel-to-itinerary-to-response workflow, and PostgreSQL checkpointing. It also exposes separate flight, hotel, and trip-brief tools through an MCP server. The README documents the workflow and integrations; excerpts show the main graph, search tools, MCP server, and part of the Streamlit UI. Unexcerpted UI behavior is represented only where documentation or shown code supports it.

Main entry points: [`main.py`](https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/main.py) (LangGraph app), [`mcp_server/travel_mcp.py`](https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/mcp_server/travel_mcp.py) (MCP server tools), [`frontend.py`](https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/frontend.py) (Streamlit app), [`tools/flight_tool.py`](https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/tools/flight_tool.py) (Flight search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI entry<br/>[main.py]"]
  node_web["Streamlit app<br/>[frontend.py]"]
end

subgraph group_workflow["Trip workflow"]
  node_graph["LangGraph app<br/>[main.py]"]
  node_state["Travel state<br/>[main.py]"]
  node_flight_agent["Flight agent<br/>[main.py]"]
  node_hotel_agent["Hotel agent<br/>[main.py]"]
  node_itinerary_agent["Itinerary agent<br/>[main.py]"]
  node_final_agent["Final agent<br/>[main.py]"]
end

subgraph group_integrations["Search and reasoning"]
  node_flight_tool["Flight search<br/>[flight_tool.py]"]
  node_hotel_tool["Hotel search<br/>[tavily_tool.py]"]
  node_aviationstack["AviationStack"]
  node_tavily["Tavily API"]
  node_groq["Groq LLM"]
end

subgraph group_persistence["Memory and MCP"]
  node_postgres[("PostgreSQL")]
  node_mcp_server["MCP server tools<br/>[travel_mcp.py]"]
end

node_user(("Traveler"))
node_mcp_client(("MCP client"))

node_user -->|"enters request"| node_cli
node_user -->|"enters request"| node_web
node_cli -->|"invokes"| node_graph
node_web -->|"imports app"| node_graph
node_graph -->|"dispatches first"| node_flight_agent
node_graph -->|"dispatches next"| node_hotel_agent
node_graph -->|"dispatches next"| node_itinerary_agent
node_graph -->|"dispatches last"| node_final_agent
node_graph -->|"reads and updates"| node_state
node_flight_agent -->|"searches flights"| node_flight_tool
node_flight_tool -->|"requests flight data"| node_aviationstack
node_hotel_agent -->|"searches hotels"| node_hotel_tool
node_hotel_tool -->|"requests results"| node_tavily
node_itinerary_agent -->|"generates itinerary"| node_groq
node_final_agent -->|"generates response"| node_groq
node_graph -->|"checkpoints state"| node_postgres
node_graph -->|"streams agent updates"| node_web
node_mcp_client -->|"calls tools"| node_mcp_server
node_mcp_server -->|"searches flights"| node_aviationstack
node_mcp_server -->|"searches hotels"| node_tavily

click node_cli "https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/main.py"
click node_web "https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/frontend.py"
click node_graph "https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/main.py"
click node_state "https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/main.py"
click node_flight_agent "https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/main.py"
click node_hotel_agent "https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/main.py"
click node_itinerary_agent "https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/main.py"
click node_final_agent "https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/main.py"
click node_flight_tool "https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/tools/flight_tool.py"
click node_hotel_tool "https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/tools/tavily_tool.py"
click node_mcp_server "https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/mcp_server/travel_mcp.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_cli,node_web,node_mcp_client toneBlue
class node_graph,node_state,node_flight_agent,node_hotel_agent,node_itinerary_agent,node_final_agent toneAmber
class node_flight_tool,node_hotel_tool,node_aviationstack,node_tavily,node_groq toneMint
class node_postgres,node_mcp_server toneRose
class node_user toneIndigo
```

## Components

### User interfaces

- [CLI entry](https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/main.py): `main.py`
- [Streamlit app](https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/frontend.py): `frontend.py`

### Trip workflow

- [LangGraph app](https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/main.py): `main.py`
- [Travel state](https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/main.py): `main.py`
- [Flight agent](https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/main.py): `main.py`
- [Hotel agent](https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/main.py): `main.py`
- [Itinerary agent](https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/main.py): `main.py`
- [Final agent](https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/main.py): `main.py`

### Search and reasoning

- [Flight search](https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/tools/flight_tool.py): `tools/flight_tool.py`
- [Hotel search](https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/tools/tavily_tool.py): `tools/tavily_tool.py`
- **AviationStack**
- **Tavily API**
- **Groq LLM**

### Memory and MCP

- **PostgreSQL**
- [MCP server tools](https://github.com/deveshksrivastava/ai-travel-planning-system/blob/main/mcp_server/travel_mcp.py): `mcp_server/travel_mcp.py`

### Other components

- **Traveler**
- **MCP client**

## Connections

- Traveler → CLI entry: enters request (evidence: `README.md`)
- Traveler → Streamlit app: enters request (evidence: `README.md`)
- CLI entry → LangGraph app: invokes (evidence: `main.py`)
- Streamlit app → LangGraph app: imports app (evidence: `frontend.py`)
- LangGraph app → Flight agent: dispatches first (evidence: `main.py`)
- LangGraph app → Hotel agent: dispatches next (evidence: `main.py`)
- LangGraph app → Itinerary agent: dispatches next (evidence: `main.py`)
- LangGraph app → Final agent: dispatches last (evidence: `main.py`)
- LangGraph app → Travel state: reads and updates (evidence: `main.py`)
- Flight agent → Flight search: searches flights (evidence: `main.py`)
- Flight search → AviationStack: requests flight data (evidence: `tools/flight_tool.py`)
- Hotel agent → Hotel search: searches hotels (evidence: `main.py`)
- Hotel search → Tavily API: requests results (evidence: `tools/tavily_tool.py`)
- Itinerary agent → Groq LLM: generates itinerary (evidence: `main.py`)
- Final agent → Groq LLM: generates response (evidence: `main.py`)
- LangGraph app → PostgreSQL: checkpoints state (evidence: `main.py`)
- LangGraph app → Streamlit app: streams agent updates (evidence: `frontend.py`)
- MCP client → MCP server tools: calls tools (evidence: `mcp_server/travel_mcp.py`)
- MCP server tools → AviationStack: searches flights (evidence: `mcp_server/travel_mcp.py`)
- MCP server tools → Tavily API: searches hotels (evidence: `mcp_server/travel_mcp.py`)
