# yash-kavaiya/call-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/yash-kavaiya/call-analysis
- Repository: https://github.com/yash-kavaiya/call-analysis

## Overview

Call Analysis is a self-hosted contact-center intelligence product. Its principal workflow accepts uploaded or imported recordings, converts and transcribes audio, assigns speakers, redacts PII, runs specialized analysis agents, and presents results in a dashboard. The graph also preserves documented production capabilities: optional Celery processing, PostgreSQL persistence, authentication, observability, and the Electron desktop shell. The README notes that the dashboard currently uses JSON storage and in-process jobs; production subsystems exist but some are not wired into its HTTP routes. Unsampled modules and integrations are included only where documented; their internal connections are not inferred.

Main entry points: [`src/call_analysis/api/app.py`](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/api/app.py) (REST API), [`src/call_analysis/pipeline/runner.py`](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/pipeline/runner.py) (Pipeline runner), [`src/call_analysis/tasks.py`](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/tasks.py) (Background tasks), [`src/call_analysis/web/app.js`](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/web/app.js) (Interactive dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Recording Intake"]
  node_ingest["Audio imports<br/>[ingest.py]"]
  node_store[("JSON call store<br/>[storage.py]")]
end

subgraph group_analysis["Call Analysis"]
  node_pipeline["Pipeline runner<br/>[runner.py]"]
  node_audio["Audio preparation<br/>[preprocess.py]"]
  node_asr["Speech recognition<br/>[asr.py]"]
  node_diarize["Speaker diarization<br/>[diarize.py]"]
  node_pii["PII scrubbing<br/>[scrubber.py]"]
  node_agents["Agent analysis<br/>[orchestrator.py]"]
  node_nim["NVIDIA NIM client<br/>[nim_client.py]"]
end

subgraph group_app["Application Experience"]
  node_api["REST API<br/>[app.py]"]
  node_dashboard["Interactive dashboard<br/>[app.js]"]
  node_contracts["Call data models<br/>[models.py]"]
end

subgraph group_production["Production Services"]
  node_settings["Application settings<br/>[config.py]"]
  node_auth["JWT and API keys<br/>[auth.py]"]
  node_celery["Task queue setup<br/>[celery_app.py]"]
  node_tasks["Background tasks<br/>[tasks.py]"]
  node_redis[("Redis utilities<br/>[redis_client.py]")]
  node_database[("PostgreSQL sessions<br/>[database.py]")]
  node_telemetry["Telemetry<br/>[telemetry.py]"]
end

subgraph group_desktop["Desktop Shell"]
  node_electron["Electron main process<br/>[main.js]"]
  node_backend["Python backend<br/>[serve.py]"]
end

node_user(("Contact-center user"))
node_nim_service{{"NVIDIA NIM"}}

node_user -->|"uses"| node_dashboard
node_dashboard -->|"calls"| node_api
node_user -->|"uploads audio"| node_api
node_api -->|"requests imports"| node_ingest
node_ingest -.->|"registers audio"| node_store
node_api -->|"runs analysis"| node_pipeline
node_pipeline -->|"prepares audio"| node_audio
node_pipeline -->|"transcribes audio"| node_asr
node_pipeline -->|"assigns speakers"| node_diarize
node_pipeline -->|"scrubs transcript"| node_pii
node_pipeline -->|"runs agents"| node_agents
node_agents -->|"requests completions"| node_nim
node_nim -->|"sends requests"| node_nim_service
node_pipeline -->|"persists progress"| node_store
node_api -->|"reads and writes calls"| node_store
node_api -->|"uses call records"| node_contracts
node_user -.->|"authenticates"| node_auth
node_api -.->|"queues jobs"| node_celery
node_celery -->|"registers tasks"| node_tasks
node_tasks -->|"runs processing"| node_pipeline
node_tasks -->|"uses sessions"| node_database
node_tasks -->|"tracks job status"| node_redis
node_api -.->|"optional persistence"| node_database
node_api -->|"initializes telemetry"| node_telemetry
node_settings -.->|"configures"| node_api
node_electron -->|"spawns backend"| node_backend
node_electron -->|"loads dashboard"| node_dashboard

click node_api "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/api/app.py"
click node_ingest "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/ingest.py"
click node_store "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/storage.py"
click node_pipeline "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/pipeline/runner.py"
click node_audio "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/audio/preprocess.py"
click node_asr "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/audio/asr.py"
click node_diarize "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/audio/diarize.py"
click node_pii "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/pii/scrubber.py"
click node_agents "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/agents/orchestrator.py"
click node_nim "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/nim_client.py"
click node_dashboard "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/web/app.js"
click node_contracts "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/models.py"
click node_settings "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/config.py"
click node_auth "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/auth.py"
click node_celery "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/celery_app.py"
click node_tasks "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/tasks.py"
click node_redis "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/redis_client.py"
click node_database "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/database.py"
click node_telemetry "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/telemetry.py"
click node_electron "https://github.com/yash-kavaiya/call-analysis/blob/master/electron/main.js"
click node_backend "https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/serve.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_ingest,node_store,node_user toneBlue
class node_pipeline,node_audio,node_asr,node_diarize,node_pii,node_agents,node_nim toneAmber
class node_api,node_dashboard,node_contracts toneMint
class node_settings,node_auth,node_celery,node_tasks,node_redis,node_database,node_telemetry toneRose
class node_electron,node_backend,node_nim_service toneIndigo
```

## Components

### Recording Intake

- [Audio imports](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/ingest.py): `src/call_analysis/ingest.py`
- [JSON call store](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/storage.py): `src/call_analysis/storage.py`

### Call Analysis

- [Pipeline runner](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/pipeline/runner.py): `src/call_analysis/pipeline/runner.py`
- [Audio preparation](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/audio/preprocess.py): `src/call_analysis/audio/preprocess.py`
- [Speech recognition](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/audio/asr.py): `src/call_analysis/audio/asr.py`
- [Speaker diarization](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/audio/diarize.py): `src/call_analysis/audio/diarize.py`
- [PII scrubbing](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/pii/scrubber.py): `src/call_analysis/pii/scrubber.py`
- [Agent analysis](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/agents/orchestrator.py): `src/call_analysis/agents/orchestrator.py`
- [NVIDIA NIM client](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/nim_client.py): `src/call_analysis/nim_client.py`

### Application Experience

- [REST API](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/api/app.py): `src/call_analysis/api/app.py`
- [Interactive dashboard](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/web/app.js): `src/call_analysis/web/app.js`
- [Call data models](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/models.py): `src/call_analysis/models.py`

### Production Services

- [Application settings](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/config.py): `src/call_analysis/config.py`
- [JWT and API keys](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/auth.py): `src/call_analysis/auth.py`
- [Task queue setup](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/celery_app.py): `src/call_analysis/celery_app.py`
- [Background tasks](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/tasks.py): `src/call_analysis/tasks.py`
- [Redis utilities](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/redis_client.py): `src/call_analysis/redis_client.py`
- [PostgreSQL sessions](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/database.py): `src/call_analysis/database.py`
- [Telemetry](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/telemetry.py): `src/call_analysis/telemetry.py`

### Desktop Shell

- [Electron main process](https://github.com/yash-kavaiya/call-analysis/blob/master/electron/main.js): `electron/main.js`
- [Python backend](https://github.com/yash-kavaiya/call-analysis/blob/master/src/call_analysis/serve.py): `src/call_analysis/serve.py`

### Other components

- **Contact-center user**
- **NVIDIA NIM**

## Connections

- Contact-center user → Interactive dashboard: uses
- Interactive dashboard → REST API: calls
- Contact-center user → REST API: uploads audio
- REST API → Audio imports: requests imports (evidence: `src/call_analysis/api/app.py`)
- Audio imports → JSON call store: registers audio
- REST API → Pipeline runner: runs analysis (evidence: `src/call_analysis/api/app.py`)
- Pipeline runner → Audio preparation: prepares audio (evidence: `src/call_analysis/pipeline/runner.py`)
- Pipeline runner → Speech recognition: transcribes audio (evidence: `src/call_analysis/pipeline/runner.py`)
- Pipeline runner → Speaker diarization: assigns speakers (evidence: `src/call_analysis/pipeline/runner.py`)
- Pipeline runner → PII scrubbing: scrubs transcript (evidence: `src/call_analysis/pipeline/runner.py`)
- Pipeline runner → Agent analysis: runs agents (evidence: `src/call_analysis/pipeline/runner.py`)
- Agent analysis → NVIDIA NIM client: requests completions (evidence: `src/call_analysis/agents/orchestrator.py`)
- NVIDIA NIM client → NVIDIA NIM: sends requests (evidence: `src/call_analysis/nim_client.py`)
- Pipeline runner → JSON call store: persists progress (evidence: `src/call_analysis/pipeline/runner.py`)
- REST API → JSON call store: reads and writes calls (evidence: `src/call_analysis/api/app.py`)
- REST API → Call data models: uses call records (evidence: `src/call_analysis/api/app.py`)
- Contact-center user → JWT and API keys: authenticates
- REST API → Task queue setup: queues jobs
- Task queue setup → Background tasks: registers tasks (evidence: `src/call_analysis/celery_app.py`)
- Background tasks → Pipeline runner: runs processing (evidence: `src/call_analysis/tasks.py`)
- Background tasks → PostgreSQL sessions: uses sessions (evidence: `src/call_analysis/tasks.py`)
- Background tasks → Redis utilities: tracks job status (evidence: `src/call_analysis/tasks.py`)
- REST API → PostgreSQL sessions: optional persistence (evidence: `src/call_analysis/api/app.py`)
- REST API → Telemetry: initializes telemetry (evidence: `src/call_analysis/api/app.py`)
- Application settings → REST API: configures (evidence: `src/call_analysis/api/app.py`)
- Electron main process → Python backend: spawns backend
- Electron main process → Interactive dashboard: loads dashboard
