# inesbolanos/hire-ai-framework architecture

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

- Interactive diagram: https://gitdiagram.com/inesbolanos/hire-ai-framework
- Repository: https://github.com/inesbolanos/hire-ai-framework

## Overview

H.I.R.E. is an analytics toolkit for deciding whether to hire, train, or fire an AI agent and for measuring agent performance from conversation telemetry. Its main runtime workflow ingests conversations, applies deterministic routing and resolution analysis, classifies residual messages with an LLM, escalates uncertain results and audits “other,” routes unresolved cases for human review, then discovers topics and reports metrics. Analysts can also score classification against a labeled gold set. The README documents additional framework guidance and sample data; unsampled subsystems are included only where those capabilities are documented.

Main entry points: [`src/hire_pipeline/pipeline.py`](https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/pipeline.py) (CLI and orchestration), [`src/hire_pipeline/llm.py`](https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/llm.py) (Warehouse LLM client), [`src/hire_pipeline/llm_classify.py`](https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/llm_classify.py) (Residual classification), [`src/hire_pipeline/escalation.py`](https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/escalation.py) (Low-confidence escalation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Pipeline workflow"]
  node_pipeline["CLI and orchestration<br/>[pipeline.py]"]
  node_source_data["Conversation data"]
  node_deterministic["Deterministic routing"]
end

subgraph group_inference["Classification and review"]
  node_classification["Residual classification<br/>[llm_classify.py]"]
  node_prompts["Prompt construction<br/>[prompts.py]"]
  node_llm_client["Warehouse LLM client<br/>[llm.py]"]
  node_escalation["Low-confidence escalation<br/>[escalation.py]"]
  node_audit["Other-bucket audit<br/>[audit.py]"]
  node_hitl["Human review queue<br/>[hitl_queue.py]"]
end

subgraph group_insights["Analytics and evaluation"]
  node_topic_discovery["Topic discovery<br/>[topic_discovery.py]"]
  node_agent_metrics["Agent metrics<br/>[agent_metrics.py]"]
  node_evaluation["Gold-set evaluation<br/>[evaluation.py]"]
  node_gold_set["Labeled gold set"]
  node_framework_guidance["H.I.R.E. guidance<br/>[hire-checklist.md]"]
  node_metrics_guide["Metric definitions"]
end

subgraph group_platform["Configuration and storage"]
  node_config["Pipeline configuration<br/>[config.py]"]
  node_taxonomy["Agent taxonomy<br/>[taxonomy.yaml]"]
  node_store[("SQL table storage<br/>[store.py]")]
end

node_analyst(("Product analyst"))
node_warehouse_model{{"Warehouse LLM function"}}

node_analyst -->|"runs commands"| node_pipeline
node_source_data -->|"provides conversations"| node_pipeline
node_pipeline -->|"runs routing"| node_deterministic
node_deterministic -->|"reads and writes"| node_store
node_pipeline -->|"runs classification"| node_classification
node_classification -->|"builds prompts"| node_prompts
node_classification -->|"classifies batches"| node_llm_client
node_llm_client -->|"queries model"| node_warehouse_model
node_classification -->|"reads and writes"| node_store
node_pipeline -->|"runs escalation"| node_escalation
node_escalation -->|"rechecks uncertain rows"| node_llm_client
node_escalation -->|"queues unresolved rows"| node_hitl
node_pipeline -->|"runs audit"| node_audit
node_audit -->|"audits other rows"| node_llm_client
node_audit -->|"queues review cases"| node_hitl
node_pipeline -->|"runs discovery"| node_topic_discovery
node_topic_discovery -->|"names clusters"| node_llm_client
node_pipeline -->|"computes metrics"| node_agent_metrics
node_pipeline -->|"scores predictions"| node_evaluation
node_gold_set -->|"supplies labels"| node_pipeline
node_pipeline -->|"creates SQL store"| node_store
node_config -->|"loads taxonomy"| node_taxonomy
node_analyst -->|"uses decision guidance"| node_framework_guidance
node_analyst -->|"selects metrics"| node_metrics_guide

click node_pipeline "https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/pipeline.py"
click node_deterministic "https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/deterministic_categorization.py"
click node_classification "https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/llm_classify.py"
click node_prompts "https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/prompts.py"
click node_llm_client "https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/llm.py"
click node_escalation "https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/escalation.py"
click node_audit "https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/audit.py"
click node_hitl "https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/hitl_queue.py"
click node_topic_discovery "https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/topic_discovery.py"
click node_agent_metrics "https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/agent_metrics.py"
click node_evaluation "https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/evaluation.py"
click node_gold_set "https://github.com/inesbolanos/hire-ai-framework/blob/main/datasets/fraud-agent/gold_set.example.csv"
click node_framework_guidance "https://github.com/inesbolanos/hire-ai-framework/blob/main/framework/hire-checklist.md"
click node_metrics_guide "https://github.com/inesbolanos/hire-ai-framework/blob/main/framework/agent-metrics/ai-agent-metrics.md"
click node_config "https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/config.py"
click node_taxonomy "https://github.com/inesbolanos/hire-ai-framework/blob/main/taxonomy.yaml"
click node_store "https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/store.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_pipeline,node_source_data,node_deterministic toneBlue
class node_classification,node_prompts,node_llm_client,node_escalation,node_audit,node_hitl toneAmber
class node_topic_discovery,node_agent_metrics,node_evaluation,node_gold_set,node_framework_guidance,node_metrics_guide toneMint
class node_config,node_taxonomy,node_store toneRose
class node_analyst,node_warehouse_model toneIndigo
```

## Components

### Pipeline workflow

- [CLI and orchestration](https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/pipeline.py): `src/hire_pipeline/pipeline.py`
- **Conversation data**
- [Deterministic routing](https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/deterministic_categorization.py): `src/hire_pipeline/deterministic_categorization.py`

### Classification and review

- [Residual classification](https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/llm_classify.py): `src/hire_pipeline/llm_classify.py`
- [Prompt construction](https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/prompts.py): `src/hire_pipeline/prompts.py`
- [Warehouse LLM client](https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/llm.py): `src/hire_pipeline/llm.py`
- [Low-confidence escalation](https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/escalation.py): `src/hire_pipeline/escalation.py`
- [Other-bucket audit](https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/audit.py): `src/hire_pipeline/audit.py`
- [Human review queue](https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/hitl_queue.py): `src/hire_pipeline/hitl_queue.py`

### Analytics and evaluation

- [Topic discovery](https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/topic_discovery.py): `src/hire_pipeline/topic_discovery.py`
- [Agent metrics](https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/agent_metrics.py): `src/hire_pipeline/agent_metrics.py`
- [Gold-set evaluation](https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/evaluation.py): `src/hire_pipeline/evaluation.py`
- [Labeled gold set](https://github.com/inesbolanos/hire-ai-framework/blob/main/datasets/fraud-agent/gold_set.example.csv): `datasets/fraud-agent/gold_set.example.csv`
- [H.I.R.E. guidance](https://github.com/inesbolanos/hire-ai-framework/blob/main/framework/hire-checklist.md): `framework/hire-checklist.md`
- [Metric definitions](https://github.com/inesbolanos/hire-ai-framework/blob/main/framework/agent-metrics/ai-agent-metrics.md): `framework/agent-metrics/ai-agent-metrics.md`

### Configuration and storage

- [Pipeline configuration](https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/config.py): `src/hire_pipeline/config.py`
- [Agent taxonomy](https://github.com/inesbolanos/hire-ai-framework/blob/main/taxonomy.yaml): `taxonomy.yaml`
- [SQL table storage](https://github.com/inesbolanos/hire-ai-framework/blob/main/src/hire_pipeline/store.py): `src/hire_pipeline/store.py`

### Other components

- **Product analyst**
- **Warehouse LLM function**

## Connections

- Product analyst → CLI and orchestration: runs commands (evidence: `README.md`)
- Conversation data → CLI and orchestration: provides conversations (evidence: `README.md`)
- CLI and orchestration → Deterministic routing: runs routing (evidence: `README.md`)
- Deterministic routing → SQL table storage: reads and writes (evidence: `src/hire_pipeline/deterministic_categorization.py`)
- CLI and orchestration → Residual classification: runs classification (evidence: `README.md`)
- Residual classification → Prompt construction: builds prompts (evidence: `src/hire_pipeline/llm_classify.py`)
- Residual classification → Warehouse LLM client: classifies batches (evidence: `src/hire_pipeline/llm_classify.py`)
- Warehouse LLM client → Warehouse LLM function: queries model (evidence: `README.md`)
- Residual classification → SQL table storage: reads and writes (evidence: `src/hire_pipeline/llm_classify.py`)
- CLI and orchestration → Low-confidence escalation: runs escalation (evidence: `README.md`)
- Low-confidence escalation → Warehouse LLM client: rechecks uncertain rows (evidence: `src/hire_pipeline/escalation.py`)
- Low-confidence escalation → Human review queue: queues unresolved rows (evidence: `src/hire_pipeline/escalation.py`)
- CLI and orchestration → Other-bucket audit: runs audit (evidence: `README.md`)
- Other-bucket audit → Warehouse LLM client: audits other rows (evidence: `src/hire_pipeline/audit.py`)
- Other-bucket audit → Human review queue: queues review cases (evidence: `src/hire_pipeline/audit.py`)
- CLI and orchestration → Topic discovery: runs discovery (evidence: `README.md`)
- Topic discovery → Warehouse LLM client: names clusters (evidence: `src/hire_pipeline/topic_discovery.py`)
- CLI and orchestration → Agent metrics: computes metrics (evidence: `README.md`)
- CLI and orchestration → Gold-set evaluation: scores predictions (evidence: `src/hire_pipeline/pipeline.py`)
- Labeled gold set → CLI and orchestration: supplies labels (evidence: `README.md`)
- CLI and orchestration → SQL table storage: creates SQL store (evidence: `src/hire_pipeline/pipeline.py`)
- Pipeline configuration → Agent taxonomy: loads taxonomy (evidence: `src/hire_pipeline/config.py`)
- Product analyst → H.I.R.E. guidance: uses decision guidance (evidence: `README.md`)
- Product analyst → Metric definitions: selects metrics (evidence: `README.md`)
