# buddhidassanayake/call_center_insights architecture

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

## Overview

This repository is a call-center analytics product: it masks and normalizes transcripts, creates offline multilingual embeddings, clusters calls into topics, and produces daily reports with optional Gemini summaries. The main workflow is represented by the scripts’ matching input/output paths; reporting can then be saved to MySQL. A Streamlit dashboard provides a separate clustering and visualization experience. The excerpts do not show the daily batch runner’s orchestration, so no scheduling or invocation links are inferred.

Main entry points: [`scripts/4_generate_insights.py`](https://github.com/buddhidassanayake/call_center_insights/blob/main/scripts/4_generate_insights.py) (Daily Insight Reports), [`scripts/1_pii_masking.py`](https://github.com/buddhidassanayake/call_center_insights/blob/main/scripts/1_pii_masking.py) (PII Masking), [`scripts/2_embeddings.py`](https://github.com/buddhidassanayake/call_center_insights/blob/main/scripts/2_embeddings.py) (Embedding Generation), [`scripts/3_topic_modeling.py`](https://github.com/buddhidassanayake/call_center_insights/blob/main/scripts/3_topic_modeling.py) (Topic Modeling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Transcript Preparation"]
  node_mask["PII Masking<br/>[1_pii_masking.py]"]
  node_embed["Embedding Generation<br/>[2_embeddings.py]"]
end

subgraph group_analysis["Topic Analysis"]
  node_topics["Topic Modeling"]
end

subgraph group_reporting["Reporting"]
  node_report["Daily Insight Reports"]
  node_metadata["Daily Metadata"]
end

subgraph group_interfaces["Dashboard And Storage"]
  node_mysqlsave["Report Persistence<br/>[5_save_to_mysql.py]"]
  node_step_log["Step Logging<br/>[6_log_step.py]"]
  node_dashboard["Analytics Dashboard<br/>[app.py]"]
end

node_calls["Call Transcripts"]
node_gemini{{"Gemini API"}}
node_mysql[("MySQL")]
node_user(("Analyst"))

node_calls -->|"provides transcripts"| node_mask
node_mask -->|"writes cleaned data"| node_embed
node_embed -->|"writes embeddings"| node_topics
node_topics -->|"writes cluster data"| node_report
node_metadata -->|"adds context"| node_report
node_report -.->|"requests summary"| node_gemini
node_report -->|"writes report file"| node_mysqlsave
node_mysqlsave -->|"stores report"| node_mysql
node_step_log -->|"stores step status"| node_mysql
node_user -->|"views analytics"| node_dashboard
node_dashboard -.->|"requests topic title"| node_gemini

click node_mask "https://github.com/buddhidassanayake/call_center_insights/blob/main/scripts/1_pii_masking.py"
click node_embed "https://github.com/buddhidassanayake/call_center_insights/blob/main/scripts/2_embeddings.py"
click node_topics "https://github.com/buddhidassanayake/call_center_insights/blob/main/scripts/3_topic_modeling.py"
click node_report "https://github.com/buddhidassanayake/call_center_insights/blob/main/scripts/4_generate_insights.py"
click node_metadata "https://github.com/buddhidassanayake/call_center_insights/blob/main/data/daily_metadata.json"
click node_mysqlsave "https://github.com/buddhidassanayake/call_center_insights/blob/main/scripts/5_save_to_mysql.py"
click node_step_log "https://github.com/buddhidassanayake/call_center_insights/blob/main/scripts/6_log_step.py"
click node_dashboard "https://github.com/buddhidassanayake/call_center_insights/blob/main/dashboard/app.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_mask,node_embed toneBlue
class node_topics,node_mysql toneAmber
class node_report,node_metadata,node_gemini toneMint
class node_mysqlsave,node_step_log,node_dashboard toneRose
class node_calls,node_user toneIndigo
```

## Components

### Transcript Preparation

- [PII Masking](https://github.com/buddhidassanayake/call_center_insights/blob/main/scripts/1_pii_masking.py): `scripts/1_pii_masking.py`
- [Embedding Generation](https://github.com/buddhidassanayake/call_center_insights/blob/main/scripts/2_embeddings.py): `scripts/2_embeddings.py`

### Topic Analysis

- [Topic Modeling](https://github.com/buddhidassanayake/call_center_insights/blob/main/scripts/3_topic_modeling.py): `scripts/3_topic_modeling.py`

### Reporting

- [Daily Insight Reports](https://github.com/buddhidassanayake/call_center_insights/blob/main/scripts/4_generate_insights.py): `scripts/4_generate_insights.py`
- [Daily Metadata](https://github.com/buddhidassanayake/call_center_insights/blob/main/data/daily_metadata.json): `data/daily_metadata.json`

### Dashboard And Storage

- [Report Persistence](https://github.com/buddhidassanayake/call_center_insights/blob/main/scripts/5_save_to_mysql.py): `scripts/5_save_to_mysql.py`
- [Step Logging](https://github.com/buddhidassanayake/call_center_insights/blob/main/scripts/6_log_step.py): `scripts/6_log_step.py`
- [Analytics Dashboard](https://github.com/buddhidassanayake/call_center_insights/blob/main/dashboard/app.py): `dashboard/app.py`

### Other components

- **Call Transcripts**
- **Gemini API**
- **MySQL**
- **Analyst**

## Connections

- Call Transcripts → PII Masking: provides transcripts (evidence: `scripts/1_pii_masking.py`)
- PII Masking → Embedding Generation: writes cleaned data (evidence: `scripts/1_pii_masking.py`)
- Embedding Generation → Topic Modeling: writes embeddings (evidence: `scripts/2_embeddings.py`)
- Topic Modeling → Daily Insight Reports: writes cluster data (evidence: `scripts/3_topic_modeling.py`)
- Daily Metadata → Daily Insight Reports: adds context (evidence: `scripts/4_generate_insights.py`)
- Daily Insight Reports → Gemini API: requests summary (evidence: `scripts/4_generate_insights.py`)
- Daily Insight Reports → Report Persistence: writes report file (evidence: `scripts/5_save_to_mysql.py`)
- Report Persistence → MySQL: stores report (evidence: `scripts/5_save_to_mysql.py`)
- Step Logging → MySQL: stores step status (evidence: `scripts/6_log_step.py`)
- Analyst → Analytics Dashboard: views analytics (evidence: `dashboard/app.py`)
- Analytics Dashboard → Gemini API: requests topic title (evidence: `dashboard/app.py`)
