# marimecucci/beauty-commerce-intelligence architecture

> Architecture diagram of the GitHub repository marimecucci/beauty-commerce-intelligence, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/marimecucci/beauty-commerce-intelligence
- Repository: https://github.com/marimecucci/beauty-commerce-intelligence

## Overview

Beauty Commerce Intelligence is a local-first synthetic commerce data platform with a Streamlit analytics dashboard and a constrained AI assistant. Its main workflow generates raw data, validates and transforms it through Bronze/Silver/Gold, exports Parquet for analytics, then serves filtered insights through the dashboard or approved agent tools. The README also documents S3-compatible storage, integrity checks, and a metadata catalog. Some supporting scripts were not excerpted; their relationships are included only where the README documents them.

Main entry points: [`src/beauty_commerce/pipeline.py`](https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/src/beauty_commerce/pipeline.py) (Medallion pipeline), [`dashboard/app.py`](https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/dashboard/app.py) (Streamlit dashboard), [`scripts/10_beauty_agent.py`](https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/10_beauty_agent.py) (LangGraph agent), [`scripts/06_query_s3.py`](https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/06_query_s3.py) (S3 reconciliation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data production"]
  node_generator_cli["Generate data"]
  node_generator["Synthetic generator<br/>[generator.py]"]
  node_raw[("Raw CSV")]
  node_pipeline_cli["Run pipeline<br/>[02_run_pipeline.py]"]
  node_pipeline["Medallion pipeline<br/>[pipeline.py]"]
  node_bronze[("Bronze snapshots")]
  node_silver[("Silver datasets")]
  node_gold_csv[("Gold aggregates")]
  node_quality_report["Quality report"]
end

subgraph group_storage["Analytics storage"]
  node_parquet_export["Parquet export"]
  node_parquet[("Local Parquet")]
  node_s3_upload["S3 upload"]
  node_object_store[("S3-compatible store")]
  node_s3_query["S3 reconciliation<br/>[06_query_s3.py]"]
  node_integrity["Parquet integrity"]
  node_catalog["Metadata catalog"]
end

subgraph group_insights["Analytics experience"]
  node_dashboard["Streamlit dashboard<br/>[app.py]"]
end

subgraph group_agent["AI analytics"]
  node_agent["LangGraph agent<br/>[10_beauty_agent.py]"]
  node_policy["Forecast policy<br/>[agent_policy.py]"]
  node_tools["Approved analytics tools<br/>[analytics_tools.py]"]
end

node_operator(("Operator"))
node_question(("Business question"))
node_ollama["Ollama Qwen3"]

node_operator -->|"starts"| node_generator_cli
node_generator_cli -->|"calls"| node_generator
node_generator -->|"writes CSV"| node_raw
node_operator -->|"starts"| node_pipeline_cli
node_pipeline_cli -->|"calls"| node_pipeline
node_pipeline -->|"reads CSV"| node_raw
node_pipeline -->|"copies snapshots"| node_bronze
node_pipeline -->|"writes CSV"| node_silver
node_pipeline -->|"writes aggregates"| node_gold_csv
node_pipeline -->|"writes report"| node_quality_report
node_operator -.->|"runs export"| node_parquet_export
node_parquet_export -->|"exports datasets"| node_parquet
node_operator -.->|"runs upload"| node_s3_upload
node_s3_upload -->|"uploads and verifies"| node_object_store
node_operator -->|"runs query"| node_s3_query
node_s3_query -->|"queries remote"| node_object_store
node_s3_query -->|"reconciles local"| node_parquet
node_operator -->|"runs checks"| node_integrity
node_integrity -->|"validates datasets"| node_parquet
node_integrity -->|"checks report totals"| node_quality_report
node_operator -.->|"builds catalog"| node_catalog
node_catalog -.->|"catalogs datasets"| node_parquet
node_question -->|"asks or filters"| node_dashboard
node_dashboard -->|"reads Gold data"| node_parquet
node_dashboard -.->|"shows quality"| node_quality_report
node_dashboard -.->|"shows metadata"| node_catalog
node_dashboard -->|"checks forecast policy"| node_policy
node_dashboard -->|"invokes agent"| node_agent
node_question -->|"asks analytics"| node_agent
node_agent -->|"invokes model"| node_ollama
node_agent -->|"dispatches tools"| node_tools
node_agent -->|"blocks forecasts"| node_policy
node_tools -->|"queries Gold files"| node_parquet

click node_generator_cli "https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/01_generate_data.py"
click node_generator "https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/src/beauty_commerce/generator.py"
click node_raw "https://github.com/marimecucci/beauty-commerce-intelligence/tree/main/data/raw"
click node_pipeline_cli "https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/02_run_pipeline.py"
click node_pipeline "https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/src/beauty_commerce/pipeline.py"
click node_bronze "https://github.com/marimecucci/beauty-commerce-intelligence/tree/main/data/bronze"
click node_silver "https://github.com/marimecucci/beauty-commerce-intelligence/tree/main/data/silver"
click node_gold_csv "https://github.com/marimecucci/beauty-commerce-intelligence/tree/main/data/gold"
click node_quality_report "https://github.com/marimecucci/beauty-commerce-intelligence/tree/main/reports"
click node_parquet_export "https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/03_export_parquet.py"
click node_s3_upload "https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/05_upload_parquet_s3.py"
click node_s3_query "https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/06_query_s3.py"
click node_integrity "https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/07_validate_parquet.py"
click node_catalog "https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/08_build_catalog.py"
click node_dashboard "https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/dashboard/app.py"
click node_agent "https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/10_beauty_agent.py"
click node_policy "https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/src/beauty_commerce/agent_policy.py"
click node_tools "https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/src/beauty_commerce/analytics_tools.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_generator_cli,node_generator,node_raw,node_pipeline_cli,node_pipeline,node_bronze,node_silver,node_gold_csv,node_quality_report toneBlue
class node_parquet_export,node_parquet,node_s3_upload,node_object_store,node_s3_query,node_integrity,node_catalog toneAmber
class node_dashboard toneMint
class node_agent,node_policy,node_tools toneRose
class node_operator,node_question,node_ollama toneIndigo
```

## Components

### Data production

- [Generate data](https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/01_generate_data.py): `scripts/01_generate_data.py`
- [Synthetic generator](https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/src/beauty_commerce/generator.py): `src/beauty_commerce/generator.py`
- [Raw CSV](https://github.com/marimecucci/beauty-commerce-intelligence/tree/main/data/raw): `data/raw`
- [Run pipeline](https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/02_run_pipeline.py): `scripts/02_run_pipeline.py`
- [Medallion pipeline](https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/src/beauty_commerce/pipeline.py): `src/beauty_commerce/pipeline.py`
- [Bronze snapshots](https://github.com/marimecucci/beauty-commerce-intelligence/tree/main/data/bronze): `data/bronze`
- [Silver datasets](https://github.com/marimecucci/beauty-commerce-intelligence/tree/main/data/silver): `data/silver`
- [Gold aggregates](https://github.com/marimecucci/beauty-commerce-intelligence/tree/main/data/gold): `data/gold`
- [Quality report](https://github.com/marimecucci/beauty-commerce-intelligence/tree/main/reports): `reports`

### Analytics storage

- [Parquet export](https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/03_export_parquet.py): `scripts/03_export_parquet.py`
- **Local Parquet**
- [S3 upload](https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/05_upload_parquet_s3.py): `scripts/05_upload_parquet_s3.py`
- **S3-compatible store**
- [S3 reconciliation](https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/06_query_s3.py): `scripts/06_query_s3.py`
- [Parquet integrity](https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/07_validate_parquet.py): `scripts/07_validate_parquet.py`
- [Metadata catalog](https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/08_build_catalog.py): `scripts/08_build_catalog.py`

### Analytics experience

- [Streamlit dashboard](https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/dashboard/app.py): `dashboard/app.py`

### AI analytics

- [LangGraph agent](https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/scripts/10_beauty_agent.py): `scripts/10_beauty_agent.py`
- [Forecast policy](https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/src/beauty_commerce/agent_policy.py): `src/beauty_commerce/agent_policy.py`
- [Approved analytics tools](https://github.com/marimecucci/beauty-commerce-intelligence/blob/main/src/beauty_commerce/analytics_tools.py): `src/beauty_commerce/analytics_tools.py`

### Other components

- **Operator**
- **Business question**
- **Ollama Qwen3**

## Connections

- Operator → Generate data: starts (evidence: `scripts/01_generate_data.py`)
- Generate data → Synthetic generator: calls (evidence: `scripts/01_generate_data.py`)
- Synthetic generator → Raw CSV: writes CSV (evidence: `src/beauty_commerce/generator.py`)
- Operator → Run pipeline: starts (evidence: `scripts/02_run_pipeline.py`)
- Run pipeline → Medallion pipeline: calls (evidence: `scripts/02_run_pipeline.py`)
- Medallion pipeline → Raw CSV: reads CSV (evidence: `src/beauty_commerce/pipeline.py`)
- Medallion pipeline → Bronze snapshots: copies snapshots (evidence: `src/beauty_commerce/pipeline.py`)
- Medallion pipeline → Silver datasets: writes CSV (evidence: `src/beauty_commerce/pipeline.py`)
- Medallion pipeline → Gold aggregates: writes aggregates (evidence: `src/beauty_commerce/pipeline.py`)
- Medallion pipeline → Quality report: writes report (evidence: `src/beauty_commerce/pipeline.py`)
- Operator → Parquet export: runs export (evidence: `README.md`)
- Parquet export → Local Parquet: exports datasets (evidence: `README.md`)
- Operator → S3 upload: runs upload (evidence: `README.md`)
- S3 upload → S3-compatible store: uploads and verifies (evidence: `README.md`)
- Operator → S3 reconciliation: runs query (evidence: `scripts/06_query_s3.py`)
- S3 reconciliation → S3-compatible store: queries remote (evidence: `scripts/06_query_s3.py`)
- S3 reconciliation → Local Parquet: reconciles local (evidence: `scripts/06_query_s3.py`)
- Operator → Parquet integrity: runs checks (evidence: `scripts/07_validate_parquet.py`)
- Parquet integrity → Local Parquet: validates datasets (evidence: `scripts/07_validate_parquet.py`)
- Parquet integrity → Quality report: checks report totals (evidence: `scripts/07_validate_parquet.py`)
- Operator → Metadata catalog: builds catalog (evidence: `README.md`)
- Metadata catalog → Local Parquet: catalogs datasets (evidence: `README.md`)
- Business question → Streamlit dashboard: asks or filters (evidence: `README.md`)
- Streamlit dashboard → Local Parquet: reads Gold data (evidence: `dashboard/app.py`)
- Streamlit dashboard → Quality report: shows quality (evidence: `README.md`)
- Streamlit dashboard → Metadata catalog: shows metadata (evidence: `README.md`)
- Streamlit dashboard → Forecast policy: checks forecast policy (evidence: `dashboard/app.py`)
- Streamlit dashboard → LangGraph agent: invokes agent (evidence: `dashboard/app.py`)
- Business question → LangGraph agent: asks analytics (evidence: `scripts/10_beauty_agent.py`)
- LangGraph agent → Ollama Qwen3: invokes model (evidence: `scripts/10_beauty_agent.py`)
- LangGraph agent → Approved analytics tools: dispatches tools (evidence: `scripts/10_beauty_agent.py`)
- LangGraph agent → Forecast policy: blocks forecasts (evidence: `scripts/10_beauty_agent.py`)
- Approved analytics tools → Local Parquet: queries Gold files (evidence: `src/beauty_commerce/analytics_tools.py`)
