# kammili-kalyan/zepto-ai-ml-capstone architecture

> Architecture diagram of the GitHub repository kammili-kalyan/zepto-ai-ml-capstone, 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/kammili-kalyan/zepto-ai-ml-capstone
- Repository: https://github.com/kammili-kalyan/zepto-ai-ml-capstone

## Overview

The repository combines three distinct products: a book-data collection and SQL-analysis pipeline, Titanic exploratory/modeling notebooks, and an offline Zepto policy-support assistant. The diagrams preserve each module’s documented workflow and major stages. Some notebook internals and portions of the assistant graph were not sampled, so their internal wiring is shown only where supported by the README or available source.

Main entry points: [`support_assistant/graph.py`](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/graph.py) (Policy Retrieval), [`support_assistant/api.py`](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/api.py) (Ask API), [`data_pipeline/books.db`](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/data_pipeline/books.db) (Books Database), [`support_assistant/ingest.py`](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/ingest.py) (Document Ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Book Data Pipeline"]
  node_scraper["Book Scraper<br/>[scraper.py]"]
  node_raw_csv["Raw Books CSV<br/>[books_raw.csv]"]
  node_cleaner["Data Cleaning<br/>[cleaned.py]"]
  node_clean_csv["Cleaned Books CSV<br/>[books_cleaned.csv]"]
  node_loader["SQLite Loader<br/>[database.py]"]
  node_books_db[("Books Database<br/>[books.db]")]
  node_sql_analysis["SQL Analysis<br/>[queries.py]"]
  node_pandas_analysis["Pandas Comparison"]
end

subgraph group_analytics["Titanic Analytics"]
  node_titanic_data["Titanic Dataset<br/>[titanic.csv]"]
  node_eda["Exploratory Analysis<br/>[01_eda.ipynb]"]
  node_modeling["Model Training<br/>[02_modeling.ipynb]"]
  node_model_artifact["Trained Model"]
end

subgraph group_assistant["Policy Assistant"]
  node_api["Ask API<br/>[api.py]"]
  node_request_schema["Request Schema<br/>[schemas.py]"]
  node_workflow{{"RAG Workflow<br/>[graph.py]"}}
  node_intent["Intent Classification<br/>[graph.py]"]
  node_retrieval["Policy Retrieval<br/>[graph.py]"]
  node_direct_answer["Direct Response<br/>[graph.py]"]
  node_prompt["Prompt Builder<br/>[prompt.py]"]
  node_policy_docs["Policy Documents"]
  node_ingestion["Document Ingestion<br/>[ingest.py]"]
  node_embedding_model["Embedding Model"]
  node_chroma[("Policy Vector Store<br/>[graph.py]")]
  node_response_schema["Response Schema<br/>[schemas.py]"]
end

node_books_site(("Books to Scrape"))
node_customer(("Customer"))

node_books_site -->|"provides pages"| node_scraper
node_scraper -->|"writes records"| node_raw_csv
node_raw_csv -->|"loads data"| node_cleaner
node_cleaner -->|"writes cleaned data"| node_clean_csv
node_clean_csv -->|"loads data"| node_loader
node_loader -->|"writes tables"| node_books_db
node_books_db -->|"queries"| node_sql_analysis
node_books_db -->|"queries"| node_pandas_analysis
node_titanic_data -->|"analyzes"| node_eda
node_titanic_data -->|"trains on"| node_modeling
node_modeling -->|"saves model"| node_model_artifact
node_customer -->|"asks question"| node_api
node_api -->|"validates input"| node_request_schema
node_api -->|"calls ask_zepto"| node_workflow
node_workflow -->|"starts classification"| node_intent
node_intent -->|"routes policy query"| node_retrieval
node_intent -->|"routes general query"| node_direct_answer
node_policy_docs -->|"provides documents"| node_ingestion
node_ingestion -->|"encodes documents"| node_embedding_model
node_ingestion -->|"stores embeddings"| node_chroma
node_retrieval -->|"encodes query"| node_embedding_model
node_retrieval -->|"queries vectors"| node_chroma
node_retrieval -->|"builds prompt"| node_prompt
node_retrieval -->|"returns response fields"| node_response_schema
node_direct_answer -->|"returns response fields"| node_response_schema
node_workflow -->|"returns response"| node_api
node_api -->|"sends answer"| node_customer

click node_scraper "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/data_pipeline/scraper.py"
click node_raw_csv "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/data_pipeline/books_raw.csv"
click node_cleaner "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/data_pipeline/cleaned.py"
click node_clean_csv "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/data_pipeline/books_cleaned.csv"
click node_loader "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/data_pipeline/database.py"
click node_books_db "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/data_pipeline/books.db"
click node_sql_analysis "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/data_pipeline/queries.py"
click node_pandas_analysis "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/data_pipeline/pandas_comparison.py"
click node_titanic_data "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/analytics/titanic.csv"
click node_eda "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/analytics/01_eda.ipynb"
click node_modeling "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/analytics/02_modeling.ipynb"
click node_model_artifact "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/analytics/model_pipeline.joblib"
click node_api "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/api.py"
click node_request_schema "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/schemas.py"
click node_workflow "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/graph.py"
click node_intent "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/graph.py"
click node_retrieval "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/graph.py"
click node_direct_answer "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/graph.py"
click node_prompt "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/prompt.py"
click node_policy_docs "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/tree/main/support_assistant/docs"
click node_ingestion "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/ingest.py"
click node_chroma "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/graph.py"
click node_response_schema "https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/schemas.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_raw_csv,node_cleaner,node_clean_csv,node_loader,node_books_db,node_sql_analysis,node_pandas_analysis toneBlue
class node_titanic_data,node_eda,node_modeling,node_model_artifact toneAmber
class node_api,node_request_schema,node_workflow,node_intent,node_retrieval,node_direct_answer,node_prompt,node_policy_docs,node_ingestion,node_embedding_model,node_chroma,node_response_schema toneMint
class node_books_site,node_customer toneIndigo
```

## Components

### Book Data Pipeline

- [Book Scraper](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/data_pipeline/scraper.py): `data_pipeline/scraper.py`
- [Raw Books CSV](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/data_pipeline/books_raw.csv): `data_pipeline/books_raw.csv`
- [Data Cleaning](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/data_pipeline/cleaned.py): `data_pipeline/cleaned.py`
- [Cleaned Books CSV](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/data_pipeline/books_cleaned.csv): `data_pipeline/books_cleaned.csv`
- [SQLite Loader](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/data_pipeline/database.py): `data_pipeline/database.py`
- [Books Database](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/data_pipeline/books.db): `data_pipeline/books.db`
- [SQL Analysis](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/data_pipeline/queries.py): `data_pipeline/queries.py`
- [Pandas Comparison](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/data_pipeline/pandas_comparison.py): `data_pipeline/pandas_comparison.py`

### Titanic Analytics

- [Titanic Dataset](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/analytics/titanic.csv): `analytics/titanic.csv`
- [Exploratory Analysis](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/analytics/01_eda.ipynb): `analytics/01_eda.ipynb`
- [Model Training](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/analytics/02_modeling.ipynb): `analytics/02_modeling.ipynb`
- [Trained Model](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/analytics/model_pipeline.joblib): `analytics/model_pipeline.joblib`

### Policy Assistant

- [Ask API](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/api.py): `support_assistant/api.py`
- [Request Schema](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/schemas.py): `support_assistant/schemas.py`
- [RAG Workflow](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/graph.py): `support_assistant/graph.py`
- [Intent Classification](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/graph.py): `support_assistant/graph.py`
- [Policy Retrieval](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/graph.py): `support_assistant/graph.py`
- [Direct Response](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/graph.py): `support_assistant/graph.py`
- [Prompt Builder](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/prompt.py): `support_assistant/prompt.py`
- [Policy Documents](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/tree/main/support_assistant/docs): `support_assistant/docs`
- [Document Ingestion](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/ingest.py): `support_assistant/ingest.py`
- **Embedding Model**
- [Policy Vector Store](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/graph.py): `support_assistant/graph.py`
- [Response Schema](https://github.com/kammili-kalyan/zepto-ai-ml-capstone/blob/main/support_assistant/schemas.py): `support_assistant/schemas.py`

### Other components

- **Books to Scrape**
- **Customer**

## Connections

- Books to Scrape → Book Scraper: provides pages
- Book Scraper → Raw Books CSV: writes records
- Raw Books CSV → Data Cleaning: loads data
- Data Cleaning → Cleaned Books CSV: writes cleaned data
- Cleaned Books CSV → SQLite Loader: loads data
- SQLite Loader → Books Database: writes tables
- Books Database → SQL Analysis: queries
- Books Database → Pandas Comparison: queries
- Titanic Dataset → Exploratory Analysis: analyzes
- Titanic Dataset → Model Training: trains on
- Model Training → Trained Model: saves model
- Customer → Ask API: asks question
- Ask API → Request Schema: validates input
- Ask API → RAG Workflow: calls ask_zepto
- RAG Workflow → Intent Classification: starts classification
- Intent Classification → Policy Retrieval: routes policy query
- Intent Classification → Direct Response: routes general query
- Policy Documents → Document Ingestion: provides documents
- Document Ingestion → Embedding Model: encodes documents
- Document Ingestion → Policy Vector Store: stores embeddings
- Policy Retrieval → Embedding Model: encodes query
- Policy Retrieval → Policy Vector Store: queries vectors
- Policy Retrieval → Prompt Builder: builds prompt
- Policy Retrieval → Response Schema: returns response fields
- Direct Response → Response Schema: returns response fields
- RAG Workflow → Ask API: returns response
- Ask API → Customer: sends answer
