# bipedalsheep11/triscan-training-response-insight-scanner architecture

> Architecture diagram of the GitHub repository bipedalsheep11/triscan-training-response-insight-scanner, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bipedalsheep11/triscan-training-response-insight-scanner
- Repository: https://github.com/bipedalsheep11/triscan-training-response-insight-scanner

## Overview

Feedback Analysis System is a Streamlit application for analyzing post-program survey data. A user uploads survey data and optional program context, configures clustering, and runs a six-stage analysis: detect and transform rating/text columns, cluster respondents, label clusters, classify sentiment and urgent flags, discover or assign themes, and extract ranked insights. The app then presents profiles, dashboard charts, a respondent table, and Ask AI. The sampled sources show the clustering call, document loading, prompt construction, and analysis-to-formatting calls; other stage and page links rely on README documentation.

Main entry points: [`app.py`](https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/app.py) (Pipeline Orchestrator), [`backend/nlp/llm_client.py`](https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/nlp/llm_client.py) (LLM Fallback Client), [`backend/nlp/analysis_modules.py`](https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/nlp/analysis_modules.py) (Cluster Profiles), [`backend/nlp/auto_clustering.py`](https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/nlp/auto_clustering.py) (Respondent Clustering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_upload["Upload and Config<br/>[app.py]"]
  node_pipeline_run["Pipeline Orchestrator<br/>[app.py]"]
  node_results["Results and Dashboard<br/>[app.py]"]
  node_ask_ai["Ask AI<br/>[app.py]"]
end

subgraph group_pipeline["Analysis Pipeline"]
  node_clustering["Respondent Clustering<br/>[auto_clustering.py]"]
  node_cluster_labels["Cluster Profiles"]
  node_sentiment["Sentiment and Flags"]
  node_themes["Theme Analysis"]
  node_insights["Actionable Insights"]
end

subgraph group_context["Context and Formatting"]
  node_formatter["Response Formatter"]
  node_document_reader["Document Loader<br/>[document_reader.py]"]
  node_system_prompt["System Prompt"]
end

subgraph group_models["Language Models"]
  node_llm_client["LLM Fallback Client<br/>[llm_client.py]"]
end

node_user(("Analyst"))
node_anthropic{{"Anthropic"}}
node_groq{{"Groq"}}
node_ollama{{"Ollama"}}

node_user -->|"uploads data"| node_upload
node_upload -->|"starts analysis"| node_pipeline_run
node_upload -->|"loads context"| node_document_reader
node_pipeline_run -->|"builds prompt"| node_system_prompt
node_pipeline_run -->|"clusters responses"| node_clustering
node_pipeline_run -->|"labels clusters"| node_cluster_labels
node_pipeline_run -->|"classifies sentiment"| node_sentiment
node_pipeline_run -->|"analyzes themes"| node_themes
node_pipeline_run -->|"extracts insights"| node_insights
node_cluster_labels -->|"formats cluster data"| node_formatter
node_cluster_labels -->|"requests analysis"| node_llm_client
node_sentiment -->|"requests analysis"| node_llm_client
node_themes -->|"requests analysis"| node_llm_client
node_insights -->|"requests analysis"| node_llm_client
node_pipeline_run -->|"presents results"| node_results
node_user -->|"queries analysis"| node_ask_ai
node_ask_ai -->|"sends query"| node_llm_client
node_llm_client -->|"tries first"| node_anthropic
node_llm_client -->|"falls back"| node_groq
node_llm_client -->|"falls back"| node_ollama

click node_upload "https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/app.py"
click node_pipeline_run "https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/app.py"
click node_results "https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/app.py"
click node_ask_ai "https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/app.py"
click node_clustering "https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/nlp/auto_clustering.py"
click node_cluster_labels "https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/nlp/analysis_modules.py"
click node_sentiment "https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/nlp/analysis_modules.py"
click node_themes "https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/nlp/analysis_modules.py"
click node_insights "https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/nlp/analysis_modules.py"
click node_formatter "https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/nlp/format_responses.py"
click node_document_reader "https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/utils/document_reader.py"
click node_system_prompt "https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/utils/get_system_prompt.py"
click node_llm_client "https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/nlp/llm_client.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_upload,node_pipeline_run,node_results,node_ask_ai toneBlue
class node_clustering,node_cluster_labels,node_sentiment,node_themes,node_insights toneAmber
class node_formatter,node_document_reader,node_system_prompt toneMint
class node_llm_client toneRose
class node_user,node_anthropic,node_groq,node_ollama toneIndigo
```

## Components

### Application

- [Upload and Config](https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/app.py): `app.py`
- [Pipeline Orchestrator](https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/app.py): `app.py`
- [Results and Dashboard](https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/app.py): `app.py`
- [Ask AI](https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/app.py): `app.py`

### Analysis Pipeline

- [Respondent Clustering](https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/nlp/auto_clustering.py): `backend/nlp/auto_clustering.py`
- [Cluster Profiles](https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/nlp/analysis_modules.py): `backend/nlp/analysis_modules.py`
- [Sentiment and Flags](https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/nlp/analysis_modules.py): `backend/nlp/analysis_modules.py`
- [Theme Analysis](https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/nlp/analysis_modules.py): `backend/nlp/analysis_modules.py`
- [Actionable Insights](https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/nlp/analysis_modules.py): `backend/nlp/analysis_modules.py`

### Context and Formatting

- [Response Formatter](https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/nlp/format_responses.py): `backend/nlp/format_responses.py`
- [Document Loader](https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/utils/document_reader.py): `backend/utils/document_reader.py`
- [System Prompt](https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/utils/get_system_prompt.py): `backend/utils/get_system_prompt.py`

### Language Models

- [LLM Fallback Client](https://github.com/bipedalsheep11/triscan-training-response-insight-scanner/blob/main/backend/nlp/llm_client.py): `backend/nlp/llm_client.py`

### Other components

- **Analyst**
- **Anthropic**
- **Groq**
- **Ollama**

## Connections

- Analyst → Upload and Config: uploads data (evidence: `README.md`)
- Upload and Config → Pipeline Orchestrator: starts analysis (evidence: `README.md`)
- Upload and Config → Document Loader: loads context (evidence: `app.py`)
- Pipeline Orchestrator → System Prompt: builds prompt (evidence: `app.py`)
- Pipeline Orchestrator → Respondent Clustering: clusters responses (evidence: `app.py`)
- Pipeline Orchestrator → Cluster Profiles: labels clusters (evidence: `README.md`)
- Pipeline Orchestrator → Sentiment and Flags: classifies sentiment (evidence: `README.md`)
- Pipeline Orchestrator → Theme Analysis: analyzes themes (evidence: `README.md`)
- Pipeline Orchestrator → Actionable Insights: extracts insights (evidence: `README.md`)
- Cluster Profiles → Response Formatter: formats cluster data (evidence: `backend/nlp/analysis_modules.py`)
- Cluster Profiles → LLM Fallback Client: requests analysis (evidence: `backend/nlp/analysis_modules.py`)
- Sentiment and Flags → LLM Fallback Client: requests analysis (evidence: `README.md`)
- Theme Analysis → LLM Fallback Client: requests analysis (evidence: `README.md`)
- Actionable Insights → LLM Fallback Client: requests analysis (evidence: `README.md`)
- Pipeline Orchestrator → Results and Dashboard: presents results (evidence: `README.md`)
- Analyst → Ask AI: queries analysis (evidence: `README.md`)
- Ask AI → LLM Fallback Client: sends query (evidence: `README.md`)
- LLM Fallback Client → Anthropic: tries first (evidence: `backend/nlp/llm_client.py`)
- LLM Fallback Client → Groq: falls back (evidence: `backend/nlp/llm_client.py`)
- LLM Fallback Client → Ollama: falls back (evidence: `backend/nlp/llm_client.py`)
