# fedirrohalin/obrio-aiops-assignment architecture

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

- Interactive diagram: https://gitdiagram.com/fedirrohalin/obrio-aiops-assignment
- Repository: https://github.com/fedirrohalin/obrio-aiops-assignment

## Overview

OBRIO Support Automation has two runtime products: an AI ticket classifier for triage and a CLI assistant for support agents. The assistant accepts ticket text, loads and searches the knowledge base, then drafts a summary and tone-specific replies with a validated citation. The classifier turns ticket text into category, priority, and recommended action, with a fallback for failures. The graph reflects the shown assistant orchestration and classifier calls; classifier entry-point details and some runtime wiring are only documented or indexed, so uncertain links are omitted.

Main entry points: [`src/assistant/cli.py`](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/cli.py) (Assistant CLI), [`src/assistant/generator.py`](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/generator.py) (Reply generator), [`src/classifier.py`](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/classifier.py) (Ticket triage), [`src/assistant/llm_client.py`](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/llm_client.py) (Assistant LLM client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_classifier["Ticket classifier"]
  node_classifier_entry["Classifier entry point<br/>[main.py]"]
  node_classifier["Ticket triage<br/>[classifier.py]"]
  node_classifier_prompts["Triage prompts<br/>[prompts.py]"]
  node_classifier_result["Triage result<br/>[schemas.py]"]
end

subgraph group_assistant["Agent assistant"]
  node_assistant_cli["Assistant CLI<br/>[cli.py]"]
  node_knowledge_base["Knowledge base loader<br/>[kb.py]"]
  node_retriever["Article retrieval<br/>[retriever.py]"]
  node_assistant_prompts["Reply prompts<br/>[prompts.py]"]
  node_generator["Reply generator<br/>[generator.py]"]
  node_resilience["Retry and fallback<br/>[resilience.py]"]
  node_assistant_result["Assistant output<br/>[schemas.py]"]
end

subgraph group_shared["Models and configuration"]
  node_settings["Assistant settings<br/>[config.py]"]
  node_assistant_client["Assistant LLM client<br/>[llm_client.py]"]
  node_classifier_client["Classifier LLM client<br/>[llm_client.py]"]
  node_classifier_config["Classifier configuration<br/>[config.py]"]
end

subgraph group_services["Data and external services"]
  node_article_store[("KB articles<br/>[articles.json]")]
  node_openai{{"OpenAI API"}}
end

node_support_agent(("Support agent"))
node_ticket_source(("Incoming ticket"))

node_support_agent -->|"submits ticket"| node_assistant_cli
node_ticket_source -.->|"provides ticket"| node_classifier_entry
node_classifier_entry -->|"routes to"| node_classifier
node_classifier -->|"builds prompt"| node_classifier_prompts
node_classifier -->|"requests completion"| node_classifier_client
node_classifier -->|"validates output"| node_classifier_result
node_classifier_client -->|"uses model"| node_classifier_config
node_classifier_client -->|"calls API"| node_openai
node_assistant_cli -->|"loads settings"| node_settings
node_assistant_cli -->|"loads articles"| node_knowledge_base
node_knowledge_base -->|"reads articles"| node_article_store
node_assistant_cli -->|"searches articles"| node_retriever
node_retriever -->|"gets articles"| node_knowledge_base
node_assistant_cli -->|"initializes client"| node_assistant_client
node_assistant_cli -->|"requests drafts"| node_generator
node_generator -->|"builds prompt"| node_assistant_prompts
node_generator -->|"requests completion"| node_assistant_client
node_generator -->|"uses retries"| node_resilience
node_generator -->|"validates output"| node_assistant_result
node_assistant_client -->|"uses settings"| node_settings
node_assistant_client -->|"calls API"| node_openai
node_assistant_cli -->|"prints drafts"| node_support_agent

click node_classifier_entry "https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/main.py"
click node_classifier "https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/classifier.py"
click node_classifier_prompts "https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/prompts.py"
click node_classifier_result "https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/schemas.py"
click node_assistant_cli "https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/cli.py"
click node_settings "https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/config.py"
click node_knowledge_base "https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/kb.py"
click node_article_store "https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/data/kb/articles.json"
click node_retriever "https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/retriever.py"
click node_assistant_prompts "https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/prompts.py"
click node_generator "https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/generator.py"
click node_resilience "https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/resilience.py"
click node_assistant_result "https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/schemas.py"
click node_assistant_client "https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/llm_client.py"
click node_classifier_client "https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/llm_client.py"
click node_classifier_config "https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/config.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_classifier_entry,node_classifier,node_classifier_prompts,node_classifier_result toneBlue
class node_assistant_cli,node_knowledge_base,node_retriever,node_assistant_prompts,node_generator,node_resilience,node_assistant_result toneAmber
class node_settings,node_assistant_client,node_classifier_client,node_classifier_config toneMint
class node_article_store,node_openai toneRose
class node_support_agent,node_ticket_source toneIndigo
```

## Components

### Ticket classifier

- [Classifier entry point](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/main.py): `src/main.py`
- [Ticket triage](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/classifier.py): `src/classifier.py`
- [Triage prompts](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/prompts.py): `src/prompts.py`
- [Triage result](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/schemas.py): `src/schemas.py`

### Agent assistant

- [Assistant CLI](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/cli.py): `src/assistant/cli.py`
- [Knowledge base loader](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/kb.py): `src/assistant/kb.py`
- [Article retrieval](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/retriever.py): `src/assistant/retriever.py`
- [Reply prompts](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/prompts.py): `src/assistant/prompts.py`
- [Reply generator](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/generator.py): `src/assistant/generator.py`
- [Retry and fallback](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/resilience.py): `src/assistant/resilience.py`
- [Assistant output](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/schemas.py): `src/assistant/schemas.py`

### Models and configuration

- [Assistant settings](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/config.py): `src/assistant/config.py`
- [Assistant LLM client](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/assistant/llm_client.py): `src/assistant/llm_client.py`
- [Classifier LLM client](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/llm_client.py): `src/llm_client.py`
- [Classifier configuration](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/src/config.py): `src/config.py`

### Data and external services

- [KB articles](https://github.com/fedirrohalin/obrio-aiops-assignment/blob/main/data/kb/articles.json): `data/kb/articles.json`
- **OpenAI API**

### Other components

- **Support agent**
- **Incoming ticket**

## Connections

- Support agent → Assistant CLI: submits ticket (evidence: `README.md`)
- Incoming ticket → Classifier entry point: provides ticket (evidence: `README.md`)
- Classifier entry point → Ticket triage: routes to (evidence: `src/main.py`)
- Ticket triage → Triage prompts: builds prompt (evidence: `src/classifier.py`)
- Ticket triage → Classifier LLM client: requests completion (evidence: `src/classifier.py`)
- Ticket triage → Triage result: validates output (evidence: `src/classifier.py`)
- Classifier LLM client → Classifier configuration: uses model (evidence: `src/llm_client.py`)
- Classifier LLM client → OpenAI API: calls API (evidence: `src/llm_client.py`)
- Assistant CLI → Assistant settings: loads settings (evidence: `src/assistant/cli.py`)
- Assistant CLI → Knowledge base loader: loads articles (evidence: `src/assistant/cli.py`)
- Knowledge base loader → KB articles: reads articles (evidence: `src/assistant/kb.py`)
- Assistant CLI → Article retrieval: searches articles (evidence: `src/assistant/cli.py`)
- Article retrieval → Knowledge base loader: gets articles (evidence: `src/assistant/retriever.py`)
- Assistant CLI → Assistant LLM client: initializes client (evidence: `src/assistant/cli.py`)
- Assistant CLI → Reply generator: requests drafts (evidence: `src/assistant/cli.py`)
- Reply generator → Reply prompts: builds prompt (evidence: `src/assistant/generator.py`)
- Reply generator → Assistant LLM client: requests completion (evidence: `src/assistant/generator.py`)
- Reply generator → Retry and fallback: uses retries (evidence: `src/assistant/generator.py`)
- Reply generator → Assistant output: validates output (evidence: `src/assistant/generator.py`)
- Assistant LLM client → Assistant settings: uses settings (evidence: `src/assistant/llm_client.py`)
- Assistant LLM client → OpenAI API: calls API (evidence: `src/assistant/llm_client.py`)
- Assistant CLI → Support agent: prints drafts (evidence: `src/assistant/cli.py`)
