# sunnysavita10/custmor_support_system architecture

> Architecture diagram of the GitHub repository sunnysavita10/custmor_support_system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sunnysavita10/custmor_support_system
- Repository: https://github.com/sunnysavita10/custmor_support_system

## Overview

##### Project type and purpose
- The backend is a Python web server (FastAPI run via Uvicorn), the frontend is an HTML/CSS chat UI, and there are modules for data ingestion, retrieval, prompt engineering, and model loading.

##### File structure
Top-level:
- Dockerfile, setup.py, requirements.txt, GitHub workflows → packaging, containerization, CI/CD
- main.py → entry point for the web server (FastAPI/Uvicorn)
- templates/chat.html + static/style.css → Jinja2-style chat UI
- data_ingestion/ingestion_pipeline.py → batch pipeline to import and preprocess flipkart_product_review.csv
- retriever/retrieval.py → code to lookup or search preprocessed data (e.g. similarity search)
- prompt_library/prompt.py → functions to assemble LLM prompts
- utils/config_loader.py, utils/model_loader.py → load YAML configs and initialize the LLM
- config/config.yaml → configuration (e.g. API keys, model names, database URIs)
- notebook/ → exploratory Jupyter notebook for prototyping
- test.py → smoke tests or simple end-to-end checks

##### README for additional insights
- Shows how to create/activate a conda environment and start the server:
`uvicorn main:app --reload --port 8001`
- Mentions CI/CD is configured (via GitHub Actions).

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Frontend Layer"
        Browser["Browser UI<br/>(templates/chat.html + static/style.css)"]:::frontend
    end

    subgraph "Backend Service"
        WebServer["Web Server<br/>(main.py)"]:::backend
        Config["Config Loader<br/>(utils/config_loader.py + config/config.yaml)"]:::infra
        ModelLoad["Model Loader<br/>(utils/model_loader.py)"]:::infra
        Retriever["Retriever Service<br/>(retriever/retrieval.py)"]:::service
        Prompt["Prompt Library<br/>(prompt_library/prompt.py)"]:::service
        LLM["LLM Inference<br/>(External API)"]:::service
    end

    subgraph "Offline Batch Pipeline"
        Ingestion["Data Ingestion Pipeline<br/>(data_ingestion/ingestion_pipeline.py)"]:::infra
        CSV["flipkart_product_review.csv"]:::infra
    end

    subgraph "DevOps & Testing"
        CICD["CI/CD & Containerization<br/>(Dockerfile + .github/workflows/main.yaml)"]:::infra
        Test["Smoke Tests<br/>(test.py)"]:::infra
        Packaging["Packaging & Dependencies<br/>(setup.py + requirements.txt)"]:::infra
    end

    Browser -->|HTTP POST /chat| WebServer
    WebServer -->|loads settings at startup| Config
    WebServer -->|initializes LLM client| ModelLoad
    WebServer -->|fetches snippets| Retriever
    WebServer -->|assembles prompt| Prompt
    Prompt -->|sends prompt| LLM
    LLM -->|returns response| WebServer
    WebServer -->|returns JSON| Browser

    CSV -->|source data| Ingestion
    Ingestion -->|builds index| Retriever

    CICD -->|runs smoke tests| Test
    CICD -->|installs deps & packages| Packaging
    CICD -->|builds Docker image| WebServer

    classDef frontend fill:#FFD27F,stroke:#333,stroke-width:1px;
    classDef backend fill:#8FBCE6,stroke:#333,stroke-width:1px;
    classDef service fill:#A3D3AB,stroke:#333,stroke-width:1px;
    classDef infra fill:#D3D3D3,stroke:#333,stroke-width:1px;

    click Browser "https://github.com/sunnysavita10/custmor_support_system/blob/main/templates/chat.html"
    click Browser "https://github.com/sunnysavita10/custmor_support_system/blob/main/static/style.css"
    click WebServer "https://github.com/sunnysavita10/custmor_support_system/blob/main/main.py"
    click Config "https://github.com/sunnysavita10/custmor_support_system/blob/main/utils/config_loader.py"
    click Config "https://github.com/sunnysavita10/custmor_support_system/blob/main/config/config.yaml"
    click ModelLoad "https://github.com/sunnysavita10/custmor_support_system/blob/main/utils/model_loader.py"
    click Retriever "https://github.com/sunnysavita10/custmor_support_system/blob/main/retriever/retrieval.py"
    click Prompt "https://github.com/sunnysavita10/custmor_support_system/blob/main/prompt_library/prompt.py"
    click Ingestion "https://github.com/sunnysavita10/custmor_support_system/blob/main/data_ingestion/ingestion_pipeline.py"
    click CSV "https://github.com/sunnysavita10/custmor_support_system/blob/main/data/flipkart_product_review.csv"
    click CICD "https://github.com/sunnysavita10/custmor_support_system/tree/main/Dockerfile"
    click CICD "https://github.com/sunnysavita10/custmor_support_system/blob/main/.github/workflows/main.yaml"
    click Test "https://github.com/sunnysavita10/custmor_support_system/blob/main/test.py"
    click Packaging "https://github.com/sunnysavita10/custmor_support_system/blob/main/setup.py"
    click Packaging "https://github.com/sunnysavita10/custmor_support_system/blob/main/requirements.txt"
```
