# mahesh-pepali/zepto-data-ai-platform architecture

> Architecture diagram of the GitHub repository mahesh-pepali/zepto-data-ai-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mahesh-pepali/zepto-data-ai-platform
- Repository: https://github.com/mahesh-pepali/zepto-data-ai-platform
- Video tour (about a minute): https://gitdiagram.com/mahesh-pepali/zepto-data-ai-platform/video

## Overview

The repository is a collection of three largely independent data/AI modules: a book-data pipeline, Titanic analytics and modeling, and a policy-support assistant. The main user-facing runtime is the assistant’s /ask API, which routes policy questions through retrieval and response generation. The README documents additional analytics and pipeline capabilities; their code paths are represented at module level where appropriate. Support-assistant wiring is based on sampled source; its README excerpt ends before the detailed module documentation.

Main entry points: [`support_assistant/code/graph.py`](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/support_assistant/code/graph.py) (Intent and answer workflow), [`analytics/code/01_eda.py`](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/analytics/code/01_eda.py) (EDA and cleaning), [`analytics/code/03_finalize.py`](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/analytics/code/03_finalize.py) (Finalize model), [`support_assistant/code/ingest.py`](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/support_assistant/code/ingest.py) (Embed and ingest policies)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["Book Data Pipeline"]
  node_scraper["Scrape and clean<br/>[scraper.py]"]
  node_clean_books["Cleaned books CSV<br/>[books_cleaned.csv]"]
  node_database_builder["Build SQLite database<br/>[database.py]"]
  node_books_db[("Books database<br/>[books.db]")]
  node_book_analysis["SQL and Pandas analysis<br/>[queries.py]"]
end

subgraph group_analytics["Titanic Analytics"]
  node_eda["EDA and cleaning<br/>[01_eda.py]"]
  node_raw_titanic["Raw Titanic data<br/>[titanic_raw.csv]"]
  node_clean_titanic["Cleaned Titanic data"]
  node_analysis_outputs["EDA visualizations"]
  node_modeling["Modeling and evaluation<br/>[02_modeling.py]"]
  node_model_artifacts["Models and results"]
  node_finalize["Finalize model<br/>[03_finalize.py]"]
  node_best_model["Best model pipeline"]
end

subgraph group_support["Policy Support"]
  node_api["FastAPI endpoints<br/>[main.py]"]
  node_workflow["Intent and answer workflow<br/>[graph.py]"]
  node_policy_corpus["Policy documents"]
  node_ingestion["Embed and ingest policies<br/>[ingest.py]"]
  node_vector_store[("Policy vector store")]
  node_prompt_builder["Policy prompt<br/>[prompt.py]"]
end

node_web_source(("Books website"))
node_titanic_source(("Titanic dataset source"))
node_api_user(("Support requester"))
node_embedding_model["Sentence embedding model"]
node_llm_service["OpenAI language model"]

node_web_source -->|"provides pages"| node_scraper
node_scraper -->|"writes cleaned data"| node_clean_books
node_database_builder -->|"reads"| node_clean_books
node_database_builder -->|"writes"| node_books_db
node_book_analysis -->|"queries"| node_books_db
node_titanic_source -->|"provides dataset"| node_eda
node_eda -->|"writes raw copy"| node_raw_titanic
node_eda -->|"writes cleaned data"| node_clean_titanic
node_eda -->|"writes visualizations"| node_analysis_outputs
node_modeling -->|"reads"| node_clean_titanic
node_modeling -->|"writes models and results"| node_model_artifacts
node_finalize -->|"loads tuned model"| node_model_artifacts
node_finalize -->|"loads sample data"| node_clean_titanic
node_finalize -->|"saves final pipeline"| node_best_model
node_api_user -->|"submits question"| node_api
node_api -->|"runs graph"| node_workflow
node_workflow -->|"returns answer"| node_api
node_ingestion -->|"reads documents"| node_policy_corpus
node_ingestion -->|"encodes documents"| node_embedding_model
node_ingestion -->|"upserts embeddings"| node_vector_store
node_workflow -->|"encodes query"| node_embedding_model
node_workflow -->|"queries policies"| node_vector_store
node_workflow -->|"builds prompt"| node_prompt_builder
node_workflow -.->|"generates answer"| node_llm_service

