# krishgarg344/intelligent-customer-case-processing-system architecture

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

- Interactive diagram: https://gitdiagram.com/krishgarg344/intelligent-customer-case-processing-system
- Repository: https://github.com/krishgarg344/intelligent-customer-case-processing-system

## Overview

The product is a FastAPI customer-ticket processing service. A client submits ticket text; the endpoint predicts category and priority, maps the category to a department, generates a Gemini draft reply, and returns those results. The README also describes dataset preparation and model-training stages, represented by the available dataset and notebooks. The saved-model artifacts mentioned by the API are not present in the supplied tree, so model-training-to-runtime artifact flow is not shown.

Main entry points: [`main.py`](https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/main.py) (Ticket Endpoint), [`dataset/labeled_tickets_with_priority.csv`](https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/dataset/labeled_tickets_with_priority.csv) (Labeled Tickets), [`models/ticket_classification.ipynb`](https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/models/ticket_classification.ipynb) (Category Training), [`models/priority_prediction.ipynb`](https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/models/priority_prediction.ipynb) (Priority Training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Ticket API"]
  node_api_endpoint["Ticket Endpoint<br/>[main.py]"]
end

subgraph group_ml["Ticket Models"]
  node_category_inference["Category Inference<br/>[main.py]"]
  node_priority_inference["Priority Inference<br/>[main.py]"]
  node_category_training["Category Training"]
  node_priority_training["Priority Training"]
  node_labeled_data[("Labeled Tickets")]
end

subgraph group_enrichment["Routing and Replies"]
  node_department_mapping["Department Mapping"]
  node_reply_generation["Draft Generation<br/>[main.py]"]
end

node_client(("CRM Client"))
node_gemini{{"Gemini API"}}

node_client -->|"submits ticket"| node_api_endpoint
node_api_endpoint -->|"predicts category"| node_category_inference
node_api_endpoint -->|"predicts priority"| node_priority_inference
node_api_endpoint -->|"assigns department"| node_department_mapping
node_api_endpoint -->|"generates draft"| node_reply_generation
node_reply_generation -->|"requests content"| node_gemini
node_api_endpoint -->|"returns results"| node_client
node_labeled_data -.->|"training data"| node_category_training
node_labeled_data -.->|"labeled tickets"| node_priority_training

click node_api_endpoint "https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/main.py"
click node_category_inference "https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/main.py"
click node_priority_inference "https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/main.py"
click node_category_training "https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/models/ticket_classification.ipynb"
click node_priority_training "https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/models/priority_prediction.ipynb"
click node_labeled_data "https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/dataset/labeled_tickets_with_priority.csv"
click node_department_mapping "https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/department_assignment.py"
click node_reply_generation "https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/main.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_endpoint,node_client toneBlue
class node_category_inference,node_priority_inference,node_category_training,node_priority_training,node_labeled_data toneAmber
class node_department_mapping,node_reply_generation,node_gemini toneMint
```

## Components

### Ticket API

- [Ticket Endpoint](https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/main.py): `main.py`

### Ticket Models

- [Category Inference](https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/main.py): `main.py`
- [Priority Inference](https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/main.py): `main.py`
- [Category Training](https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/models/ticket_classification.ipynb): `models/ticket_classification.ipynb`
- [Priority Training](https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/models/priority_prediction.ipynb): `models/priority_prediction.ipynb`
- [Labeled Tickets](https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/dataset/labeled_tickets_with_priority.csv): `dataset/labeled_tickets_with_priority.csv`

### Routing and Replies

- [Department Mapping](https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/department_assignment.py): `department_assignment.py`
- [Draft Generation](https://github.com/krishgarg344/intelligent-customer-case-processing-system/blob/main/main.py): `main.py`

### Other components

- **CRM Client**
- **Gemini API**

## Connections

- CRM Client → Ticket Endpoint: submits ticket (evidence: `main.py`)
- Ticket Endpoint → Category Inference: predicts category (evidence: `main.py`)
- Ticket Endpoint → Priority Inference: predicts priority (evidence: `main.py`)
- Ticket Endpoint → Department Mapping: assigns department (evidence: `main.py`)
- Ticket Endpoint → Draft Generation: generates draft (evidence: `main.py`)
- Draft Generation → Gemini API: requests content (evidence: `main.py`)
- Ticket Endpoint → CRM Client: returns results (evidence: `main.py`)
- Labeled Tickets → Category Training: training data (evidence: `README.md`)
- Labeled Tickets → Priority Training: labeled tickets (evidence: `README.md`)
