# mithungoutham92/hhd architecture

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

- Interactive diagram: https://gitdiagram.com/mithungoutham92/hhd
- Repository: https://github.com/mithungoutham92/hhd

## Overview

HuskyHelpDesk is a UW student policy-answering assistant, with a companion workflow for implementing and scoring its tools. Its runtime path translates a question, redacts personal details, classifies the office, selects a policy and drafts an answer, checks claims against that policy, then extracts deadlines, fees and documents for display. The README documents the stage order; sampled `main.py` confirms the orchestration and policy lookup. Tool implementations are unfinished, and some tool internals are represented only by documented contracts; the Ollama integration is shown as an external dependency.

Main entry points: [`main.py`](https://github.com/mithungoutham92/hhd/blob/main/main.py) (Assistant workflow), [`score.py`](https://github.com/mithungoutham92/hhd/blob/main/score.py) (Tool case scorer), [`llm/utils.py`](https://github.com/mithungoutham92/hhd/blob/main/llm/utils.py) (JSON and text utilities), [`llm/language.py`](https://github.com/mithungoutham92/hhd/blob/main/llm/language.py) (Language translation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Question answering"]
  node_main["Assistant workflow<br/>[main.py]"]
  node_policy_lookup["Office policy lookup<br/>[main.py]"]
  node_display["Answer and details display<br/>[main.py]"]
end

subgraph group_tools["Language tools"]
  node_language["Language translation<br/>[language.py]"]
  node_privacy["Privacy redaction<br/>[privacy.py]"]
  node_sorter["Office and urgency<br/>[sorter.py]"]
  node_reply["Policy answer drafting<br/>[reply.py]"]
  node_fact_check["Policy fact checking<br/>[fact_check.py]"]
  node_details["Policy detail extraction<br/>[details.py]"]
  node_utilities["JSON and text utilities<br/>[utils.py]"]
end

subgraph group_policy["Policy data"]
  node_policies[("UW policy records<br/>[policies.json]")]
  node_demo_cases["Demo questions<br/>[cases.json]"]
end

subgraph group_evaluation["Tool scoring"]
  node_scorer["Tool case scorer<br/>[score.py]"]
  node_given_cases["Scoring cases<br/>[cases.json]"]
  node_own_cases["User-authored cases"]
end

node_student(("UW student"))
node_ollama{{"Ollama model service"}}

node_student -->|"asks"| node_main
node_main -->|"translates via"| node_language
node_main -->|"redacts via"| node_privacy
node_main -->|"classifies via"| node_sorter
node_main -->|"looks up office"| node_policy_lookup
node_policy_lookup -->|"reads"| node_policies
node_main -->|"drafts with"| node_reply
node_main -->|"checks draft via"| node_fact_check
node_main -->|"extracts via"| node_details
node_main -->|"prints results"| node_display
node_main -->|"loads demo"| node_demo_cases
node_language -->|"calls model"| node_ollama
node_privacy -->|"calls model"| node_ollama
node_sorter -->|"calls model"| node_ollama
node_reply -->|"calls model"| node_ollama
node_fact_check -->|"calls model"| node_ollama
node_details -->|"calls model"| node_ollama
node_language -->|"parses JSON"| node_utilities
node_privacy -->|"parses JSON"| node_utilities
node_sorter -->|"parses JSON"| node_utilities
node_reply -->|"parses JSON"| node_utilities
node_fact_check -->|"splits and parses"| node_utilities
node_details -->|"parses JSON"| node_utilities
node_scorer -->|"scores tool"| node_language
node_scorer -->|"scores tool"| node_privacy
node_scorer -->|"scores tool"| node_sorter
node_scorer -->|"scores tool"| node_fact_check
node_scorer -->|"scores tool"| node_details
node_scorer -->|"loads cases"| node_given_cases
node_scorer -->|"loads cases"| node_own_cases

click node_main "https://github.com/mithungoutham92/hhd/blob/main/main.py"
click node_policy_lookup "https://github.com/mithungoutham92/hhd/blob/main/main.py"
click node_display "https://github.com/mithungoutham92/hhd/blob/main/main.py"
click node_language "https://github.com/mithungoutham92/hhd/blob/main/llm/language.py"
click node_privacy "https://github.com/mithungoutham92/hhd/blob/main/llm/privacy.py"
click node_sorter "https://github.com/mithungoutham92/hhd/blob/main/llm/sorter.py"
click node_reply "https://github.com/mithungoutham92/hhd/blob/main/llm/reply.py"
click node_fact_check "https://github.com/mithungoutham92/hhd/blob/main/llm/fact_check.py"
click node_details "https://github.com/mithungoutham92/hhd/blob/main/llm/details.py"
click node_utilities "https://github.com/mithungoutham92/hhd/blob/main/llm/utils.py"
click node_policies "https://github.com/mithungoutham92/hhd/blob/main/data/policies.json"
click node_demo_cases "https://github.com/mithungoutham92/hhd/blob/main/data/cases.json"
click node_scorer "https://github.com/mithungoutham92/hhd/blob/main/score.py"
click node_given_cases "https://github.com/mithungoutham92/hhd/blob/main/data/cases.json"
click node_own_cases "https://github.com/mithungoutham92/hhd/tree/main/data/my_cases"

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_main,node_policy_lookup,node_display toneBlue
class node_language,node_privacy,node_sorter,node_reply,node_fact_check,node_details,node_utilities toneAmber
class node_policies,node_demo_cases toneMint
class node_scorer,node_given_cases,node_own_cases toneRose
class node_student,node_ollama toneIndigo
```

## Components

### Question answering

- [Assistant workflow](https://github.com/mithungoutham92/hhd/blob/main/main.py): `main.py`
- [Office policy lookup](https://github.com/mithungoutham92/hhd/blob/main/main.py): `main.py`
- [Answer and details display](https://github.com/mithungoutham92/hhd/blob/main/main.py): `main.py`

### Language tools

- [Language translation](https://github.com/mithungoutham92/hhd/blob/main/llm/language.py): `llm/language.py`
- [Privacy redaction](https://github.com/mithungoutham92/hhd/blob/main/llm/privacy.py): `llm/privacy.py`
- [Office and urgency](https://github.com/mithungoutham92/hhd/blob/main/llm/sorter.py): `llm/sorter.py`
- [Policy answer drafting](https://github.com/mithungoutham92/hhd/blob/main/llm/reply.py): `llm/reply.py`
- [Policy fact checking](https://github.com/mithungoutham92/hhd/blob/main/llm/fact_check.py): `llm/fact_check.py`
- [Policy detail extraction](https://github.com/mithungoutham92/hhd/blob/main/llm/details.py): `llm/details.py`
- [JSON and text utilities](https://github.com/mithungoutham92/hhd/blob/main/llm/utils.py): `llm/utils.py`

### Policy data

- [UW policy records](https://github.com/mithungoutham92/hhd/blob/main/data/policies.json): `data/policies.json`
- [Demo questions](https://github.com/mithungoutham92/hhd/blob/main/data/cases.json): `data/cases.json`

### Tool scoring

- [Tool case scorer](https://github.com/mithungoutham92/hhd/blob/main/score.py): `score.py`
- [Scoring cases](https://github.com/mithungoutham92/hhd/blob/main/data/cases.json): `data/cases.json`
- [User-authored cases](https://github.com/mithungoutham92/hhd/tree/main/data/my_cases): `data/my_cases`

### Other components

- **UW student**
- **Ollama model service**

## Connections

- UW student → Assistant workflow: asks (evidence: `README.md`)
- Assistant workflow → Language translation: translates via (evidence: `main.py`)
- Assistant workflow → Privacy redaction: redacts via (evidence: `main.py`)
- Assistant workflow → Office and urgency: classifies via (evidence: `main.py`)
- Assistant workflow → Office policy lookup: looks up office (evidence: `main.py`)
- Office policy lookup → UW policy records: reads (evidence: `README.md`)
- Assistant workflow → Policy answer drafting: drafts with (evidence: `main.py`)
- Assistant workflow → Policy fact checking: checks draft via (evidence: `main.py`)
- Assistant workflow → Policy detail extraction: extracts via (evidence: `main.py`)
- Assistant workflow → Answer and details display: prints results (evidence: `main.py`)
- Assistant workflow → Demo questions: loads demo (evidence: `main.py`)
- Language translation → Ollama model service: calls model (evidence: `llm/language.py`)
- Privacy redaction → Ollama model service: calls model (evidence: `llm/privacy.py`)
- Office and urgency → Ollama model service: calls model (evidence: `llm/sorter.py`)
- Policy answer drafting → Ollama model service: calls model (evidence: `llm/reply.py`)
- Policy fact checking → Ollama model service: calls model (evidence: `llm/fact_check.py`)
- Policy detail extraction → Ollama model service: calls model (evidence: `llm/details.py`)
- Language translation → JSON and text utilities: parses JSON (evidence: `llm/language.py`)
- Privacy redaction → JSON and text utilities: parses JSON (evidence: `llm/privacy.py`)
- Office and urgency → JSON and text utilities: parses JSON (evidence: `llm/sorter.py`)
- Policy answer drafting → JSON and text utilities: parses JSON (evidence: `llm/reply.py`)
- Policy fact checking → JSON and text utilities: splits and parses (evidence: `llm/fact_check.py`)
- Policy detail extraction → JSON and text utilities: parses JSON (evidence: `llm/details.py`)
- Tool case scorer → Language translation: scores tool (evidence: `score.py`)
- Tool case scorer → Privacy redaction: scores tool (evidence: `score.py`)
- Tool case scorer → Office and urgency: scores tool (evidence: `score.py`)
- Tool case scorer → Policy fact checking: scores tool (evidence: `score.py`)
- Tool case scorer → Policy detail extraction: scores tool (evidence: `score.py`)
- Tool case scorer → Scoring cases: loads cases (evidence: `score.py`)
- Tool case scorer → User-authored cases: loads cases (evidence: `score.py`)
