# chaitanya-rajendra/intelligent-support-ticket architecture

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

- Interactive diagram: https://gitdiagram.com/chaitanya-rajendra/intelligent-support-ticket
- Repository: https://github.com/chaitanya-rajendra/intelligent-support-ticket

## Overview

This is a support-ticket triage API: incoming tickets are classified by an LLM, assigned a confidence-based outcome, and persisted for retrieval, metrics, and human review. The README describes n8n as the intake and notification orchestrator, with auto-response email and Slack or human-review routing; those integrations are documented capabilities, not shown in the sampled Python implementation. The graph includes the prompt and workflow files from the tree; their contents were not sampled.

Main entry points: [`main.py`](https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/main.py) (Ticket API), [`ticket triage workflow .JSON`](https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/ticket%20triage%20workflow%20.JSON) (n8n workflow), [`classifier.py`](https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/classifier.py) (Ticket classifier), [`database.py`](https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/database.py) (Database sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Intake and routing"]
  node_n8n["n8n workflow"]
  node_email["Auto-response email"]
  node_slack["Slack support channel"]
end

subgraph group_api["Triage API"]
  node_fastapi["Ticket API<br/>[main.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
end

subgraph group_classification["LLM classification"]
  node_classifier["Ticket classifier<br/>[classifier.py]"]
  node_prompt["Classification prompt"]
  node_openai["OpenAI API"]
end

subgraph group_persistence["Ticket persistence"]
  node_ticket_model["Ticket model<br/>[models.py]"]
  node_db_session["Database sessions<br/>[database.py]"]
  node_postgres[("PostgreSQL")]
end

node_ticket_sources(("Ticket sources"))
node_reviewer(("Human reviewer"))

node_ticket_sources -->|"sends tickets"| node_n8n
node_n8n -->|"submits tickets"| node_fastapi
node_fastapi -->|"validates and serializes"| node_schemas
node_fastapi -->|"classifies text"| node_classifier
node_classifier -->|"loads prompt"| node_prompt
node_classifier -->|"requests classification"| node_openai
node_fastapi -->|"creates and queries"| node_ticket_model
node_ticket_model -->|"uses model base"| node_db_session
node_fastapi -->|"reads and writes"| node_db_session
node_db_session -->|"connects to"| node_postgres
node_fastapi -->|"returns outcome"| node_n8n
node_n8n -->|"sends response"| node_email
node_n8n -->|"notifies support"| node_slack
node_n8n -->|"queues review"| node_reviewer
node_reviewer -->|"marks reviewed"| node_fastapi

click node_n8n "https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/ticket%20triage%20workflow%20.JSON"
click node_fastapi "https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/main.py"
click node_schemas "https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/schemas.py"
click node_classifier "https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/classifier.py"
click node_prompt "https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/classification%20prompt.txt"
click node_ticket_model "https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/models.py"
click node_db_session "https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/database.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_n8n,node_email,node_slack,node_reviewer toneBlue
class node_fastapi,node_schemas toneAmber
class node_classifier,node_prompt,node_openai toneMint
class node_ticket_model,node_db_session,node_postgres toneRose
class node_ticket_sources toneIndigo
```

## Components

### Intake and routing

- [n8n workflow](https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/ticket%20triage%20workflow%20.JSON): `ticket triage workflow .JSON`
- **Auto-response email**
- **Slack support channel**

### Triage API

- [Ticket API](https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/main.py): `main.py`
- [API schemas](https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/schemas.py): `schemas.py`

### LLM classification

- [Ticket classifier](https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/classifier.py): `classifier.py`
- [Classification prompt](https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/classification%20prompt.txt): `classification prompt.txt`
- **OpenAI API**

### Ticket persistence

- [Ticket model](https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/models.py): `models.py`
- [Database sessions](https://github.com/chaitanya-rajendra/intelligent-support-ticket/blob/main/database.py): `database.py`
- **PostgreSQL**

### Other components

- **Ticket sources**
- **Human reviewer**

## Connections

- Ticket sources → n8n workflow: sends tickets (evidence: `README.md`)
- n8n workflow → Ticket API: submits tickets (evidence: `README.md`)
- Ticket API → API schemas: validates and serializes (evidence: `main.py`)
- Ticket API → Ticket classifier: classifies text (evidence: `main.py`)
- Ticket classifier → Classification prompt: loads prompt (evidence: `classifier.py`)
- Ticket classifier → OpenAI API: requests classification (evidence: `classifier.py`)
- Ticket API → Ticket model: creates and queries (evidence: `main.py`)
- Ticket model → Database sessions: uses model base (evidence: `models.py`)
- Ticket API → Database sessions: reads and writes (evidence: `main.py`)
- Database sessions → PostgreSQL: connects to (evidence: `README.md`)
- Ticket API → n8n workflow: returns outcome (evidence: `README.md`)
- n8n workflow → Auto-response email: sends response (evidence: `README.md`)
- n8n workflow → Slack support channel: notifies support (evidence: `README.md`)
- n8n workflow → Human reviewer: queues review (evidence: `README.md`)
- Human reviewer → Ticket API: marks reviewed (evidence: `README.md`)
