# vishuu-patil-001/tripmind-ai architecture

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

- Interactive diagram: https://gitdiagram.com/vishuu-patil-001/tripmind-ai
- Repository: https://github.com/vishuu-patil-001/tripmind-ai

## Overview

TripMind AI turns a natural-language trip request into a structured travel plan through a FastAPI entry point and a LangGraph agent workflow. The workflow researches flights, hotels, and weather, then creates an itinerary and final response; destination research is also a documented capability. Supporting layers manage session credentials, LLM access, MCP tools, optional Redis caching, and PostgreSQL checkpoints. Some subsystem connections are documented rather than shown in sampled source, so those links are marked dashed.

Main entry points: [`src/graph/graph.py`](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/graph/graph.py) (Agent Orchestration), [`src/mcp_servers/config.py`](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/mcp_servers/config.py) (MCP Registry), [`app.py`](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/app.py) (FastAPI API), [`src/agents/flight_agent.py`](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/agents/flight_agent.py) (Flight Research)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User Experience"]
  node_web["Web Interface<br/>[app.js]"]
  node_api["FastAPI API<br/>[app.py]"]
  node_validation["Request Validation<br/>[validation.py]"]
  node_sessions[("Session Credentials<br/>[sessions.py]")]
end

subgraph group_workflow["Planning Workflow"]
  node_runner["Workflow Runner<br/>[runner.py]"]
  node_graph["Agent Orchestration<br/>[graph.py]"]
  node_state["Travel State<br/>[state.py]"]
  node_destination["Destination Research<br/>[destination.py]"]
  node_flight["Flight Research<br/>[flight_agent.py]"]
  node_hotel["Hotel Research<br/>[hotel_agent.py]"]
  node_weather["Weather Research<br/>[weather_agent.py]"]
  node_itinerary["Itinerary Generation<br/>[itinerary_agent.py]"]
  node_final["Plan Generation<br/>[final_agent.py]"]
  node_prompts["Agent Prompts<br/>[prompts.py]"]
end

subgraph group_integrations["Research Integrations"]
  node_mcpconfig["MCP Registry<br/>[config.py]"]
  node_localmcp["Local MCP Tools<br/>[local.py]"]
  node_remotemcp["Remote MCP Tools<br/>[remote.py]"]
end

subgraph group_platform["Runtime Services"]
  node_llm["Groq Client<br/>[llm.py]"]
  node_cache[("Redis Cache<br/>[cache.py]")]
  node_checkpointer["Workflow Checkpointer<br/>[checkpointer.py]"]
end

node_traveler(("Traveler"))
node_groq{{"Groq Inference"}}
node_aviation{{"AviationStack"}}
node_weatherapi{{"Weather Data"}}
node_tavily{{"Tavily Research"}}
node_redis[("Redis")]
node_postgres[("PostgreSQL")]

node_traveler -->|"submits trip"| node_web
node_web -.->|"sends request"| node_api
node_api -->|"validates input"| node_validation
node_api -->|"loads credentials"| node_sessions
node_api -->|"starts planning"| node_runner
node_runner -->|"runs workflow"| node_graph
node_graph -->|"dispatches first"| node_flight
node_graph -->|"dispatches next"| node_hotel
node_graph -->|"dispatches next"| node_weather
node_graph -->|"dispatches next"| node_itinerary
node_graph -->|"dispatches last"| node_final
node_runner -->|"initializes state"| node_state
node_graph -->|"shares state"| node_state
node_flight -->|"requests aviation data"| node_localmcp
node_weather -.->|"requests weather"| node_localmcp
node_hotel -.->|"requests hotel research"| node_remotemcp
node_localmcp -->|"loads tools"| node_mcpconfig
node_remotemcp -.->|"loads tools"| node_mcpconfig
node_mcpconfig -->|"connects locally"| node_aviation
node_mcpconfig -->|"connects locally"| node_weatherapi
node_mcpconfig -->|"connects remotely"| node_tavily
node_flight -->|"generates guidance"| node_llm
node_itinerary -.->|"generates itinerary"| node_llm
node_final -.->|"generates plan"| node_llm
node_llm -->|"invokes model"| node_groq
node_flight -->|"uses templates"| node_prompts
node_graph -->|"configures persistence"| node_checkpointer
node_checkpointer -.->|"persists checkpoints"| node_postgres
node_localmcp -->|"caches lookups"| node_cache
node_cache -->|"reads and writes"| node_redis

