# shubham-bs/lazytravel-ai architecture

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

- Interactive diagram: https://gitdiagram.com/shubham-bs/lazytravel-ai
- Repository: https://github.com/shubham-bs/lazytravel-ai

## Overview

LazyTravel AI turns a plain-language trip request into flight, hotel, weather, itinerary, budget, and recommendation results, with saved conversations for follow-ups. The browser-facing API handles per-session credentials and invokes a LangGraph runner; the graph’s domain stages are represented from the README and module layout, but its internal wiring was not excerpted. Dashed edges mark those unverified links. The README describes the major planning capabilities; specific external-provider calls are omitted where source evidence was unavailable.

Main entry points: [`src/graph/graph.py`](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/graph/graph.py) (Travel graph), [`app.py`](https://github.com/shubham-bs/lazytravel-ai/blob/main/app.py) (FastAPI application), [`src/config/session.py`](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/config/session.py) (Credential resolution), [`src/graph/runner.py`](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/graph/runner.py) (Graph runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_web["Web interface<br/>[app.js]"]
  node_page["Planner page<br/>[index.html]"]
end

subgraph group_api["API and credentials"]
  node_api_app["FastAPI application<br/>[app.py]"]
  node_credential_api["Session credentials<br/>[sessions.py]"]
  node_credential_checks["Credential validation<br/>[validation.py]"]
  node_credential_context["Credential resolution<br/>[session.py]"]
  node_settings["Application settings<br/>[settings.py]"]
end

subgraph group_planning["Travel planning"]
  node_runner["Graph runner<br/>[runner.py]"]
  node_graph["Travel graph<br/>[graph.py]"]
  node_state["Trip state<br/>[state.py]"]
  node_destination["Destination research<br/>[destination.py]"]
  node_flights["Flight research<br/>[flight_agent.py]"]
  node_hotels["Hotel research<br/>[hotel_agent.py]"]
  node_weather["Weather research<br/>[weather_agent.py]"]
  node_itinerary["Itinerary planning<br/>[itinerary_agent.py]"]
  node_final["Final response<br/>[final_agent.py]"]
  node_prompts["Agent prompts<br/>[prompts.py]"]
end

subgraph group_platform["Runtime services"]
  node_mcp_local["Local MCP tools<br/>[local.py]"]
  node_mcp_config["MCP configuration<br/>[config.py]"]
  node_llm["Groq model client<br/>[llm.py]"]
  node_cache[("Response cache<br/>[cache.py]")]
  node_checkpointer[("Conversation checkpointing<br/>[checkpointer.py]")]
end

node_traveler(("Traveler"))
node_postgres[("PostgreSQL")]

node_traveler -->|"describes trip"| node_web
node_web -.->|"uses page"| node_page
node_api_app -->|"renders page"| node_page
node_api_app -->|"manages credentials"| node_credential_api
node_api_app -->|"validates keys"| node_credential_checks
node_api_app -->|"binds credentials"| node_credential_context
node_api_app -->|"runs planning"| node_runner
node_api_app -->|"reports status"| node_cache
node_credential_api -->|"creates credentials"| node_credential_context
node_credential_checks -->|"normalizes database URL"| node_settings
node_credential_context -->|"resolves fallback"| node_settings
node_runner -->|"requires keys"| node_credential_context
node_runner -->|"invokes graph"| node_graph
node_runner -->|"creates initial state"| node_state
node_graph -.->|"dispatches research"| node_destination
node_graph -.->|"dispatches research"| node_flights
node_graph -.->|"dispatches research"| node_hotels
node_graph -.->|"dispatches research"| node_weather
node_graph -.->|"dispatches planning"| node_itinerary
node_graph -.->|"dispatches response"| node_final
node_weather -->|"uses destination"| node_destination
node_weather -->|"uses weather tools"| node_mcp_local
node_itinerary -->|"uses prompts"| node_prompts
node_itinerary -->|"calls model"| node_llm
node_final -->|"uses prompts"| node_prompts
node_final -->|"calls model"| node_llm
node_llm -->|"resolves key"| node_credential_context
node_credential_context -.->|"configures persistence"| node_checkpointer
node_checkpointer -.->|"stores checkpoints"| node_postgres
node_mcp_local -.->|"uses configuration"| node_mcp_config

click node_web "https://github.com/shubham-bs/lazytravel-ai/blob/main/frontend/static/js/app.js"
click node_page "https://github.com/shubham-bs/lazytravel-ai/blob/main/frontend/templates/index.html"
click node_api_app "https://github.com/shubham-bs/lazytravel-ai/blob/main/app.py"
click node_credential_api "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/api/sessions.py"
click node_credential_checks "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/api/validation.py"
click node_credential_context "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/config/session.py"
click node_settings "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/config/settings.py"
click node_runner "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/graph/runner.py"
click node_graph "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/graph/graph.py"
click node_state "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/graph/state.py"
click node_destination "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/agents/destination.py"
click node_flights "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/agents/flight_agent.py"
click node_hotels "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/agents/hotel_agent.py"
click node_weather "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/agents/weather_agent.py"
click node_itinerary "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/agents/itinerary_agent.py"
click node_final "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/agents/final_agent.py"
click node_prompts "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/agents/prompts.py"
click node_mcp_local "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/mcp_servers/local.py"
click node_mcp_config "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/mcp_servers/config.py"
click node_llm "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/clients/llm.py"
click node_cache "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/clients/cache.py"
click node_checkpointer "https://github.com/shubham-bs/lazytravel-ai/blob/main/src/clients/checkpointer.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,node_page toneBlue
class node_api_app,node_credential_api,node_credential_checks,node_credential_context,node_settings,node_postgres toneAmber
class node_runner,node_graph,node_state,node_destination,node_flights,node_hotels,node_weather,node_itinerary,node_final,node_prompts toneMint
class node_mcp_local,node_mcp_config,node_llm,node_cache,node_checkpointer toneRose
class node_traveler toneIndigo
```

## Components

### User experience

- [Web interface](https://github.com/shubham-bs/lazytravel-ai/blob/main/frontend/static/js/app.js): `frontend/static/js/app.js`
- [Planner page](https://github.com/shubham-bs/lazytravel-ai/blob/main/frontend/templates/index.html): `frontend/templates/index.html`

### API and credentials

- [FastAPI application](https://github.com/shubham-bs/lazytravel-ai/blob/main/app.py): `app.py`
- [Session credentials](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/api/sessions.py): `src/api/sessions.py`
- [Credential validation](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/api/validation.py): `src/api/validation.py`
- [Credential resolution](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/config/session.py): `src/config/session.py`
- [Application settings](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/config/settings.py): `src/config/settings.py`

### Travel planning

- [Graph runner](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/graph/runner.py): `src/graph/runner.py`
- [Travel graph](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/graph/graph.py): `src/graph/graph.py`
- [Trip state](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/graph/state.py): `src/graph/state.py`
- [Destination research](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/agents/destination.py): `src/agents/destination.py`
- [Flight research](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/agents/flight_agent.py): `src/agents/flight_agent.py`
- [Hotel research](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/agents/hotel_agent.py): `src/agents/hotel_agent.py`
- [Weather research](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/agents/weather_agent.py): `src/agents/weather_agent.py`
- [Itinerary planning](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/agents/itinerary_agent.py): `src/agents/itinerary_agent.py`
- [Final response](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/agents/final_agent.py): `src/agents/final_agent.py`
- [Agent prompts](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/agents/prompts.py): `src/agents/prompts.py`

### Runtime services

- [Local MCP tools](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/mcp_servers/local.py): `src/mcp_servers/local.py`
- [MCP configuration](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/mcp_servers/config.py): `src/mcp_servers/config.py`
- [Groq model client](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/clients/llm.py): `src/clients/llm.py`
- [Response cache](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/clients/cache.py): `src/clients/cache.py`
- [Conversation checkpointing](https://github.com/shubham-bs/lazytravel-ai/blob/main/src/clients/checkpointer.py): `src/clients/checkpointer.py`

### Other components

- **Traveler**
- **PostgreSQL**

## Connections

- Traveler → Web interface: describes trip (evidence: `README.md`)
- Web interface → Planner page: uses page
- FastAPI application → Planner page: renders page (evidence: `app.py`)
- FastAPI application → Session credentials: manages credentials (evidence: `app.py`)
- FastAPI application → Credential validation: validates keys (evidence: `app.py`)
- FastAPI application → Credential resolution: binds credentials (evidence: `app.py`)
- FastAPI application → Graph runner: runs planning (evidence: `app.py`)
- FastAPI application → Response cache: reports status (evidence: `app.py`)
- Session credentials → Credential resolution: creates credentials (evidence: `src/api/sessions.py`)
- Credential validation → Application settings: normalizes database URL (evidence: `src/api/validation.py`)
- Credential resolution → Application settings: resolves fallback (evidence: `src/config/session.py`)
- Graph runner → Credential resolution: requires keys (evidence: `src/graph/runner.py`)
- Graph runner → Travel graph: invokes graph (evidence: `src/graph/runner.py`)
- Graph runner → Trip state: creates initial state (evidence: `src/graph/runner.py`)
- Travel graph → Destination research: dispatches research
- Travel graph → Flight research: dispatches research
- Travel graph → Hotel research: dispatches research
- Travel graph → Weather research: dispatches research
- Travel graph → Itinerary planning: dispatches planning
- Travel graph → Final response: dispatches response
- Weather research → Destination research: uses destination (evidence: `src/agents/weather_agent.py`)
- Weather research → Local MCP tools: uses weather tools (evidence: `src/agents/weather_agent.py`)
- Itinerary planning → Agent prompts: uses prompts (evidence: `src/agents/itinerary_agent.py`)
- Itinerary planning → Groq model client: calls model (evidence: `src/agents/itinerary_agent.py`)
- Final response → Agent prompts: uses prompts (evidence: `src/agents/final_agent.py`)
- Final response → Groq model client: calls model (evidence: `src/agents/final_agent.py`)
- Groq model client → Credential resolution: resolves key (evidence: `src/clients/llm.py`)
- Credential resolution → Conversation checkpointing: configures persistence (evidence: `src/clients/checkpointer.py`)
- Conversation checkpointing → PostgreSQL: stores checkpoints
- Local MCP tools → MCP configuration: uses configuration
