# snzhk-aly/travel-ai architecture

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

- Interactive diagram: https://gitdiagram.com/snzhk-aly/travel-ai
- Repository: https://github.com/snzhk-aly/travel-ai

## Overview

Travel AI is a Russian travel-organization catalog search application. Users submit a natural-language query or filters through the web interface; the API parses intent and exposes catalog search and discovery endpoints. The sampled code shows rule/LLM intent parsing, dataset-path configuration, and LLM-backed response generation, alongside health, metadata, and city recommendations. The README provides no capability details, and the HTML and dataset contents were not sampled, so frontend wiring and several runtime relationships remain unverified.

Main entry points: [`main.py`](https://github.com/snzhk-aly/travel-ai/blob/main/main.py) (API Routes), [`static/index.html`](https://github.com/snzhk-aly/travel-ai/blob/main/static/index.html) (Web Interface), [`travel_ai_russia_dataset.json`](https://github.com/snzhk-aly/travel-ai/blob/main/travel_ai_russia_dataset.json) (Organization Catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User Interface"]
  node_web["Web Interface<br/>[index.html]"]
end

subgraph group_api["Catalog API"]
  node_api_routes["API Routes<br/>[main.py]"]
  node_health["Health Status<br/>[main.py]"]
  node_metadata["Catalog Metadata<br/>[main.py]"]
  node_recommendations["City Recommendations<br/>[main.py]"]
end

subgraph group_search["Search Intelligence"]
  node_intent_parser["Intent Parsing<br/>[main.py]"]
  node_rule_parser["Rule Parsing<br/>[main.py]"]
  node_record_prep["Record Preparation<br/>[main.py]"]
  node_ranking["Search Ranking<br/>[main.py]"]
  node_response_generation["Response Generation<br/>[main.py]"]
end

subgraph group_data["Catalog Data"]
  node_catalog[("Organization Catalog")]
  node_alternate_dataset[("Alternate Dataset<br/>[dataset_rf.json]")]
end

subgraph group_integrations["LLM Integration"]
  node_llm_client["LLM Client<br/>[main.py]"]
end

node_traveler(("Traveler"))
node_llm_service{{"LLM Service"}}

node_traveler -.->|"uses"| node_web
node_web -.->|"requests"| node_api_routes
node_api_routes -->|"parses query"| node_intent_parser
node_intent_parser -->|"uses fallback"| node_rule_parser
node_api_routes -->|"requests response"| node_llm_client
node_llm_client -->|"calls"| node_llm_service
node_api_routes -.->|"reads catalog"| node_catalog
node_api_routes -->|"serves"| node_health
node_api_routes -->|"serves"| node_metadata
node_api_routes -->|"serves"| node_recommendations
node_api_routes -.->|"searches"| node_ranking
node_api_routes -.->|"generates reply"| node_response_generation

click node_web "https://github.com/snzhk-aly/travel-ai/blob/main/static/index.html"
click node_api_routes "https://github.com/snzhk-aly/travel-ai/blob/main/main.py"
click node_health "https://github.com/snzhk-aly/travel-ai/blob/main/main.py"
click node_metadata "https://github.com/snzhk-aly/travel-ai/blob/main/main.py"
click node_recommendations "https://github.com/snzhk-aly/travel-ai/blob/main/main.py"
click node_intent_parser "https://github.com/snzhk-aly/travel-ai/blob/main/main.py"
click node_rule_parser "https://github.com/snzhk-aly/travel-ai/blob/main/main.py"
click node_record_prep "https://github.com/snzhk-aly/travel-ai/blob/main/main.py"
click node_ranking "https://github.com/snzhk-aly/travel-ai/blob/main/main.py"
click node_response_generation "https://github.com/snzhk-aly/travel-ai/blob/main/main.py"
click node_catalog "https://github.com/snzhk-aly/travel-ai/blob/main/travel_ai_russia_dataset.json"
click node_alternate_dataset "https://github.com/snzhk-aly/travel-ai/blob/main/dataset_rf.json"
click node_llm_client "https://github.com/snzhk-aly/travel-ai/blob/main/main.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 toneBlue
class node_api_routes,node_health,node_metadata,node_recommendations toneAmber
class node_intent_parser,node_rule_parser,node_record_prep,node_ranking,node_response_generation toneMint
class node_catalog,node_alternate_dataset toneRose
class node_llm_client,node_traveler,node_llm_service toneIndigo
```

## Components

### User Interface

- [Web Interface](https://github.com/snzhk-aly/travel-ai/blob/main/static/index.html): `static/index.html`

### Catalog API

- [API Routes](https://github.com/snzhk-aly/travel-ai/blob/main/main.py): `main.py`
- [Health Status](https://github.com/snzhk-aly/travel-ai/blob/main/main.py): `main.py`
- [Catalog Metadata](https://github.com/snzhk-aly/travel-ai/blob/main/main.py): `main.py`
- [City Recommendations](https://github.com/snzhk-aly/travel-ai/blob/main/main.py): `main.py`

### Search Intelligence

- [Intent Parsing](https://github.com/snzhk-aly/travel-ai/blob/main/main.py): `main.py`
- [Rule Parsing](https://github.com/snzhk-aly/travel-ai/blob/main/main.py): `main.py`
- [Record Preparation](https://github.com/snzhk-aly/travel-ai/blob/main/main.py): `main.py`
- [Search Ranking](https://github.com/snzhk-aly/travel-ai/blob/main/main.py): `main.py`
- [Response Generation](https://github.com/snzhk-aly/travel-ai/blob/main/main.py): `main.py`

### Catalog Data

- [Organization Catalog](https://github.com/snzhk-aly/travel-ai/blob/main/travel_ai_russia_dataset.json): `travel_ai_russia_dataset.json`
- [Alternate Dataset](https://github.com/snzhk-aly/travel-ai/blob/main/dataset_rf.json): `dataset_rf.json`

### LLM Integration

- [LLM Client](https://github.com/snzhk-aly/travel-ai/blob/main/main.py): `main.py`

### Other components

- **Traveler**
- **LLM Service**

## Connections

- Traveler → Web Interface: uses
- Web Interface → API Routes: requests
- API Routes → Intent Parsing: parses query (evidence: `main.py`)
- Intent Parsing → Rule Parsing: uses fallback (evidence: `main.py`)
- API Routes → LLM Client: requests response (evidence: `main.py`)
- LLM Client → LLM Service: calls (evidence: `main.py`)
- API Routes → Organization Catalog: reads catalog
- API Routes → Health Status: serves (evidence: `main.py`)
- API Routes → Catalog Metadata: serves (evidence: `main.py`)
- API Routes → City Recommendations: serves (evidence: `main.py`)
- API Routes → Search Ranking: searches (evidence: `main.py`)
- API Routes → Response Generation: generates reply (evidence: `main.py`)