click node_scraper "https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/data_pipeline/code/scraper.py"
click node_clean_books "https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/data_pipeline/data/books_cleaned.csv"
click node_database_builder "https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/data_pipeline/code/database.py"
click node_books_db "https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/data_pipeline/data/books.db"
click node_book_analysis "https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/data_pipeline/code/queries.py"
click node_eda "https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/analytics/code/01_eda.py"
click node_raw_titanic "https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/analytics/data/raw/titanic_raw.csv"
click node_clean_titanic "https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/analytics/data/cleaned/titanic_cleaned.csv"
click node_analysis_outputs "https://github.com/mahesh-pepali/zepto-data-ai-platform/tree/main/analytics/outputs"
click node_modeling "https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/analytics/code/02_modeling.py"
click node_model_artifacts "https://github.com/mahesh-pepali/zepto-data-ai-platform/tree/main/analytics/models"
click node_finalize "https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/analytics/code/03_finalize.py"
click node_best_model "https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/analytics/models/best_model_pipeline.joblib"
click node_api "https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/support_assistant/code/main.py"
click node_workflow "https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/support_assistant/code/graph.py"
click node_policy_corpus "https://github.com/mahesh-pepali/zepto-data-ai-platform/tree/main/support_assistant/corpus"
click node_ingestion "https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/support_assistant/code/ingest.py"
click node_prompt_builder "https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/support_assistant/code/prompt.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_scraper,node_clean_books,node_database_builder,node_books_db,node_book_analysis toneBlue
class node_eda,node_raw_titanic,node_clean_titanic,node_analysis_outputs,node_modeling,node_model_artifacts,node_finalize,node_best_model toneAmber
class node_api,node_workflow,node_policy_corpus,node_ingestion,node_vector_store,node_prompt_builder,node_api_user toneMint
class node_web_source,node_titanic_source,node_embedding_model,node_llm_service toneIndigo
```

## Components

### Book Data Pipeline

- [Scrape and clean](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/data_pipeline/code/scraper.py): `data_pipeline/code/scraper.py`
- [Cleaned books CSV](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/data_pipeline/data/books_cleaned.csv): `data_pipeline/data/books_cleaned.csv`
- [Build SQLite database](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/data_pipeline/code/database.py): `data_pipeline/code/database.py`
- [Books database](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/data_pipeline/data/books.db): `data_pipeline/data/books.db`
- [SQL and Pandas analysis](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/data_pipeline/code/queries.py): `data_pipeline/code/queries.py`

### Titanic Analytics

- [EDA and cleaning](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/analytics/code/01_eda.py): `analytics/code/01_eda.py`
- [Raw Titanic data](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/analytics/data/raw/titanic_raw.csv): `analytics/data/raw/titanic_raw.csv`
- [Cleaned Titanic data](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/analytics/data/cleaned/titanic_cleaned.csv): `analytics/data/cleaned/titanic_cleaned.csv`
- [EDA visualizations](https://github.com/mahesh-pepali/zepto-data-ai-platform/tree/main/analytics/outputs): `analytics/outputs`
- [Modeling and evaluation](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/analytics/code/02_modeling.py): `analytics/code/02_modeling.py`
- [Models and results](https://github.com/mahesh-pepali/zepto-data-ai-platform/tree/main/analytics/models): `analytics/models`
- [Finalize model](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/analytics/code/03_finalize.py): `analytics/code/03_finalize.py`
- [Best model pipeline](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/analytics/models/best_model_pipeline.joblib): `analytics/models/best_model_pipeline.joblib`

### Policy Support

- [FastAPI endpoints](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/support_assistant/code/main.py): `support_assistant/code/main.py`
- [Intent and answer workflow](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/support_assistant/code/graph.py): `support_assistant/code/graph.py`
- [Policy documents](https://github.com/mahesh-pepali/zepto-data-ai-platform/tree/main/support_assistant/corpus): `support_assistant/corpus`
- [Embed and ingest policies](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/support_assistant/code/ingest.py): `support_assistant/code/ingest.py`
- **Policy vector store**
- [Policy prompt](https://github.com/mahesh-pepali/zepto-data-ai-platform/blob/main/support_assistant/code/prompt.py): `support_assistant/code/prompt.py`

### Other components

- **Books website**
- **Titanic dataset source**
- **Support requester**
- **Sentence embedding model**
- **OpenAI language model**

## Connections

- Books website → Scrape and clean: provides pages
- Scrape and clean → Cleaned books CSV: writes cleaned data
- Build SQLite database → Cleaned books CSV: reads
- Build SQLite database → Books database: writes
- SQL and Pandas analysis → Books database: queries
- Titanic dataset source → EDA and cleaning: provides dataset
- EDA and cleaning → Raw Titanic data: writes raw copy
- EDA and cleaning → Cleaned Titanic data: writes cleaned data
- EDA and cleaning → EDA visualizations: writes visualizations
- Modeling and evaluation → Cleaned Titanic data: reads
- Modeling and evaluation → Models and results: writes models and results
- Finalize model → Models and results: loads tuned model
- Finalize model → Cleaned Titanic data: loads sample data
- Finalize model → Best model pipeline: saves final pipeline
- Support requester → FastAPI endpoints: submits question
- FastAPI endpoints → Intent and answer workflow: runs graph
- Intent and answer workflow → FastAPI endpoints: returns answer
- Embed and ingest policies → Policy documents: reads documents
- Embed and ingest policies → Sentence embedding model: encodes documents
- Embed and ingest policies → Policy vector store: upserts embeddings
- Intent and answer workflow → Sentence embedding model: encodes query
- Intent and answer workflow → Policy vector store: queries policies
- Intent and answer workflow → Policy prompt: builds prompt
- Intent and answer workflow → OpenAI language model: generates answer
