# manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph architecture

> Architecture diagram of the GitHub repository manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph
- Repository: https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph

## Overview

GoTrip AI accepts trip details through its web UI or chat API, runs a LangGraph planning workflow, and returns a structured itinerary with route, flight, hotel, weather, and scoring data. The README documents the route → flights → hotels → weather → itinerary → final-answer stages; app.py shows the API-to-backend calls, while mcp_client.py configures the MCP integrations. backend.py was not sampled, so its internal stages and persistence links are based on README documentation rather than inspected implementation.

Main entry points: [`backend.py`](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/backend.py) (LangGraph Workflow), [`mcp_client.py`](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/mcp_client.py) (MCP Tool Client), [`app.py`](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/app.py) (FastAPI Endpoints), [`templates/index.html`](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/templates/index.html) (Travel Web UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_web_ui["Travel Web UI<br/>[index.html]"]
  node_frontend["UI Logic<br/>[script.js]"]
  node_api["FastAPI Endpoints<br/>[app.py]"]
end

subgraph group_orchestration["Trip Planning"]
  node_graph["LangGraph Workflow<br/>[backend.py]"]
  node_route["Route Planning<br/>[backend.py]"]
  node_flights["Flight Search<br/>[backend.py]"]
  node_hotels["Hotel Discovery<br/>[backend.py]"]
  node_weather["Weather Planning<br/>[backend.py]"]
  node_itinerary["Itinerary Generation<br/>[backend.py]"]
  node_final["Final Answer and Score<br/>[backend.py]"]
end

subgraph group_integrations["Travel Data Integrations"]
  node_mcp_client["MCP Tool Client<br/>[mcp_client.py]"]
  node_flight_server["Serp Flight MCP"]
  node_weather_server["Weather MCP"]
end

subgraph group_state["Context and Persistence"]
  node_checkpoint["Trip Checkpointing<br/>[backend.py]"]
end

node_traveler(("Traveler"))
node_serpapi["SerpAPI / Google Flights"]
node_tavily["Tavily MCP"]
node_openweather["OpenWeather"]
node_groq["Groq LLM"]
node_postgres[("PostgreSQL")]

node_traveler -->|"enters trip details"| node_web_ui
node_web_ui -->|"loads UI logic"| node_frontend
node_frontend -->|"submits trip or chat"| node_api
node_api -->|"serves application"| node_web_ui
node_api -->|"runs planning"| node_graph
node_graph -->|"dispatches"| node_route
node_graph -->|"dispatches"| node_flights
node_graph -->|"dispatches"| node_hotels
node_graph -->|"dispatches"| node_weather
node_graph -->|"dispatches"| node_itinerary
node_graph -->|"dispatches"| node_final
node_route -->|"then dispatches"| node_flights
node_flights -->|"then dispatches"| node_hotels
node_hotels -->|"then dispatches"| node_weather
node_weather -->|"then dispatches"| node_itinerary
node_itinerary -->|"generates with"| node_groq
node_itinerary -->|"provides plan to"| node_final
node_final -.->|"returns results to"| node_api
node_flights -->|"requests flight tools"| node_mcp_client
node_hotels -->|"requests hotel search"| node_mcp_client
node_weather -->|"requests weather tools"| node_mcp_client
node_mcp_client -->|"starts local server"| node_flight_server
node_flight_server -->|"searches flights"| node_serpapi
node_mcp_client -->|"connects to remote MCP"| node_tavily
node_mcp_client -->|"starts local server"| node_weather_server
node_weather_server -->|"requests weather data"| node_openweather
node_graph -->|"saves trip context"| node_checkpoint
node_checkpoint -->|"persists checkpoints"| node_postgres
node_api -->|"loads saved trip state"| node_checkpoint

click node_web_ui "https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/templates/index.html"
click node_frontend "https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/static/script.js"
click node_api "https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/app.py"
click node_graph "https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/backend.py"
click node_route "https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/backend.py"
click node_flights "https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/backend.py"
click node_hotels "https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/backend.py"
click node_weather "https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/backend.py"
click node_itinerary "https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/backend.py"
click node_final "https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/backend.py"
click node_mcp_client "https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/mcp_client.py"
click node_flight_server "https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/serp_flight_mcp_server.py"
click node_weather_server "https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/custom_weather_mcp_server.py"
click node_checkpoint "https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/backend.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_web_ui,node_frontend,node_api toneBlue
class node_graph,node_route,node_flights,node_hotels,node_weather,node_itinerary,node_final,node_postgres toneAmber
class node_mcp_client,node_flight_server,node_weather_server,node_serpapi toneMint
class node_checkpoint toneRose
class node_traveler,node_tavily,node_openweather,node_groq toneIndigo
```

## Components

### User Interface

- [Travel Web UI](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/templates/index.html): `templates/index.html`
- [UI Logic](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/static/script.js): `static/script.js`
- [FastAPI Endpoints](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/app.py): `app.py`

### Trip Planning

- [LangGraph Workflow](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/backend.py): `backend.py`
- [Route Planning](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/backend.py): `backend.py`
- [Flight Search](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/backend.py): `backend.py`
- [Hotel Discovery](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/backend.py): `backend.py`
- [Weather Planning](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/backend.py): `backend.py`
- [Itinerary Generation](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/backend.py): `backend.py`
- [Final Answer and Score](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/backend.py): `backend.py`

### Travel Data Integrations

- [MCP Tool Client](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/mcp_client.py): `mcp_client.py`
- [Serp Flight MCP](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/serp_flight_mcp_server.py): `serp_flight_mcp_server.py`
- [Weather MCP](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/custom_weather_mcp_server.py): `custom_weather_mcp_server.py`

### Context and Persistence

- [Trip Checkpointing](https://github.com/manish7512/gotrip-ai---a-multi-agent-travel-planner-with-langgraph/blob/main/backend.py): `backend.py`

### Other components

- **Traveler**
- **SerpAPI / Google Flights**
- **Tavily MCP**
- **OpenWeather**
- **Groq LLM**
- **PostgreSQL**

## Connections

- Traveler → Travel Web UI: enters trip details (evidence: `README.md`)
- Travel Web UI → UI Logic: loads UI logic (evidence: `README.md`)
- UI Logic → FastAPI Endpoints: submits trip or chat (evidence: `static/script.js`)
- FastAPI Endpoints → Travel Web UI: serves application (evidence: `app.py`)
- FastAPI Endpoints → LangGraph Workflow: runs planning (evidence: `app.py`)
- LangGraph Workflow → Route Planning: dispatches (evidence: `README.md`)
- LangGraph Workflow → Flight Search: dispatches (evidence: `README.md`)
- LangGraph Workflow → Hotel Discovery: dispatches (evidence: `README.md`)
- LangGraph Workflow → Weather Planning: dispatches (evidence: `README.md`)
- LangGraph Workflow → Itinerary Generation: dispatches (evidence: `README.md`)
- LangGraph Workflow → Final Answer and Score: dispatches (evidence: `README.md`)
- Route Planning → Flight Search: then dispatches (evidence: `README.md`)
- Flight Search → Hotel Discovery: then dispatches (evidence: `README.md`)
- Hotel Discovery → Weather Planning: then dispatches (evidence: `README.md`)
- Weather Planning → Itinerary Generation: then dispatches (evidence: `README.md`)
- Itinerary Generation → Groq LLM: generates with (evidence: `README.md`)
- Itinerary Generation → Final Answer and Score: provides plan to (evidence: `README.md`)
- Final Answer and Score → FastAPI Endpoints: returns results to (evidence: `app.py`)
- Flight Search → MCP Tool Client: requests flight tools (evidence: `README.md`)
- Hotel Discovery → MCP Tool Client: requests hotel search (evidence: `README.md`)
- Weather Planning → MCP Tool Client: requests weather tools (evidence: `README.md`)
- MCP Tool Client → Serp Flight MCP: starts local server (evidence: `mcp_client.py`)
- Serp Flight MCP → SerpAPI / Google Flights: searches flights (evidence: `serp_flight_mcp_server.py`)
- MCP Tool Client → Tavily MCP: connects to remote MCP (evidence: `mcp_client.py`)
- MCP Tool Client → Weather MCP: starts local server (evidence: `mcp_client.py`)
- Weather MCP → OpenWeather: requests weather data (evidence: `custom_weather_mcp_server.py`)
- LangGraph Workflow → Trip Checkpointing: saves trip context (evidence: `README.md`)
- Trip Checkpointing → PostgreSQL: persists checkpoints (evidence: `README.md`)
- FastAPI Endpoints → Trip Checkpointing: loads saved trip state (evidence: `app.py`)
