# karthikhugar17/kapture-collection-voicebot architecture

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

- Interactive diagram: https://gitdiagram.com/karthikhugar17/kapture-collection-voicebot
- Repository: https://github.com/karthikhugar17/kapture-collection-voicebot

## Overview

Kapture Finance automates voice-based payment collection, records outcomes and commitments, and exposes collection, follow-up, and portfolio analytics. The main workflow runs from a customer call through Vapi tools and FastAPI handling to MySQL; the Streamlit dashboard reads backend APIs and lets operators update follow-ups. The README documents the product capabilities and architecture; excerpts show webhook dispatch, database queries, and dashboard API requests. Other backend details are unsampled, so the graph does not infer finer internal call relationships.

Main entry points: [`backend/main.py`](https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/backend/main.py) (Vapi webhook), [`dashboard/app.py`](https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/dashboard/app.py) (Streamlit dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_voice["Voice collection"]
  node_vapi["Vapi voice agent"]
  node_payment["Payment discussion"]
end

subgraph group_backend["Collection management"]
  node_verify["Identity verification<br/>[main.py]"]
  node_account["Account lookup<br/>[main.py]"]
  node_ptp["PTP capture<br/>[main.py]"]
  node_disposition["Call disposition<br/>[main.py]"]
  node_webhook["Vapi webhook<br/>[main.py]"]
  node_callapi["Call history APIs<br/>[main.py]"]
  node_followup["Follow-up management<br/>[main.py]"]
  node_portfolio["Customer portfolio<br/>[main.py]"]
end

subgraph group_data["Persistence"]
  node_mysql[("MySQL database")]
end

subgraph group_insights["Analytics dashboard"]
  node_dashboard["Streamlit dashboard<br/>[app.py]"]
end

node_customer(("Customer"))
node_operator(("Collection operator"))

node_customer -->|"calls"| node_vapi
node_vapi -->|"sends tool calls"| node_webhook
node_webhook -->|"dispatches verification"| node_verify
node_webhook -->|"dispatches lookup"| node_account
node_webhook -->|"dispatches commitment"| node_ptp
node_webhook -->|"dispatches outcome"| node_disposition
node_vapi -->|"discusses payment"| node_payment
node_verify -->|"checks customer"| node_mysql
node_account -->|"reads account"| node_mysql
node_ptp -->|"records commitment"| node_mysql
node_disposition -->|"stores outcome"| node_mysql
node_followup -->|"manages follow-ups"| node_mysql
node_callapi -->|"reads call records"| node_mysql
node_portfolio -->|"reads customers"| node_mysql
node_dashboard -->|"requests calls"| node_callapi
node_dashboard -->|"requests follow-ups"| node_followup
node_dashboard -->|"requests portfolio"| node_portfolio
node_dashboard -->|"shows metrics"| node_operator
node_operator -->|"updates follow-ups"| node_dashboard

click node_verify "https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/backend/main.py"
click node_account "https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/backend/main.py"
click node_ptp "https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/backend/main.py"
click node_disposition "https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/backend/main.py"
click node_webhook "https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/backend/main.py"
click node_callapi "https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/backend/main.py"
click node_followup "https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/backend/main.py"
click node_portfolio "https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/backend/main.py"
click node_dashboard "https://github.com/karthikhugar17/kapture-collection-voicebot/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_vapi,node_payment toneBlue
class node_verify,node_account,node_ptp,node_disposition,node_webhook,node_callapi,node_followup,node_portfolio toneAmber
class node_mysql toneMint
class node_dashboard toneRose
class node_customer,node_operator toneIndigo
```

## Components

### Voice collection

- **Vapi voice agent**
- **Payment discussion**

### Collection management

- [Identity verification](https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/backend/main.py): `backend/main.py`
- [Account lookup](https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/backend/main.py): `backend/main.py`
- [PTP capture](https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/backend/main.py): `backend/main.py`
- [Call disposition](https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/backend/main.py): `backend/main.py`
- [Vapi webhook](https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/backend/main.py): `backend/main.py`
- [Call history APIs](https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/backend/main.py): `backend/main.py`
- [Follow-up management](https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/backend/main.py): `backend/main.py`
- [Customer portfolio](https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/backend/main.py): `backend/main.py`

### Persistence

- **MySQL database**

### Analytics dashboard

- [Streamlit dashboard](https://github.com/karthikhugar17/kapture-collection-voicebot/blob/main/dashboard/app.py): `dashboard/app.py`

### Other components

- **Customer**
- **Collection operator**

## Connections

- Customer → Vapi voice agent: calls (evidence: `README.md`)
- Vapi voice agent → Vapi webhook: sends tool calls (evidence: `README.md`)
- Vapi webhook → Identity verification: dispatches verification (evidence: `backend/main.py`)
- Vapi webhook → Account lookup: dispatches lookup (evidence: `backend/main.py`)
- Vapi webhook → PTP capture: dispatches commitment (evidence: `backend/main.py`)
- Vapi webhook → Call disposition: dispatches outcome (evidence: `backend/main.py`)
- Vapi voice agent → Payment discussion: discusses payment (evidence: `README.md`)
- Identity verification → MySQL database: checks customer (evidence: `backend/main.py`)
- Account lookup → MySQL database: reads account (evidence: `backend/main.py`)
- PTP capture → MySQL database: records commitment (evidence: `README.md`)
- Call disposition → MySQL database: stores outcome (evidence: `README.md`)
- Follow-up management → MySQL database: manages follow-ups (evidence: `README.md`)
- Call history APIs → MySQL database: reads call records (evidence: `backend/main.py`)
- Customer portfolio → MySQL database: reads customers (evidence: `backend/main.py`)
- Streamlit dashboard → Call history APIs: requests calls (evidence: `dashboard/app.py`)
- Streamlit dashboard → Follow-up management: requests follow-ups (evidence: `dashboard/app.py`)
- Streamlit dashboard → Customer portfolio: requests portfolio (evidence: `dashboard/app.py`)
- Streamlit dashboard → Collection operator: shows metrics (evidence: `README.md`)
- Collection operator → Streamlit dashboard: updates follow-ups (evidence: `dashboard/app.py`)
