# manopriyan88-tech/devtriage-ai architecture

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

- Interactive diagram: https://gitdiagram.com/manopriyan88-tech/devtriage-ai
- Repository: https://github.com/manopriyan88-tech/devtriage-ai

## Overview

DevTriage-AI provides two ticket-triage workflows: an interactive Streamlit demo and a command-line CSV batch processor. Both ground decisions in the knowledge base and produce validated category, priority, action, confidence, rationale, and response fields. The UI uses Groq with deterministic offline fallback; the batch path uses Gemini with retry and rate-limit handling. The batch source and UI are excerpted, but their connections to external services and data files are documented only where those excerpts show them.

Main entry points: [`app.py`](https://github.com/manopriyan88-tech/devtriage-ai/blob/main/app.py) (Interactive Triage), [`agent.py`](https://github.com/manopriyan88-tech/devtriage-ai/blob/main/agent.py) (Batch Runner), [`knowledge_base.json`](https://github.com/manopriyan88-tech/devtriage-ai/blob/main/knowledge_base.json) (Knowledge Base), [`tickets.csv`](https://github.com/manopriyan88-tech/devtriage-ai/blob/main/tickets.csv) (Ticket CSV)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_streamlit_ui["Triage UI<br/>[app.py]"]
  node_batch_runner["Batch Runner<br/>[agent.py]"]
end

subgraph group_triage["Triage Logic"]
  node_ui_triage["Interactive Triage<br/>[app.py]"]
  node_offline_rules["Offline Rules<br/>[app.py]"]
  node_batch_triage["Ticket Triage<br/>[agent.py]"]
  node_decision_schema["Decision Schema<br/>[app.py]"]
  node_batch_schema["Batch Decision Schema<br/>[agent.py]"]
end

subgraph group_grounding["Knowledge and Data"]
  node_knowledge_base["Knowledge Base"]
  node_ticket_csv["Ticket CSV<br/>[tickets.csv]"]
  node_results_csv["Triage Results<br/>[triage_results.csv]"]
end

subgraph group_inference["Inference Services"]
  node_groq{{"Groq API"}}
  node_gemini{{"Gemini API"}}
end

node_user(("Support Operator"))

node_user -->|"submits ticket"| node_streamlit_ui
node_streamlit_ui -->|"starts triage"| node_ui_triage
node_ui_triage -->|"loads context"| node_knowledge_base
node_ui_triage -->|"requests inference"| node_groq
node_ui_triage -->|"falls back"| node_offline_rules
node_ui_triage -->|"validates result"| node_decision_schema
node_streamlit_ui -->|"displays decision"| node_user
node_batch_runner -->|"loads context"| node_knowledge_base
node_batch_runner -->|"reads tickets"| node_ticket_csv
node_batch_runner -->|"triages tickets"| node_batch_triage
node_batch_triage -->|"requests inference"| node_gemini
node_batch_triage -->|"validates response"| node_batch_schema
node_batch_runner -->|"writes results"| node_results_csv

click node_streamlit_ui "https://github.com/manopriyan88-tech/devtriage-ai/blob/main/app.py"
click node_batch_runner "https://github.com/manopriyan88-tech/devtriage-ai/blob/main/agent.py"
click node_ui_triage "https://github.com/manopriyan88-tech/devtriage-ai/blob/main/app.py"
click node_offline_rules "https://github.com/manopriyan88-tech/devtriage-ai/blob/main/app.py"
click node_batch_triage "https://github.com/manopriyan88-tech/devtriage-ai/blob/main/agent.py"
click node_decision_schema "https://github.com/manopriyan88-tech/devtriage-ai/blob/main/app.py"
click node_batch_schema "https://github.com/manopriyan88-tech/devtriage-ai/blob/main/agent.py"
click node_knowledge_base "https://github.com/manopriyan88-tech/devtriage-ai/blob/main/knowledge_base.json"
click node_ticket_csv "https://github.com/manopriyan88-tech/devtriage-ai/blob/main/tickets.csv"
click node_results_csv "https://github.com/manopriyan88-tech/devtriage-ai/blob/main/triage_results.csv"

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_streamlit_ui,node_batch_runner toneBlue
class node_ui_triage,node_offline_rules,node_batch_triage,node_decision_schema,node_batch_schema toneAmber
class node_knowledge_base,node_ticket_csv,node_results_csv toneMint
class node_groq,node_gemini toneRose
class node_user toneIndigo
```

## Components

### User Interfaces

- [Triage UI](https://github.com/manopriyan88-tech/devtriage-ai/blob/main/app.py): `app.py`
- [Batch Runner](https://github.com/manopriyan88-tech/devtriage-ai/blob/main/agent.py): `agent.py`

### Triage Logic

- [Interactive Triage](https://github.com/manopriyan88-tech/devtriage-ai/blob/main/app.py): `app.py`
- [Offline Rules](https://github.com/manopriyan88-tech/devtriage-ai/blob/main/app.py): `app.py`
- [Ticket Triage](https://github.com/manopriyan88-tech/devtriage-ai/blob/main/agent.py): `agent.py`
- [Decision Schema](https://github.com/manopriyan88-tech/devtriage-ai/blob/main/app.py): `app.py`
- [Batch Decision Schema](https://github.com/manopriyan88-tech/devtriage-ai/blob/main/agent.py): `agent.py`

### Knowledge and Data

- [Knowledge Base](https://github.com/manopriyan88-tech/devtriage-ai/blob/main/knowledge_base.json): `knowledge_base.json`
- [Ticket CSV](https://github.com/manopriyan88-tech/devtriage-ai/blob/main/tickets.csv): `tickets.csv`
- [Triage Results](https://github.com/manopriyan88-tech/devtriage-ai/blob/main/triage_results.csv): `triage_results.csv`

### Inference Services

- **Groq API**
- **Gemini API**

### Other components

- **Support Operator**

## Connections

- Support Operator → Triage UI: submits ticket (evidence: `app.py`)
- Triage UI → Interactive Triage: starts triage (evidence: `app.py`)
- Interactive Triage → Knowledge Base: loads context (evidence: `app.py`)
- Interactive Triage → Groq API: requests inference (evidence: `app.py`)
- Interactive Triage → Offline Rules: falls back (evidence: `app.py`)
- Interactive Triage → Decision Schema: validates result (evidence: `app.py`)
- Triage UI → Support Operator: displays decision (evidence: `app.py`)
- Batch Runner → Knowledge Base: loads context (evidence: `agent.py`)
- Batch Runner → Ticket CSV: reads tickets (evidence: `agent.py`)
- Batch Runner → Ticket Triage: triages tickets (evidence: `agent.py`)
- Ticket Triage → Gemini API: requests inference (evidence: `agent.py`)
- Ticket Triage → Batch Decision Schema: validates response (evidence: `agent.py`)
- Batch Runner → Triage Results: writes results (evidence: `agent.py`)
