# eswarsainathreddy/ai_assisted_tickt_management_system architecture

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

- Interactive diagram: https://gitdiagram.com/eswarsainathreddy/ai_assisted_tickt_management_system
- Repository: https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system

## Overview

This is a Streamlit/FastAPI ticket-resolution app. The main workflow is user sign-in, ticket creation or agent execution, LangGraph classification and response drafting, then human review/resumption or resolution; ticket and thread state is stored in PostgreSQL. The README also describes webhook ingestion, RAG knowledge retrieval, observability, and an operations dashboard. Those documented capabilities are included, but unsampled implementation details and their wiring remain unverified.

Main entry points: [`src/database.py`](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/database.py) (PostgreSQL access), [`src/ui_utils.py`](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/ui_utils.py) (UI API client), [`src/nodes.py`](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/nodes.py) (Agent stages), [`src/main.py`](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/main.py) (API application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Streamlit interface"]
  node_pages["Ticket pages"]
  node_ui["UI API client<br/>[ui_utils.py]"]
end

subgraph group_api["FastAPI services"]
  node_auth["Authentication<br/>[auth.py]"]
  node_ticket_api["Ticket API<br/>[tickets.py]"]
  node_agent_api["Agent API<br/>[agent.py]"]
  node_thread_api["Thread API<br/>[threads.py]"]
  node_api_app["API application<br/>[main.py]"]
  node_hashing["Password hashing<br/>[hashing.py]"]
  node_jwt["JWT handling<br/>[jwt_handler.py]"]
end

subgraph group_agent["Agent workflow"]
  node_graph["Workflow graph<br/>[graph.py]"]
  node_agent_nodes["Agent stages<br/>[nodes.py]"]
  node_state["Incident state<br/>[state.py]"]
  node_llms["LLM configuration<br/>[llms.py]"]
  node_prompts["Agent prompts<br/>[prompts.py]"]
  node_retrieval["Knowledge retrieval<br/>[retrieval.py]"]
end

subgraph group_data["Ticket data"]
  node_database[("PostgreSQL access<br/>[database.py]")]
  node_users["User records<br/>[Users.py]"]
  node_tickets["Ticket records<br/>[Tickets.py]"]
  node_threads["Workflow threads<br/>[Threads.py]"]
end

node_user(("Support user"))
node_reviewer(("Human reviewer"))
node_knowledge["SOPs and history"]
node_qdrant[("Qdrant vector store")]
node_langsmith["LangSmith"]
node_ticket_platform["Ticketing platforms"]

node_user -->|"uses"| node_pages
node_pages -->|"calls"| node_ui
node_ui -->|"signs in"| node_auth
node_ui -->|"manages tickets"| node_ticket_api
node_ui -->|"runs or resumes"| node_agent_api
node_ui -->|"looks up thread"| node_thread_api
node_api_app -->|"registers"| node_auth
node_api_app -->|"registers"| node_ticket_api
node_api_app -->|"registers"| node_agent_api
node_api_app -->|"registers"| node_thread_api
node_auth -->|"hashes passwords"| node_hashing
node_auth -->|"issues tokens"| node_jwt
node_auth -->|"queries users"| node_database
node_ticket_api -->|"reads and writes"| node_database
node_ticket_api -->|"uses records"| node_tickets
node_thread_api -->|"reads and writes"| node_database
node_agent_api -->|"invokes"| node_graph
node_agent_api -->|"updates over HTTP"| node_thread_api
node_agent_api -->|"uses session"| node_database
node_graph -->|"dispatches stages"| node_agent_nodes
node_graph -->|"uses state"| node_state
node_agent_nodes -->|"reads and updates"| node_state
node_agent_nodes -->|"uses models"| node_llms
node_agent_nodes -->|"uses prompts"| node_prompts
node_agent_nodes -->|"retrieves context"| node_retrieval
node_database -->|"provides ORM base"| node_users
node_database -->|"provides ORM base"| node_tickets
node_database -->|"provides ORM base"| node_threads
node_tickets -->|"references user"| node_users
node_threads -->|"references ticket"| node_tickets
node_reviewer -.->|"reviews response"| node_ui
node_ticket_platform -.->|"sends webhook"| node_api_app
node_retrieval -.->|"searches knowledge"| node_qdrant
node_knowledge -.->|"indexed for retrieval"| node_qdrant
node_graph -.->|"traced by"| node_langsmith

click node_pages "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/tree/main/pages"
click node_ui "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/ui_utils.py"
click node_auth "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/routes/auth.py"
click node_ticket_api "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/routes/tickets.py"
click node_agent_api "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/routes/agent.py"
click node_thread_api "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/routes/threads.py"
click node_api_app "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/main.py"
click node_hashing "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/utils/hashing.py"
click node_jwt "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/utils/jwt_handler.py"
click node_graph "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/graph.py"
click node_agent_nodes "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/nodes.py"
click node_state "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/state.py"
click node_llms "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/llms.py"
click node_prompts "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/prompts.py"
click node_retrieval "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/retrieval.py"
click node_database "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/database.py"
click node_users "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/models/Users.py"
click node_tickets "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/models/Tickets.py"
click node_threads "https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/models/Threads.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_pages,node_ui,node_user,node_reviewer toneBlue
class node_auth,node_ticket_api,node_agent_api,node_thread_api,node_api_app,node_hashing,node_jwt,node_qdrant toneAmber
class node_graph,node_agent_nodes,node_state,node_llms,node_prompts,node_retrieval toneMint
class node_database,node_users,node_tickets,node_threads toneRose
class node_knowledge,node_langsmith,node_ticket_platform toneIndigo
```

## Components

### Streamlit interface

- [Ticket pages](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/tree/main/pages): `pages`
- [UI API client](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/ui_utils.py): `src/ui_utils.py`

### FastAPI services

- [Authentication](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/routes/auth.py): `src/routes/auth.py`
- [Ticket API](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/routes/tickets.py): `src/routes/tickets.py`
- [Agent API](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/routes/agent.py): `src/routes/agent.py`
- [Thread API](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/routes/threads.py): `src/routes/threads.py`
- [API application](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/main.py): `src/main.py`
- [Password hashing](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/utils/hashing.py): `src/utils/hashing.py`
- [JWT handling](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/utils/jwt_handler.py): `src/utils/jwt_handler.py`

### Agent workflow

- [Workflow graph](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/graph.py): `src/graph.py`
- [Agent stages](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/nodes.py): `src/nodes.py`
- [Incident state](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/state.py): `src/state.py`
- [LLM configuration](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/llms.py): `src/llms.py`
- [Agent prompts](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/prompts.py): `src/prompts.py`
- [Knowledge retrieval](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/retrieval.py): `src/retrieval.py`

### Ticket data

- [PostgreSQL access](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/database.py): `src/database.py`
- [User records](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/models/Users.py): `src/models/Users.py`
- [Ticket records](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/models/Tickets.py): `src/models/Tickets.py`
- [Workflow threads](https://github.com/eswarsainathreddy/ai_assisted_tickt_management_system/blob/main/src/models/Threads.py): `src/models/Threads.py`

### Other components

- **Support user**
- **Human reviewer**
- **SOPs and history**
- **Qdrant vector store**
- **LangSmith**
- **Ticketing platforms**

## Connections

- Support user → Ticket pages: uses (evidence: `README.md`)
- Ticket pages → UI API client: calls (evidence: `pages/home.py`)
- UI API client → Authentication: signs in (evidence: `src/ui_utils.py`)
- UI API client → Ticket API: manages tickets (evidence: `src/ui_utils.py`)
- UI API client → Agent API: runs or resumes (evidence: `src/ui_utils.py`)
- UI API client → Thread API: looks up thread (evidence: `src/ui_utils.py`)
- API application → Authentication: registers (evidence: `src/main.py`)
- API application → Ticket API: registers (evidence: `src/main.py`)
- API application → Agent API: registers (evidence: `src/main.py`)
- API application → Thread API: registers (evidence: `src/main.py`)
- Authentication → Password hashing: hashes passwords (evidence: `src/routes/auth.py`)
- Authentication → JWT handling: issues tokens (evidence: `src/routes/auth.py`)
- Authentication → PostgreSQL access: queries users (evidence: `src/routes/auth.py`)
- Ticket API → PostgreSQL access: reads and writes (evidence: `src/routes/tickets.py`)
- Ticket API → Ticket records: uses records (evidence: `src/routes/tickets.py`)
- Thread API → PostgreSQL access: reads and writes (evidence: `src/routes/threads.py`)
- Agent API → Workflow graph: invokes (evidence: `src/routes/agent.py`)
- Agent API → Thread API: updates over HTTP (evidence: `src/routes/agent.py`)
- Agent API → PostgreSQL access: uses session (evidence: `src/routes/agent.py`)
- Workflow graph → Agent stages: dispatches stages (evidence: `src/graph.py`)
- Workflow graph → Incident state: uses state (evidence: `src/graph.py`)
- Agent stages → Incident state: reads and updates (evidence: `src/nodes.py`)
- Agent stages → LLM configuration: uses models (evidence: `src/nodes.py`)
- Agent stages → Agent prompts: uses prompts (evidence: `src/nodes.py`)
- Agent stages → Knowledge retrieval: retrieves context (evidence: `src/nodes.py`)
- PostgreSQL access → User records: provides ORM base (evidence: `src/models/Users.py`)
- PostgreSQL access → Ticket records: provides ORM base (evidence: `src/models/Tickets.py`)
- PostgreSQL access → Workflow threads: provides ORM base (evidence: `src/models/Threads.py`)
- Ticket records → User records: references user (evidence: `src/models/Tickets.py`)
- Workflow threads → Ticket records: references ticket (evidence: `src/models/Threads.py`)
- Human reviewer → UI API client: reviews response (evidence: `README.md`)
- Ticketing platforms → API application: sends webhook (evidence: `README.md`)
- Knowledge retrieval → Qdrant vector store: searches knowledge (evidence: `README.md`)
- SOPs and history → Qdrant vector store: indexed for retrieval (evidence: `README.md`)
- Workflow graph → LangSmith: traced by (evidence: `README.md`)
