# rohith00755/search-term-triage-engine architecture

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

- Interactive diagram: https://gitdiagram.com/rohith00755/search-term-triage-engine
- Repository: https://github.com/rohith00755/search-term-triage-engine

## Overview

TriageIQ turns Google Ads search-term reports into audited PROMOTE, BLOCK, or IGNORE decisions, then presents review and actionable exports. Users can run the batch CLI or the Streamlit dashboard. The workflow preserves intent-cluster traceability, applies statistical evidence and advertiser boundaries, suggests negatives, and supports human corrections and contextual precedents. The README documents the main contract and capabilities; sampled CLI code shows evaluation and export orchestration, while the large dashboard excerpt is partial, so dashboard links rely on its imports and shown pipeline call rather than a complete UI trace.

Main entry points: [`app.py`](https://github.com/rohith00755/search-term-triage-engine/blob/main/app.py) (Review Dashboard), [`run_cli.py`](https://github.com/rohith00755/search-term-triage-engine/blob/main/run_cli.py) (Batch CLI), [`triage_engine/rules.py`](https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/rules.py) (Evidence Decisions), [`triage_engine/negatives.py`](https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/negatives.py) (Negative Suggestions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Entry Points"]
  node_input["Search Term CSV"]
  node_cli["Batch CLI<br/>[run_cli.py]"]
  node_dashboard["Review Dashboard<br/>[app.py]"]
end

subgraph group_analysis["Triage Analysis"]
  node_clusters["Intent Clustering<br/>[clustering.py]"]
  node_decision["Evidence Decisions<br/>[rules.py]"]
  node_statistics["Statistical Evidence<br/>[stats.py]"]
  node_profile["Advertiser Boundaries<br/>[rules.py]"]
  node_negatives["Negative Suggestions<br/>[negatives.py]"]
end

subgraph group_review["Review Intelligence"]
  node_copilot["Triage Copilot<br/>[copilot.py]"]
  node_learning["Reviewer Precedents<br/>[learning.py]"]
  node_corrections["Human Corrections<br/>[rules.py]"]
end

subgraph group_delivery["Results and Export"]
  node_exporter["Audit and Ads Export<br/>[exporter.py]"]
  node_results["Audit and Action CSVs"]
end

node_user(("Search Analyst"))

node_user -->|"runs batch"| node_cli
node_user -->|"opens dashboard"| node_dashboard
node_input -->|"loads report"| node_cli
node_cli -->|"clusters terms"| node_clusters
node_cli -->|"evaluates terms"| node_decision
node_decision -->|"uses metrics"| node_statistics
node_decision -->|"checks scope"| node_profile
node_cli -->|"generates suggestions"| node_negatives
node_negatives -->|"uses exclusions"| node_profile
node_cli -->|"exports results"| node_exporter
node_exporter -->|"writes CSVs"| node_results
node_dashboard -->|"runs pipeline"| node_clusters
node_dashboard -->|"runs pipeline"| node_decision
node_dashboard -->|"uses suggestions"| node_negatives
node_dashboard -->|"exports results"| node_exporter
node_dashboard -->|"uses copilot"| node_copilot
node_dashboard -->|"uses precedents"| node_learning
node_dashboard -->|"records overrides"| node_corrections

click node_input "https://github.com/rohith00755/search-term-triage-engine/blob/main/data/search_terms_25k.csv"
click node_cli "https://github.com/rohith00755/search-term-triage-engine/blob/main/run_cli.py"
click node_dashboard "https://github.com/rohith00755/search-term-triage-engine/blob/main/app.py"
click node_clusters "https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/clustering.py"
click node_decision "https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/rules.py"
click node_statistics "https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/stats.py"
click node_profile "https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/rules.py"
click node_negatives "https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/negatives.py"
click node_copilot "https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/copilot.py"
click node_learning "https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/learning.py"
click node_corrections "https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/rules.py"
click node_exporter "https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/exporter.py"
click node_results "https://github.com/rohith00755/search-term-triage-engine/tree/main/output"

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_input,node_cli,node_dashboard toneBlue
class node_clusters,node_decision,node_statistics,node_profile,node_negatives toneAmber
class node_copilot,node_learning,node_corrections toneMint
class node_exporter,node_results toneRose
class node_user toneIndigo
```

## Components

### User Entry Points

- [Search Term CSV](https://github.com/rohith00755/search-term-triage-engine/blob/main/data/search_terms_25k.csv): `data/search_terms_25k.csv`
- [Batch CLI](https://github.com/rohith00755/search-term-triage-engine/blob/main/run_cli.py): `run_cli.py`
- [Review Dashboard](https://github.com/rohith00755/search-term-triage-engine/blob/main/app.py): `app.py`

### Triage Analysis

- [Intent Clustering](https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/clustering.py): `triage_engine/clustering.py`
- [Evidence Decisions](https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/rules.py): `triage_engine/rules.py`
- [Statistical Evidence](https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/stats.py): `triage_engine/stats.py`
- [Advertiser Boundaries](https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/rules.py): `triage_engine/rules.py`
- [Negative Suggestions](https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/negatives.py): `triage_engine/negatives.py`

### Review Intelligence

- [Triage Copilot](https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/copilot.py): `triage_engine/copilot.py`
- [Reviewer Precedents](https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/learning.py): `triage_engine/learning.py`
- [Human Corrections](https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/rules.py): `triage_engine/rules.py`

### Results and Export

- [Audit and Ads Export](https://github.com/rohith00755/search-term-triage-engine/blob/main/triage_engine/exporter.py): `triage_engine/exporter.py`
- [Audit and Action CSVs](https://github.com/rohith00755/search-term-triage-engine/tree/main/output): `output`

### Other components

- **Search Analyst**

## Connections

- Search Analyst → Batch CLI: runs batch (evidence: `README.md`)
- Search Analyst → Review Dashboard: opens dashboard (evidence: `README.md`)
- Search Term CSV → Batch CLI: loads report (evidence: `README.md`)
- Batch CLI → Intent Clustering: clusters terms (evidence: `run_cli.py`)
- Batch CLI → Evidence Decisions: evaluates terms (evidence: `run_cli.py`)
- Evidence Decisions → Statistical Evidence: uses metrics (evidence: `triage_engine/rules.py`)
- Evidence Decisions → Advertiser Boundaries: checks scope (evidence: `README.md`)
- Batch CLI → Negative Suggestions: generates suggestions (evidence: `run_cli.py`)
- Negative Suggestions → Advertiser Boundaries: uses exclusions (evidence: `triage_engine/negatives.py`)
- Batch CLI → Audit and Ads Export: exports results (evidence: `run_cli.py`)
- Audit and Ads Export → Audit and Action CSVs: writes CSVs (evidence: `triage_engine/exporter.py`)
- Review Dashboard → Intent Clustering: runs pipeline (evidence: `app.py`)
- Review Dashboard → Evidence Decisions: runs pipeline (evidence: `app.py`)
- Review Dashboard → Negative Suggestions: uses suggestions (evidence: `app.py`)
- Review Dashboard → Audit and Ads Export: exports results (evidence: `app.py`)
- Review Dashboard → Triage Copilot: uses copilot (evidence: `app.py`)
- Review Dashboard → Reviewer Precedents: uses precedents (evidence: `app.py`)
- Review Dashboard → Human Corrections: records overrides (evidence: `README.md`)