click node_web "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/frontend/static/js/app.js"
click node_api "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/app.py"
click node_validation "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/api/validation.py"
click node_sessions "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/api/sessions.py"
click node_runner "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/graph/runner.py"
click node_graph "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/graph/graph.py"
click node_state "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/graph/state.py"
click node_destination "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/agents/destination.py"
click node_flight "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/agents/flight_agent.py"
click node_hotel "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/agents/hotel_agent.py"
click node_weather "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/agents/weather_agent.py"
click node_itinerary "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/agents/itinerary_agent.py"
click node_final "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/agents/final_agent.py"
click node_prompts "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/agents/prompts.py"
click node_llm "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/clients/llm.py"
click node_mcpconfig "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/mcp_servers/config.py"
click node_localmcp "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/mcp_servers/local.py"
click node_remotemcp "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/mcp_servers/remote.py"
click node_cache "https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/clients/cache.py"
click node_checkpointer "https://github.com/vishuu-patil-001/tripmind-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_api,node_validation,node_sessions toneBlue
class node_runner,node_graph,node_state,node_destination,node_flight,node_hotel,node_weather,node_itinerary,node_final,node_prompts,node_redis,node_postgres toneAmber
class node_mcpconfig,node_localmcp,node_remotemcp toneMint
class node_llm,node_cache,node_checkpointer toneRose
class node_traveler,node_groq,node_aviation,node_weatherapi,node_tavily toneIndigo
```

## Components

### User Experience

- [Web Interface](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/frontend/static/js/app.js): `frontend/static/js/app.js`
- [FastAPI API](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/app.py): `app.py`
- [Request Validation](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/api/validation.py): `src/api/validation.py`
- [Session Credentials](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/api/sessions.py): `src/api/sessions.py`

### Planning Workflow

- [Workflow Runner](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/graph/runner.py): `src/graph/runner.py`
- [Agent Orchestration](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/graph/graph.py): `src/graph/graph.py`
- [Travel State](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/graph/state.py): `src/graph/state.py`
- [Destination Research](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/agents/destination.py): `src/agents/destination.py`
- [Flight Research](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/agents/flight_agent.py): `src/agents/flight_agent.py`
- [Hotel Research](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/agents/hotel_agent.py): `src/agents/hotel_agent.py`
- [Weather Research](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/agents/weather_agent.py): `src/agents/weather_agent.py`
- [Itinerary Generation](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/agents/itinerary_agent.py): `src/agents/itinerary_agent.py`
- [Plan Generation](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/agents/final_agent.py): `src/agents/final_agent.py`
- [Agent Prompts](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/agents/prompts.py): `src/agents/prompts.py`

### Research Integrations

- [MCP Registry](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/mcp_servers/config.py): `src/mcp_servers/config.py`
- [Local MCP Tools](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/mcp_servers/local.py): `src/mcp_servers/local.py`
- [Remote MCP Tools](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/mcp_servers/remote.py): `src/mcp_servers/remote.py`

### Runtime Services

- [Groq Client](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/clients/llm.py): `src/clients/llm.py`
- [Redis Cache](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/clients/cache.py): `src/clients/cache.py`
- [Workflow Checkpointer](https://github.com/vishuu-patil-001/tripmind-ai/blob/main/src/clients/checkpointer.py): `src/clients/checkpointer.py`

### Other components

- **Traveler**
- **Groq Inference**
- **AviationStack**
- **Weather Data**
- **Tavily Research**
- **Redis**
- **PostgreSQL**

## Connections

- Traveler → Web Interface: submits trip (evidence: `README.md`)
- Web Interface → FastAPI API: sends request
- FastAPI API → Request Validation: validates input (evidence: `app.py`)
- FastAPI API → Session Credentials: loads credentials (evidence: `app.py`)
- FastAPI API → Workflow Runner: starts planning (evidence: `app.py`)
- Workflow Runner → Agent Orchestration: runs workflow (evidence: `src/graph/runner.py`)
- Agent Orchestration → Flight Research: dispatches first (evidence: `src/graph/graph.py`)
- Agent Orchestration → Hotel Research: dispatches next (evidence: `src/graph/graph.py`)
- Agent Orchestration → Weather Research: dispatches next (evidence: `src/graph/graph.py`)
- Agent Orchestration → Itinerary Generation: dispatches next (evidence: `src/graph/graph.py`)
- Agent Orchestration → Plan Generation: dispatches last (evidence: `src/graph/graph.py`)
- Workflow Runner → Travel State: initializes state (evidence: `src/graph/runner.py`)
- Agent Orchestration → Travel State: shares state (evidence: `src/graph/graph.py`)
- Flight Research → Local MCP Tools: requests aviation data (evidence: `src/agents/flight_agent.py`)
- Weather Research → Local MCP Tools: requests weather (evidence: `src/agents/weather_agent.py`)
- Hotel Research → Remote MCP Tools: requests hotel research (evidence: `src/agents/hotel_agent.py`)
- Local MCP Tools → MCP Registry: loads tools (evidence: `src/mcp_servers/local.py`)
- Remote MCP Tools → MCP Registry: loads tools (evidence: `src/mcp_servers/remote.py`)
- MCP Registry → AviationStack: connects locally (evidence: `src/mcp_servers/config.py`)
- MCP Registry → Weather Data: connects locally (evidence: `src/mcp_servers/config.py`)
- MCP Registry → Tavily Research: connects remotely (evidence: `src/mcp_servers/config.py`)
- Flight Research → Groq Client: generates guidance (evidence: `src/agents/flight_agent.py`)
- Itinerary Generation → Groq Client: generates itinerary (evidence: `src/agents/itinerary_agent.py`)
- Plan Generation → Groq Client: generates plan (evidence: `src/agents/final_agent.py`)
- Groq Client → Groq Inference: invokes model (evidence: `src/clients/llm.py`)
- Flight Research → Agent Prompts: uses templates (evidence: `src/agents/flight_agent.py`)
- Agent Orchestration → Workflow Checkpointer: configures persistence (evidence: `src/graph/graph.py`)
- Workflow Checkpointer → PostgreSQL: persists checkpoints (evidence: `README.md`)
- Local MCP Tools → Redis Cache: caches lookups (evidence: `src/mcp_servers/local.py`)
- Redis Cache → Redis: reads and writes (evidence: `src/clients/cache.py`)
