# chandukudikala-06/travelmate-ai architecture

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

- Interactive diagram: https://gitdiagram.com/chandukudikala-06/travelmate-ai
- Repository: https://github.com/chandukudikala-06/travelmate-ai

## Overview

TravelMate-AI accepts a travel request in a browser, runs a sequential LangGraph workflow to gather flight and hotel information and produce an itinerary and final answer, then returns the result to the interface. The graph also shows persistent conversation checkpoints and the interface’s PDF export capability. Relationships are based on the supplied excerpts and README; template and styling details were not sampled.

Main entry points: [`app.py`](https://github.com/chandukudikala-06/travelmate-ai/blob/main/app.py) (FastAPI routes), [`backend.py`](https://github.com/chandukudikala-06/travelmate-ai/blob/main/backend.py) (Workflow runner), [`templates/index.html`](https://github.com/chandukudikala-06/travelmate-ai/blob/main/templates/index.html) (Travel interface), [`static/script.js`](https://github.com/chandukudikala-06/travelmate-ai/blob/main/static/script.js) (Request and export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Web interface"]
  node_browser["Travel interface<br/>[index.html]"]
  node_browser_script["Request and export<br/>[script.js]"]
  node_browser_style["Interface styling<br/>[style.css]"]
end

subgraph group_service["API service"]
  node_api["FastAPI routes<br/>[app.py]"]
end

subgraph group_planning["Travel planning"]
  node_runner["Workflow runner<br/>[backend.py]"]
  node_flight_agent["Flight search stage<br/>[backend.py]"]
  node_hotel_agent["Hotel search stage<br/>[backend.py]"]
  node_itinerary_agent["Itinerary stage<br/>[backend.py]"]
  node_final_agent["Final response stage<br/>[backend.py]"]
  node_flight_tool["Flight lookup<br/>[flight_tool.py]"]
  node_hotel_tool["Web search<br/>[tavily_tool.py]"]
end

subgraph group_integrations["External services"]
  node_postgres[("PostgreSQL checkpoints")]
  node_groq["Groq language model"]
  node_aviationstack["AviationStack API"]
  node_tavily["Tavily search"]
end

node_traveler(("Traveler"))

node_traveler -.->|"enters request"| node_browser
node_browser_script -->|"posts request"| node_api
node_api -->|"renders page"| node_browser
node_api -->|"runs workflow"| node_runner
node_runner -->|"starts graph"| node_flight_agent
node_flight_agent -->|"dispatches next"| node_hotel_agent
node_hotel_agent -->|"dispatches next"| node_itinerary_agent
node_itinerary_agent -->|"dispatches next"| node_final_agent
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 -->|"queries search"| node_tavily
node_itinerary_agent -->|"generates itinerary"| node_groq
node_final_agent -->|"generates answer"| node_groq
node_runner -->|"persists checkpoints"| node_postgres
node_browser_script -->|"exports PDF"| node_browser

click node_browser "https://github.com/chandukudikala-06/travelmate-ai/blob/main/templates/index.html"
click node_browser_script "https://github.com/chandukudikala-06/travelmate-ai/blob/main/static/script.js"
click node_browser_style "https://github.com/chandukudikala-06/travelmate-ai/blob/main/static/style.css"
click node_api "https://github.com/chandukudikala-06/travelmate-ai/blob/main/app.py"
click node_runner "https://github.com/chandukudikala-06/travelmate-ai/blob/main/backend.py"
click node_flight_agent "https://github.com/chandukudikala-06/travelmate-ai/blob/main/backend.py"
click node_hotel_agent "https://github.com/chandukudikala-06/travelmate-ai/blob/main/backend.py"
click node_itinerary_agent "https://github.com/chandukudikala-06/travelmate-ai/blob/main/backend.py"
click node_final_agent "https://github.com/chandukudikala-06/travelmate-ai/blob/main/backend.py"
click node_flight_tool "https://github.com/chandukudikala-06/travelmate-ai/blob/main/tools/flight_tool.py"
click node_hotel_tool "https://github.com/chandukudikala-06/travelmate-ai/blob/main/tools/tavily_tool.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_browser,node_browser_script,node_browser_style toneBlue
class node_api toneAmber
class node_runner,node_flight_agent,node_hotel_agent,node_itinerary_agent,node_final_agent,node_flight_tool,node_hotel_tool toneMint
class node_postgres,node_groq,node_aviationstack,node_tavily toneRose
class node_traveler toneIndigo
```

## Components

### Web interface

- [Travel interface](https://github.com/chandukudikala-06/travelmate-ai/blob/main/templates/index.html): `templates/index.html`
- [Request and export](https://github.com/chandukudikala-06/travelmate-ai/blob/main/static/script.js): `static/script.js`
- [Interface styling](https://github.com/chandukudikala-06/travelmate-ai/blob/main/static/style.css): `static/style.css`

### API service

- [FastAPI routes](https://github.com/chandukudikala-06/travelmate-ai/blob/main/app.py): `app.py`

### Travel planning

- [Workflow runner](https://github.com/chandukudikala-06/travelmate-ai/blob/main/backend.py): `backend.py`
- [Flight search stage](https://github.com/chandukudikala-06/travelmate-ai/blob/main/backend.py): `backend.py`
- [Hotel search stage](https://github.com/chandukudikala-06/travelmate-ai/blob/main/backend.py): `backend.py`
- [Itinerary stage](https://github.com/chandukudikala-06/travelmate-ai/blob/main/backend.py): `backend.py`
- [Final response stage](https://github.com/chandukudikala-06/travelmate-ai/blob/main/backend.py): `backend.py`
- [Flight lookup](https://github.com/chandukudikala-06/travelmate-ai/blob/main/tools/flight_tool.py): `tools/flight_tool.py`
- [Web search](https://github.com/chandukudikala-06/travelmate-ai/blob/main/tools/tavily_tool.py): `tools/tavily_tool.py`

### External services

- **PostgreSQL checkpoints**
- **Groq language model**
- **AviationStack API**
- **Tavily search**

### Other components

- **Traveler**

## Connections

- Traveler → Travel interface: enters request
- Request and export → FastAPI routes: posts request (evidence: `static/script.js`)
- FastAPI routes → Travel interface: renders page (evidence: `app.py`)
- FastAPI routes → Workflow runner: runs workflow (evidence: `app.py`)
- Workflow runner → Flight search stage: starts graph (evidence: `backend.py`)
- Flight search stage → Hotel search stage: dispatches next (evidence: `backend.py`)
- Hotel search stage → Itinerary stage: dispatches next (evidence: `backend.py`)
- Itinerary stage → Final response stage: dispatches next (evidence: `backend.py`)
- Flight search stage → Flight lookup: searches flights (evidence: `backend.py`)
- Flight lookup → AviationStack API: requests flight data (evidence: `tools/flight_tool.py`)
- Hotel search stage → Web search: searches hotels (evidence: `backend.py`)
- Web search → Tavily search: queries search (evidence: `tools/tavily_tool.py`)
- Itinerary stage → Groq language model: generates itinerary (evidence: `backend.py`)
- Final response stage → Groq language model: generates answer (evidence: `backend.py`)
- Workflow runner → PostgreSQL checkpoints: persists checkpoints (evidence: `backend.py`)
- Request and export → Travel interface: exports PDF (evidence: `static/script.js`)
