# bchikitha/zepto-capstone-project architecture

> Architecture diagram of the GitHub repository bchikitha/zepto-capstone-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bchikitha/zepto-capstone-project
- Repository: https://github.com/bchikitha/zepto-capstone-project

## Overview

This repository combines three data products: a Zepto policy-support RAG API, Titanic analysis and modeling, and a books-catalog ETL pipeline. The support workflow accepts a query at the API, classifies intent, then either retrieves policy context and responds or returns a direct response. The other workflows profile and model Titanic data, and scrape, transform, store, and query book data. Edges reflect the excerpts and README; the optional external-LLM path is documented but not shown in the sampled implementation.

Main entry points: [`support_assistant/graph.py`](https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/graph.py) (Intent Workflow), [`support_assistant/main.py`](https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/main.py) (Ask API), [`support_assistant/prompts.py`](https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/prompts.py) (Prompt Templates), [`support_assistant/vector_db.py`](https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/vector_db.py) (Vector Store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_support["Policy Support"]
  node_api["Ask API<br/>[main.py]"]
  node_workflow["Intent Workflow<br/>[graph.py]"]
  node_classifier["Intent Classifier<br/>[graph.py]"]
  node_policy_answer["Policy Answer<br/>[graph.py]"]
  node_direct_answer["Direct Answer<br/>[graph.py]"]
  node_prompt_templates["Prompt Templates<br/>[prompts.py]"]
end

subgraph group_knowledge["Policy Knowledge"]
  node_vector_store[("Vector Store<br/>[vector_db.py]")]
  node_policy_docs["Policy Documents"]
end

subgraph group_analytics["Titanic Analytics"]
  node_eda["EDA and Cleaning<br/>[01_eda.py]"]
  node_titanic_csv["Titanic CSV<br/>[titanic.csv]"]
  node_modeling["Model Training<br/>[02_modeling.py]"]
  node_model_artifact["Model Artifact"]
end

subgraph group_books["Books ETL"]
  node_scraper["Catalog Scraper<br/>[data_pipeline.py]"]
  node_transform["Data Transform<br/>[data_pipeline.py]"]
  node_db_loader["Database Loader<br/>[data_pipeline.py]"]
  node_books_db[("Books Database<br/>[books_pipeline.db]")]
  node_query_validation["Queries and Validation<br/>[data_pipeline.py]"]
end

node_customer(("Query Client"))
node_llm_service{{"External LLM"}}
node_catalog_site{{"Books Catalog"}}

node_customer -->|"submits query"| node_api
node_api -->|"invokes graph"| node_workflow
node_workflow -->|"classifies intent"| node_classifier
node_classifier -->|"routes policy"| node_policy_answer
node_classifier -->|"routes general"| node_direct_answer
node_policy_answer -->|"queries top-k"| node_vector_store
node_vector_store -->|"indexes documents"| node_policy_docs
node_workflow -.->|"uses optional prompt"| node_prompt_templates
node_workflow -.->|"calls optional API"| node_llm_service
node_prompt_templates -.->|"supplies prompt"| node_llm_service
node_eda -->|"writes cleaned data"| node_titanic_csv
node_titanic_csv -->|"loads dataset"| node_modeling
node_modeling -->|"exports pipeline"| node_model_artifact
node_catalog_site -->|"serves catalog pages"| node_scraper
node_scraper -->|"returns raw records"| node_transform
node_transform -->|"returns dataframe"| node_db_loader
node_db_loader -->|"writes tables"| node_books_db
node_query_validation -->|"reads and queries"| node_books_db

click node_api "https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/main.py"
click node_workflow "https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/graph.py"
click node_classifier "https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/graph.py"
click node_policy_answer "https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/graph.py"
click node_direct_answer "https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/graph.py"
click node_vector_store "https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/vector_db.py"
click node_policy_docs "https://github.com/bchikitha/zepto-capstone-project/tree/main/support_assistant/docs"
click node_prompt_templates "https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/prompts.py"
click node_eda "https://github.com/bchikitha/zepto-capstone-project/blob/main/analytics/01_eda.py"
click node_titanic_csv "https://github.com/bchikitha/zepto-capstone-project/blob/main/analytics/titanic.csv"
click node_modeling "https://github.com/bchikitha/zepto-capstone-project/blob/main/analytics/02_modeling.py"
click node_model_artifact "https://github.com/bchikitha/zepto-capstone-project/blob/main/analytics/titanic_pipeline.joblib"
click node_scraper "https://github.com/bchikitha/zepto-capstone-project/blob/main/data_pipeline.py"
click node_transform "https://github.com/bchikitha/zepto-capstone-project/blob/main/data_pipeline.py"
click node_db_loader "https://github.com/bchikitha/zepto-capstone-project/blob/main/data_pipeline.py"
click node_books_db "https://github.com/bchikitha/zepto-capstone-project/blob/main/data_pipeline/books_pipeline.db"
click node_query_validation "https://github.com/bchikitha/zepto-capstone-project/blob/main/data_pipeline.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_api,node_workflow,node_classifier,node_policy_answer,node_direct_answer,node_prompt_templates,node_customer toneBlue
class node_vector_store,node_policy_docs toneAmber
class node_eda,node_titanic_csv,node_modeling,node_model_artifact toneMint
class node_scraper,node_transform,node_db_loader,node_books_db,node_query_validation toneRose
class node_llm_service,node_catalog_site toneIndigo
```

## Components

### Policy Support

- [Ask API](https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/main.py): `support_assistant/main.py`
- [Intent Workflow](https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/graph.py): `support_assistant/graph.py`
- [Intent Classifier](https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/graph.py): `support_assistant/graph.py`
- [Policy Answer](https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/graph.py): `support_assistant/graph.py`
- [Direct Answer](https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/graph.py): `support_assistant/graph.py`
- [Prompt Templates](https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/prompts.py): `support_assistant/prompts.py`

### Policy Knowledge

- [Vector Store](https://github.com/bchikitha/zepto-capstone-project/blob/main/support_assistant/vector_db.py): `support_assistant/vector_db.py`
- [Policy Documents](https://github.com/bchikitha/zepto-capstone-project/tree/main/support_assistant/docs): `support_assistant/docs`

### Titanic Analytics

- [EDA and Cleaning](https://github.com/bchikitha/zepto-capstone-project/blob/main/analytics/01_eda.py): `analytics/01_eda.py`
- [Titanic CSV](https://github.com/bchikitha/zepto-capstone-project/blob/main/analytics/titanic.csv): `analytics/titanic.csv`
- [Model Training](https://github.com/bchikitha/zepto-capstone-project/blob/main/analytics/02_modeling.py): `analytics/02_modeling.py`
- [Model Artifact](https://github.com/bchikitha/zepto-capstone-project/blob/main/analytics/titanic_pipeline.joblib): `analytics/titanic_pipeline.joblib`

### Books ETL

- [Catalog Scraper](https://github.com/bchikitha/zepto-capstone-project/blob/main/data_pipeline.py): `data_pipeline.py`
- [Data Transform](https://github.com/bchikitha/zepto-capstone-project/blob/main/data_pipeline.py): `data_pipeline.py`
- [Database Loader](https://github.com/bchikitha/zepto-capstone-project/blob/main/data_pipeline.py): `data_pipeline.py`
- [Books Database](https://github.com/bchikitha/zepto-capstone-project/blob/main/data_pipeline/books_pipeline.db): `data_pipeline/books_pipeline.db`
- [Queries and Validation](https://github.com/bchikitha/zepto-capstone-project/blob/main/data_pipeline.py): `data_pipeline.py`

### Other components

- **Query Client**
- **External LLM**
- **Books Catalog**

## Connections

- Query Client → Ask API: submits query (evidence: `README.md`)
- Ask API → Intent Workflow: invokes graph (evidence: `support_assistant/main.py`)
- Intent Workflow → Intent Classifier: classifies intent (evidence: `support_assistant/graph.py`)
- Intent Classifier → Policy Answer: routes policy (evidence: `support_assistant/graph.py`)
- Intent Classifier → Direct Answer: routes general (evidence: `support_assistant/graph.py`)
- Policy Answer → Vector Store: queries top-k (evidence: `support_assistant/graph.py`)
- Vector Store → Policy Documents: indexes documents (evidence: `README.md`)
- Intent Workflow → Prompt Templates: uses optional prompt (evidence: `README.md`)
- Intent Workflow → External LLM: calls optional API (evidence: `README.md`)
- Prompt Templates → External LLM: supplies prompt (evidence: `README.md`)
- EDA and Cleaning → Titanic CSV: writes cleaned data (evidence: `analytics/01_eda.py`)
- Titanic CSV → Model Training: loads dataset (evidence: `analytics/02_modeling.py`)
- Model Training → Model Artifact: exports pipeline (evidence: `analytics/02_modeling.py`)
- Books Catalog → Catalog Scraper: serves catalog pages (evidence: `data_pipeline.py`)
- Catalog Scraper → Data Transform: returns raw records (evidence: `data_pipeline.py`)
- Data Transform → Database Loader: returns dataframe (evidence: `data_pipeline.py`)
- Database Loader → Books Database: writes tables (evidence: `data_pipeline.py`)
- Queries and Validation → Books Database: reads and queries (evidence: `data_pipeline.py`)
