# kavyatejani/github-triager architecture

> Architecture diagram of the GitHub repository kavyatejani/github-triager, 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/kavyatejani/github-triager
- Repository: https://github.com/kavyatejani/github-triager

## Overview

GitHub Triager is an RL environment for training and evaluating agents on issue triage. The primary loop is client reset → server task creates an issue observation → agent submits a typed action → task grader returns reward and completion status; batch and clarification tasks add their own staged interaction. The README also documents four task modes and GRPO training. Source excerpts establish the server’s HTTP/WebSocket paths and training’s use of grading; unsampled data and task internals are represented only where README or excerpts support them.

Main entry points: [`server/app.py`](https://github.com/kavyatejani/github-triager/blob/main/server/app.py) (Environment API), [`server/environment.py`](https://github.com/kavyatejani/github-triager/blob/main/server/environment.py) (Curated issue store), [`server/graders.py`](https://github.com/kavyatejani/github-triager/blob/main/server/graders.py) (Task graders), [`client.py`](https://github.com/kavyatejani/github-triager/blob/main/client.py) (HTTP / WS clients)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Agent interfaces"]
  node_client["HTTP / WS clients<br/>[client.py]"]
  node_api["Environment API<br/>[app.py]"]
  node_ws["WebSocket messages<br/>[ws_handler.py]"]
end

subgraph group_environment["Triage environment"]
  node_actions["Action schemas<br/>[models.py]"]
  node_observations["Observation schemas<br/>[models.py]"]
  node_issue_store[("Curated issue store<br/>[environment.py]")]
  node_issue_data["Annotated issues"]
  node_project_map["Project/team map"]
  node_label_task["Label classification<br/>[environment.py]"]
  node_full_task["Full triage<br/>[environment.py]"]
  node_batch_task["Batch triage<br/>[environment.py]"]
  node_clarify_task["Clarification triage<br/>[environment.py]"]
  node_sessions[("Session store<br/>[session_store.py]")]
end

subgraph group_scoring["Reward scoring"]
  node_config["Reward configuration<br/>[config.py]"]
  node_graders["Task graders<br/>[graders.py]"]
end

subgraph group_learning["Agent learning"]
  node_inference["Baseline inference<br/>[inference.py]"]
  node_training["GRPO training"]
end

node_agent(("Triage agent"))
node_model_provider["LLM provider"]

node_agent -->|"uses"| node_client
node_client -->|"resets / steps"| node_api
node_api -->|"loads issues"| node_issue_store
node_issue_store -->|"reads"| node_issue_data
node_issue_store -->|"reads"| node_project_map
node_api -->|"dispatches"| node_label_task
node_api -->|"dispatches"| node_full_task
node_api -->|"dispatches"| node_batch_task
node_api -->|"dispatches"| node_clarify_task
node_api -->|"stores sessions"| node_sessions
node_api -->|"formats WS"| node_ws
node_ws -->|"parses actions"| node_actions
node_label_task -->|"samples issue"| node_issue_store
node_full_task -->|"samples issue"| node_issue_store
node_batch_task -->|"samples batch"| node_issue_store
node_clarify_task -->|"selects issue"| node_issue_store
node_label_task -->|"emits"| node_observations
node_full_task -->|"emits"| node_observations
node_batch_task -->|"emits"| node_observations
node_clarify_task -->|"emits"| node_observations
node_api -->|"validates"| node_actions
node_label_task -->|"scores action"| node_graders
node_full_task -->|"scores action"| node_graders
node_batch_task -->|"scores trajectory"| node_graders
node_clarify_task -->|"scores triage"| node_graders
node_graders -->|"uses weights"| node_config
node_graders -->|"grades request"| node_api
node_api -->|"returns observation / reward"| node_agent
node_agent -.->|"evaluated by"| node_inference
node_inference -->|"runs episodes"| node_client
node_inference -->|"requests completions"| node_model_provider
node_training -->|"samples episodes"| node_client
node_training -->|"requests grading"| node_api
node_training -.->|"trains model"| node_model_provider

click node_client "https://github.com/kavyatejani/github-triager/blob/main/client.py"
click node_api "https://github.com/kavyatejani/github-triager/blob/main/server/app.py"
click node_ws "https://github.com/kavyatejani/github-triager/blob/main/server/ws_handler.py"
click node_actions "https://github.com/kavyatejani/github-triager/blob/main/models.py"
click node_observations "https://github.com/kavyatejani/github-triager/blob/main/models.py"
click node_issue_store "https://github.com/kavyatejani/github-triager/blob/main/server/environment.py"
click node_issue_data "https://github.com/kavyatejani/github-triager/blob/main/data/simulated_issues.json"
click node_project_map "https://github.com/kavyatejani/github-triager/blob/main/data/project_structure.json"
click node_label_task "https://github.com/kavyatejani/github-triager/blob/main/server/environment.py"
click node_full_task "https://github.com/kavyatejani/github-triager/blob/main/server/environment.py"
click node_batch_task "https://github.com/kavyatejani/github-triager/blob/main/server/environment.py"
click node_clarify_task "https://github.com/kavyatejani/github-triager/blob/main/server/environment.py"
click node_sessions "https://github.com/kavyatejani/github-triager/blob/main/server/session_store.py"
click node_config "https://github.com/kavyatejani/github-triager/blob/main/server/config.py"
click node_graders "https://github.com/kavyatejani/github-triager/blob/main/server/graders.py"
click node_inference "https://github.com/kavyatejani/github-triager/blob/main/inference.py"
click node_training "https://github.com/kavyatejani/github-triager/blob/main/training/train_github_triager.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_client,node_api,node_ws toneBlue
class node_actions,node_observations,node_issue_store,node_issue_data,node_project_map,node_label_task,node_full_task,node_batch_task,node_clarify_task,node_sessions toneAmber
class node_config,node_graders toneMint
class node_inference,node_training toneRose
class node_agent,node_model_provider toneIndigo
```

## Components

### Agent interfaces

- [HTTP / WS clients](https://github.com/kavyatejani/github-triager/blob/main/client.py): `client.py`
- [Environment API](https://github.com/kavyatejani/github-triager/blob/main/server/app.py): `server/app.py`
- [WebSocket messages](https://github.com/kavyatejani/github-triager/blob/main/server/ws_handler.py): `server/ws_handler.py`

### Triage environment

- [Action schemas](https://github.com/kavyatejani/github-triager/blob/main/models.py): `models.py`
- [Observation schemas](https://github.com/kavyatejani/github-triager/blob/main/models.py): `models.py`
- [Curated issue store](https://github.com/kavyatejani/github-triager/blob/main/server/environment.py): `server/environment.py`
- [Annotated issues](https://github.com/kavyatejani/github-triager/blob/main/data/simulated_issues.json): `data/simulated_issues.json`
- [Project/team map](https://github.com/kavyatejani/github-triager/blob/main/data/project_structure.json): `data/project_structure.json`
- [Label classification](https://github.com/kavyatejani/github-triager/blob/main/server/environment.py): `server/environment.py`
- [Full triage](https://github.com/kavyatejani/github-triager/blob/main/server/environment.py): `server/environment.py`
- [Batch triage](https://github.com/kavyatejani/github-triager/blob/main/server/environment.py): `server/environment.py`
- [Clarification triage](https://github.com/kavyatejani/github-triager/blob/main/server/environment.py): `server/environment.py`
- [Session store](https://github.com/kavyatejani/github-triager/blob/main/server/session_store.py): `server/session_store.py`

### Reward scoring

- [Reward configuration](https://github.com/kavyatejani/github-triager/blob/main/server/config.py): `server/config.py`
- [Task graders](https://github.com/kavyatejani/github-triager/blob/main/server/graders.py): `server/graders.py`

### Agent learning

- [Baseline inference](https://github.com/kavyatejani/github-triager/blob/main/inference.py): `inference.py`
- [GRPO training](https://github.com/kavyatejani/github-triager/blob/main/training/train_github_triager.py): `training/train_github_triager.py`

### Other components

- **Triage agent**
- **LLM provider**

## Connections

- Triage agent → HTTP / WS clients: uses (evidence: `README.md`)
- HTTP / WS clients → Environment API: resets / steps (evidence: `client.py`)
- Environment API → Curated issue store: loads issues (evidence: `server/app.py`)
- Curated issue store → Annotated issues: reads (evidence: `server/environment.py`)
- Curated issue store → Project/team map: reads (evidence: `server/environment.py`)
- Environment API → Label classification: dispatches (evidence: `server/app.py`)
- Environment API → Full triage: dispatches (evidence: `server/app.py`)
- Environment API → Batch triage: dispatches (evidence: `server/app.py`)
- Environment API → Clarification triage: dispatches (evidence: `server/app.py`)
- Environment API → Session store: stores sessions (evidence: `server/app.py`)
- Environment API → WebSocket messages: formats WS (evidence: `server/app.py`)
- WebSocket messages → Action schemas: parses actions (evidence: `server/ws_handler.py`)
- Label classification → Curated issue store: samples issue (evidence: `server/environment.py`)
- Full triage → Curated issue store: samples issue (evidence: `server/environment.py`)
- Batch triage → Curated issue store: samples batch (evidence: `server/environment.py`)
- Clarification triage → Curated issue store: selects issue (evidence: `server/environment.py`)
- Label classification → Observation schemas: emits (evidence: `server/environment.py`)
- Full triage → Observation schemas: emits (evidence: `server/environment.py`)
- Batch triage → Observation schemas: emits (evidence: `server/environment.py`)
- Clarification triage → Observation schemas: emits (evidence: `server/environment.py`)
- Environment API → Action schemas: validates (evidence: `server/app.py`)
- Label classification → Task graders: scores action (evidence: `server/environment.py`)
- Full triage → Task graders: scores action (evidence: `server/environment.py`)
- Batch triage → Task graders: scores trajectory (evidence: `server/environment.py`)
- Clarification triage → Task graders: scores triage (evidence: `server/environment.py`)
- Task graders → Reward configuration: uses weights (evidence: `server/graders.py`)
- Task graders → Environment API: grades request (evidence: `server/app.py`)
- Environment API → Triage agent: returns observation / reward (evidence: `README.md`)
- Triage agent → Baseline inference: evaluated by (evidence: `README.md`)
- Baseline inference → HTTP / WS clients: runs episodes (evidence: `inference.py`)
- Baseline inference → LLM provider: requests completions (evidence: `inference.py`)
- GRPO training → HTTP / WS clients: samples episodes (evidence: `training/train_github_triager.py`)
- GRPO training → Environment API: requests grading (evidence: `training/train_github_triager.py`)
- GRPO training → LLM provider: trains model (evidence: `README.md`)
