# feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt architecture

> Architecture diagram of the GitHub repository feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt
- Repository: https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt

## Overview

This repository implements a scheduled food-delivery analytics platform: CSV data is staged in S3, loaded to Snowflake, transformed through dbt staging and marts, and exposed through AI-powered review and warehouse-query apps. The Airflow DAG orders the daily load, core build, review enrichment, and AI build. RAG and text-to-SQL are interactive paths alongside the scheduled pipeline. Some capabilities and model lineage are documented in the README but their source was not sampled, so only documented connections are shown.

Main entry points: [`airflow/dags/zomato_batch.py`](https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/airflow/dags/zomato_batch.py) (Daily DAG), [`ai/enrich_reviews.py`](https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/ai/enrich_reviews.py) (Review enrichment), [`ai/rag_chat.py`](https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/ai/rag_chat.py) (Review RAG app), [`ai/text_to_sql.py`](https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/ai/text_to_sql.py) (Text-to-SQL app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Ingestion and warehouse"]
  node_aws["AWS IAM access"]
  node_snowflake_setup["Snowflake setup<br/>[01_setup.sql]"]
  node_stage["External stage"]
  node_raw[("Snowflake RAW<br/>[04_raw_table.sql]")]
end

subgraph group_transform["dbt transformations"]
  node_staging["dbt staging"]
  node_marts[("dbt marts")]
end

subgraph group_orchestrate["Daily orchestration"]
  node_dag["Daily DAG<br/>[zomato_batch.py]"]
end

subgraph group_ai["AI capabilities"]
  node_enrichment["Review enrichment<br/>[enrich_reviews.py]"]
  node_ai_table[("Enriched reviews<br/>[enrich_reviews.py]")]
end

subgraph group_serve["Interactive analytics"]
  node_rag["Review RAG app<br/>[rag_chat.py]"]
  node_textsql["Text-to-SQL app<br/>[text_to_sql.py]"]
end

node_csv["CSV data"]
node_s3[("Amazon S3")]
node_gemini["Gemini API"]
node_stakeholder(("Analytics user"))

node_csv -->|"uploaded as"| node_s3
node_aws -.->|"authorizes access"| node_stage
node_snowflake_setup -->|"sets up"| node_stage
node_stage -->|"reads files"| node_s3
node_dag -->|"runs COPY INTO"| node_raw
node_s3 -->|"loads CSVs"| node_raw
node_dag -->|"runs core build"| node_staging
node_raw -->|"dbt reads"| node_staging
node_staging -->|"dbt transforms"| node_marts
node_dag -->|"runs task"| node_enrichment
node_enrichment -->|"reads reviews"| node_raw
node_enrichment -->|"classifies reviews"| node_gemini
node_enrichment -->|"writes labels"| node_ai_table
node_dag -->|"runs AI build"| node_marts
node_ai_table -->|"feeds AI models"| node_marts
node_stakeholder -->|"asks review question"| node_rag
node_rag -->|"samples reviews"| node_staging
node_rag -->|"embeds and answers"| node_gemini
node_rag -->|"returns answer and sources"| node_stakeholder
node_stakeholder -->|"asks data question"| node_textsql
node_textsql -->|"generates SQL"| node_gemini
node_textsql -->|"executes guarded query"| node_marts
node_textsql -->|"returns results"| node_stakeholder

click node_aws "https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/tree/main/aws"
click node_snowflake_setup "https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/snowflake/01_setup.sql"
click node_stage "https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/snowflake/03_stage_and_formats.sql"
click node_raw "https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/snowflake/04_raw_table.sql"
click node_staging "https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/tree/main/zomato/models/staging"
click node_marts "https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/tree/main/zomato/models/marts"
click node_dag "https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/airflow/dags/zomato_batch.py"
click node_enrichment "https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/ai/enrich_reviews.py"
click node_ai_table "https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/ai/enrich_reviews.py"
click node_rag "https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/ai/rag_chat.py"
click node_textsql "https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/ai/text_to_sql.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_aws,node_snowflake_setup,node_stage,node_raw,node_stakeholder toneBlue
class node_staging,node_marts,node_s3 toneAmber
class node_dag,node_gemini toneMint
class node_enrichment,node_ai_table toneRose
class node_rag,node_textsql,node_csv toneIndigo
```

## Components

### Ingestion and warehouse

- [AWS IAM access](https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/tree/main/aws): `aws`
- [Snowflake setup](https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/snowflake/01_setup.sql): `snowflake/01_setup.sql`
- [External stage](https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/snowflake/03_stage_and_formats.sql): `snowflake/03_stage_and_formats.sql`
- [Snowflake RAW](https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/snowflake/04_raw_table.sql): `snowflake/04_raw_table.sql`

### dbt transformations

- [dbt staging](https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/tree/main/zomato/models/staging): `zomato/models/staging`
- [dbt marts](https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/tree/main/zomato/models/marts): `zomato/models/marts`

### Daily orchestration

- [Daily DAG](https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/airflow/dags/zomato_batch.py): `airflow/dags/zomato_batch.py`

### AI capabilities

- [Review enrichment](https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/ai/enrich_reviews.py): `ai/enrich_reviews.py`
- [Enriched reviews](https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/ai/enrich_reviews.py): `ai/enrich_reviews.py`

### Interactive analytics

- [Review RAG app](https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/ai/rag_chat.py): `ai/rag_chat.py`
- [Text-to-SQL app](https://github.com/feritbulut/zomato-ai-data-pipeline-with-aws-snowflake-airflow-dbt/blob/main/ai/text_to_sql.py): `ai/text_to_sql.py`

### Other components

- **CSV data**
- **Amazon S3**
- **Gemini API**
- **Analytics user**

## Connections

- CSV data → Amazon S3: uploaded as
- AWS IAM access → External stage: authorizes access
- Snowflake setup → External stage: sets up
- External stage → Amazon S3: reads files
- Daily DAG → Snowflake RAW: runs COPY INTO
- Amazon S3 → Snowflake RAW: loads CSVs
- Daily DAG → dbt staging: runs core build
- Snowflake RAW → dbt staging: dbt reads
- dbt staging → dbt marts: dbt transforms
- Daily DAG → Review enrichment: runs task
- Review enrichment → Snowflake RAW: reads reviews
- Review enrichment → Gemini API: classifies reviews
- Review enrichment → Enriched reviews: writes labels
- Daily DAG → dbt marts: runs AI build
- Enriched reviews → dbt marts: feeds AI models
- Analytics user → Review RAG app: asks review question
- Review RAG app → dbt staging: samples reviews
- Review RAG app → Gemini API: embeds and answers
- Review RAG app → Analytics user: returns answer and sources
- Analytics user → Text-to-SQL app: asks data question
- Text-to-SQL app → Gemini API: generates SQL
- Text-to-SQL app → dbt marts: executes guarded query
- Text-to-SQL app → Analytics user: returns results
