# kumarayush0104/hpcl_coders architecture

> Architecture diagram of the GitHub repository kumarayush0104/hpcl_coders, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kumarayush0104/hpcl_coders
- Repository: https://github.com/kumarayush0104/hpcl_coders

## Overview

IntelliCost standardizes procurement item descriptions, then supports item-level cost trends, vendor comparisons, forecasting, and anomaly review in a Streamlit dashboard. The main runtime path loads the synthetic PO dataset, adds canonical item codes when absent, and computes the selected dashboard views. Stage 1 PDF digitization and OCR are independent notebook assets; the README says they are not yet connected to the integrated dashboard workflow. Relationships below are limited to those shown in excerpts or documented in the README.

Main entry points: [`dashboard/app.py`](https://github.com/kumarayush0104/hpcl_coders/blob/main/dashboard/app.py) (Streamlit dashboard), [`core/item_master.py`](https://github.com/kumarayush0104/hpcl_coders/blob/main/core/item_master.py) (Item classifier), [`core/data_loader.py`](https://github.com/kumarayush0104/hpcl_coders/blob/main/core/data_loader.py) (PO data loader), [`synthetic_hpcl_po_data.csv`](https://github.com/kumarayush0104/hpcl_coders/blob/main/synthetic_hpcl_po_data.csv) (Synthetic PO data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["PO Intake"]
  node_stage1["PDF and OCR notebooks"]
  node_po_data[("Synthetic PO data")]
  node_loader["PO data loader<br/>[data_loader.py]"]
end

subgraph group_standardization["Item Standardization"]
  node_item_master["Item classifier<br/>[item_master.py]"]
  node_item_csv[("Canonical item records<br/>[item_master.csv]")]
  node_faiss_index[("Semantic search index<br/>[item_index.faiss]")]
end

subgraph group_intelligence["Cost Intelligence"]
  node_repository["Price time series<br/>[repository.py]"]
  node_analytics["Price forecasting<br/>[analytics.py]"]
  node_vendor["Vendor comparison"]
  node_anomaly["Price anomaly detection<br/>[anomaly.py]"]
end

subgraph group_experience["Decision Interface"]
  node_dashboard["Streamlit dashboard<br/>[app.py]"]
  node_trend_view["Historical price trends<br/>[app.py]"]
  node_vendor_view["Vendor comparison view<br/>[app.py]"]
  node_forecast_view["Forecast view<br/>[app.py]"]
  node_anomaly_view["Anomaly monitoring view<br/>[app.py]"]
  node_standardization_view["Standardization lookup<br/>[app.py]"]
end

node_analyst(("Procurement analyst"))

node_analyst -->|"uses"| node_dashboard
node_analyst -.->|"runs independently"| node_stage1
node_dashboard -->|"loads data via"| node_loader
node_loader -->|"reads"| node_po_data
node_loader -->|"classifies descriptions"| node_item_master
node_dashboard -->|"classifies lookup"| node_item_master
node_item_master -->|"reads and writes"| node_item_csv
node_item_master -->|"reads and writes"| node_faiss_index
node_item_master -->|"bootstraps from"| node_po_data
node_dashboard -->|"aggregates prices"| node_repository
node_dashboard -->|"renders"| node_trend_view
node_dashboard -->|"compares vendors"| node_vendor
node_dashboard -->|"renders"| node_vendor_view
node_dashboard -->|"forecasts series"| node_analytics
node_dashboard -->|"renders"| node_forecast_view
node_dashboard -->|"detects anomalies"| node_anomaly
node_dashboard -->|"renders"| node_anomaly_view
node_dashboard -->|"renders result"| node_standardization_view

click node_stage1 "https://github.com/kumarayush0104/hpcl_coders/tree/main/stage1"
click node_dashboard "https://github.com/kumarayush0104/hpcl_coders/blob/main/dashboard/app.py"
click node_po_data "https://github.com/kumarayush0104/hpcl_coders/blob/main/synthetic_hpcl_po_data.csv"
click node_loader "https://github.com/kumarayush0104/hpcl_coders/blob/main/core/data_loader.py"
click node_item_master "https://github.com/kumarayush0104/hpcl_coders/blob/main/core/item_master.py"
click node_item_csv "https://github.com/kumarayush0104/hpcl_coders/blob/main/core/item_master.csv"
click node_faiss_index "https://github.com/kumarayush0104/hpcl_coders/blob/main/core/item_index.faiss"
click node_repository "https://github.com/kumarayush0104/hpcl_coders/blob/main/core/repository.py"
click node_analytics "https://github.com/kumarayush0104/hpcl_coders/blob/main/core/analytics.py"
click node_vendor "https://github.com/kumarayush0104/hpcl_coders/blob/main/core/vendor_comparison.py"
click node_anomaly "https://github.com/kumarayush0104/hpcl_coders/blob/main/core/anomaly.py"
click node_trend_view "https://github.com/kumarayush0104/hpcl_coders/blob/main/dashboard/app.py"
click node_vendor_view "https://github.com/kumarayush0104/hpcl_coders/blob/main/dashboard/app.py"
click node_forecast_view "https://github.com/kumarayush0104/hpcl_coders/blob/main/dashboard/app.py"
click node_anomaly_view "https://github.com/kumarayush0104/hpcl_coders/blob/main/dashboard/app.py"
click node_standardization_view "https://github.com/kumarayush0104/hpcl_coders/blob/main/dashboard/app.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_stage1,node_po_data,node_loader toneBlue
class node_item_master,node_item_csv,node_faiss_index toneAmber
class node_repository,node_analytics,node_vendor,node_anomaly toneMint
class node_dashboard,node_trend_view,node_vendor_view,node_forecast_view,node_anomaly_view,node_standardization_view toneRose
class node_analyst toneIndigo
```

## Components

### PO Intake

- [PDF and OCR notebooks](https://github.com/kumarayush0104/hpcl_coders/tree/main/stage1): `stage1`
- [Synthetic PO data](https://github.com/kumarayush0104/hpcl_coders/blob/main/synthetic_hpcl_po_data.csv): `synthetic_hpcl_po_data.csv`
- [PO data loader](https://github.com/kumarayush0104/hpcl_coders/blob/main/core/data_loader.py): `core/data_loader.py`

### Item Standardization

- [Item classifier](https://github.com/kumarayush0104/hpcl_coders/blob/main/core/item_master.py): `core/item_master.py`
- [Canonical item records](https://github.com/kumarayush0104/hpcl_coders/blob/main/core/item_master.csv): `core/item_master.csv`
- [Semantic search index](https://github.com/kumarayush0104/hpcl_coders/blob/main/core/item_index.faiss): `core/item_index.faiss`

### Cost Intelligence

- [Price time series](https://github.com/kumarayush0104/hpcl_coders/blob/main/core/repository.py): `core/repository.py`
- [Price forecasting](https://github.com/kumarayush0104/hpcl_coders/blob/main/core/analytics.py): `core/analytics.py`
- [Vendor comparison](https://github.com/kumarayush0104/hpcl_coders/blob/main/core/vendor_comparison.py): `core/vendor_comparison.py`
- [Price anomaly detection](https://github.com/kumarayush0104/hpcl_coders/blob/main/core/anomaly.py): `core/anomaly.py`

### Decision Interface

- [Streamlit dashboard](https://github.com/kumarayush0104/hpcl_coders/blob/main/dashboard/app.py): `dashboard/app.py`
- [Historical price trends](https://github.com/kumarayush0104/hpcl_coders/blob/main/dashboard/app.py): `dashboard/app.py`
- [Vendor comparison view](https://github.com/kumarayush0104/hpcl_coders/blob/main/dashboard/app.py): `dashboard/app.py`
- [Forecast view](https://github.com/kumarayush0104/hpcl_coders/blob/main/dashboard/app.py): `dashboard/app.py`
- [Anomaly monitoring view](https://github.com/kumarayush0104/hpcl_coders/blob/main/dashboard/app.py): `dashboard/app.py`
- [Standardization lookup](https://github.com/kumarayush0104/hpcl_coders/blob/main/dashboard/app.py): `dashboard/app.py`

### Other components

- **Procurement analyst**

## Connections

- Procurement analyst → Streamlit dashboard: uses (evidence: `README.md`)
- Procurement analyst → PDF and OCR notebooks: runs independently (evidence: `README.md`)
- Streamlit dashboard → PO data loader: loads data via (evidence: `dashboard/app.py`)
- PO data loader → Synthetic PO data: reads
- PO data loader → Item classifier: classifies descriptions (evidence: `core/data_loader.py`)
- Streamlit dashboard → Item classifier: classifies lookup (evidence: `dashboard/app.py`)
- Item classifier → Canonical item records: reads and writes (evidence: `core/item_master.py`)
- Item classifier → Semantic search index: reads and writes (evidence: `core/item_master.py`)
- Item classifier → Synthetic PO data: bootstraps from (evidence: `core/item_master.py`)
- Streamlit dashboard → Price time series: aggregates prices (evidence: `dashboard/app.py`)
- Streamlit dashboard → Historical price trends: renders (evidence: `dashboard/app.py`)
- Streamlit dashboard → Vendor comparison: compares vendors (evidence: `dashboard/app.py`)
- Streamlit dashboard → Vendor comparison view: renders (evidence: `dashboard/app.py`)
- Streamlit dashboard → Price forecasting: forecasts series (evidence: `dashboard/app.py`)
- Streamlit dashboard → Forecast view: renders (evidence: `dashboard/app.py`)
- Streamlit dashboard → Price anomaly detection: detects anomalies (evidence: `dashboard/app.py`)
- Streamlit dashboard → Anomaly monitoring view: renders (evidence: `dashboard/app.py`)
- Streamlit dashboard → Standardization lookup: renders result (evidence: `dashboard/app.py`)
