# vnkrthk08/ai-banking-agent architecture

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

- Interactive diagram: https://gitdiagram.com/vnkrthk08/ai-banking-agent
- Repository: https://github.com/vnkrthk08/ai-banking-agent

## Overview

KURAL AVA is a banking voice-assistance and operations platform. A customer speaks through the voice channel; the voice orchestrator coordinates speech recognition and the deterministic conversation engine, which screens sensitive input, interprets intent, selects approved responses, and records conversation state. Operational APIs expose call, case, callback, campaign, and reporting capabilities to a role-aware dashboard. The graph includes the major documented product areas; source excerpts are incomplete, so some dashboard-to-backend and provider wiring is intentionally omitted where direct evidence was unavailable.

Main entry points: [`kural/conversation/engine.py`](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/conversation/engine.py) (Conversation FSM), [`kural/api_operations.py`](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/api_operations.py) (Operations API), [`kural/persistence/database.py`](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/persistence/database.py) (Database), [`kural/api.py`](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/api.py) (Conversation API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_channels["Channels and API"]
  node_api["Conversation API<br/>[api.py]"]
  node_opsapi["Operations API<br/>[api_operations.py]"]
  node_voice["Voice Orchestrator<br/>[orchestrator.py]"]
end

subgraph group_decision["Conversation Decisioning"]
  node_engine["Conversation FSM<br/>[engine.py]"]
  node_session["Conversation Session<br/>[session.py]"]
  node_nlu["Intent Classifier<br/>[classifier.py]"]
  node_providers["AI and Speech Providers"]
  node_safety["Safety Policy<br/>[safety.py]"]
  node_privacy["Transcript Privacy<br/>[transcript.py]"]
  node_knowledge["Approved Knowledge"]
end

subgraph group_operations["Banking Operations"]
  node_cases["Case Management<br/>[case_service.py]"]
  node_callbacks["Callback Scheduling"]
  node_customers["Customer Registry"]
  node_campaigns["Campaign Management"]
  node_calls["Call Operations<br/>[call_service.py]"]
  node_reports["Reports and Recording<br/>[report_service.py]"]
end

subgraph group_data["Persistence and Audit"]
  node_database[("Database<br/>[database.py]")]
  node_repository["Conversation Repository<br/>[repository.py]"]
  node_tables[("Operational Tables<br/>[models.py]")]
  node_audit["Audit Events<br/>[events.py]"]
end

subgraph group_dashboard["Operations Dashboard"]
  node_frontend["Dashboard Application<br/>[App.tsx]"]
  node_dashboardstate["Dashboard State"]
  node_dashapi["Dashboard API Client<br/>[dashboardApi.ts]"]
  node_pages["Operations Workspaces"]
  node_stt["Browser Speech Input"]
  node_tts["Browser Speech Output"]
end

node_caller(("Customer"))
node_browser(("Browser Voice"))

node_caller -->|"speaks to"| node_browser
node_browser -->|"streams audio"| node_voice
node_api -->|"routes voice"| node_voice
node_voice -->|"submits turns"| node_engine
node_voice -->|"uses speech contracts"| node_providers
node_engine -->|"screens input"| node_safety
node_engine -->|"sanitizes transcript"| node_privacy
node_engine -.->|"proposes intent"| node_nlu
node_nlu -->|"requests classification"| node_providers
node_engine -->|"retrieves response"| node_knowledge
node_engine -->|"updates conversation"| node_session
node_api -->|"processes turns"| node_engine
node_engine -->|"persists turn"| node_repository
node_api -->|"reads sessions"| node_repository
node_api -->|"routes case actions"| node_cases
node_api -->|"routes callbacks"| node_callbacks
node_opsapi -->|"serves call operations"| node_calls
node_opsapi -->|"serves cases"| node_cases
node_opsapi -->|"serves callbacks"| node_callbacks
node_opsapi -->|"serves campaigns"| node_campaigns
node_opsapi -->|"serves customers"| node_customers
node_opsapi -->|"serves reports"| node_reports
node_cases -->|"reads and writes"| node_database
node_callbacks -->|"reads and writes"| node_database
node_campaigns -->|"checks customer status"| node_customers
node_campaigns -->|"reads and writes"| node_database
node_customers -->|"reads and writes"| node_database
node_repository -->|"opens sessions"| node_database
node_repository -->|"maps records"| node_tables
node_database -->|"stores records"| node_tables
node_frontend -->|"provides dashboard state"| node_dashboardstate
node_frontend -->|"routes workspaces"| node_pages
node_dashboardstate -->|"loads dashboard data"| node_dashapi
node_frontend -.->|"offers voice input"| node_stt
node_frontend -.->|"offers voice output"| node_tts

click node_api "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/api.py"
click node_opsapi "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/api_operations.py"
click node_voice "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/voice/orchestrator.py"
click node_engine "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/conversation/engine.py"
click node_session "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/conversation/session.py"
click node_nlu "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/nlu/classifier.py"
click node_providers "https://github.com/vnkrthk08/ai-banking-agent/tree/main/kural/providers"
click node_safety "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/policy/safety.py"
click node_privacy "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/privacy/transcript.py"
click node_knowledge "https://github.com/vnkrthk08/ai-banking-agent/tree/main/kural/knowledge"
click node_cases "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/services/case_service.py"
click node_callbacks "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/services/callback_service.py"
click node_customers "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/services/customer_service.py"
click node_campaigns "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/services/campaign_service.py"
click node_calls "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/services/call_service.py"
click node_reports "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/services/report_service.py"
click node_database "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/persistence/database.py"
click node_repository "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/persistence/repository.py"
click node_tables "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/persistence/models.py"
click node_audit "https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/audit/events.py"
click node_frontend "https://github.com/vnkrthk08/ai-banking-agent/blob/main/frontend/src/App.tsx"
click node_dashboardstate "https://github.com/vnkrthk08/ai-banking-agent/blob/main/frontend/src/hooks/DashboardContext.tsx"
click node_dashapi "https://github.com/vnkrthk08/ai-banking-agent/blob/main/frontend/src/services/dashboardApi.ts"
click node_pages "https://github.com/vnkrthk08/ai-banking-agent/tree/main/frontend/src/pages"
click node_stt "https://github.com/vnkrthk08/ai-banking-agent/blob/main/frontend/src/providers/BrowserSTTProvider.ts"
click node_tts "https://github.com/vnkrthk08/ai-banking-agent/blob/main/frontend/src/providers/BrowserTTSProvider.ts"

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_api,node_opsapi,node_voice,node_browser toneBlue
class node_engine,node_session,node_nlu,node_providers,node_safety,node_privacy,node_knowledge toneAmber
class node_cases,node_callbacks,node_customers,node_campaigns,node_calls,node_reports toneMint
class node_database,node_repository,node_tables,node_audit toneRose
class node_frontend,node_dashboardstate,node_dashapi,node_pages,node_stt,node_tts,node_caller toneIndigo
```

## Components

### Channels and API

- [Conversation API](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/api.py): `kural/api.py`
- [Operations API](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/api_operations.py): `kural/api_operations.py`
- [Voice Orchestrator](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/voice/orchestrator.py): `kural/voice/orchestrator.py`

### Conversation Decisioning

- [Conversation FSM](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/conversation/engine.py): `kural/conversation/engine.py`
- [Conversation Session](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/conversation/session.py): `kural/conversation/session.py`
- [Intent Classifier](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/nlu/classifier.py): `kural/nlu/classifier.py`
- [AI and Speech Providers](https://github.com/vnkrthk08/ai-banking-agent/tree/main/kural/providers): `kural/providers`
- [Safety Policy](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/policy/safety.py): `kural/policy/safety.py`
- [Transcript Privacy](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/privacy/transcript.py): `kural/privacy/transcript.py`
- [Approved Knowledge](https://github.com/vnkrthk08/ai-banking-agent/tree/main/kural/knowledge): `kural/knowledge`

### Banking Operations

- [Case Management](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/services/case_service.py): `kural/services/case_service.py`
- [Callback Scheduling](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/services/callback_service.py): `kural/services/callback_service.py`
- [Customer Registry](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/services/customer_service.py): `kural/services/customer_service.py`
- [Campaign Management](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/services/campaign_service.py): `kural/services/campaign_service.py`
- [Call Operations](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/services/call_service.py): `kural/services/call_service.py`
- [Reports and Recording](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/services/report_service.py): `kural/services/report_service.py`

### Persistence and Audit

- [Database](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/persistence/database.py): `kural/persistence/database.py`
- [Conversation Repository](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/persistence/repository.py): `kural/persistence/repository.py`
- [Operational Tables](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/persistence/models.py): `kural/persistence/models.py`
- [Audit Events](https://github.com/vnkrthk08/ai-banking-agent/blob/main/kural/audit/events.py): `kural/audit/events.py`

### Operations Dashboard

- [Dashboard Application](https://github.com/vnkrthk08/ai-banking-agent/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Dashboard State](https://github.com/vnkrthk08/ai-banking-agent/blob/main/frontend/src/hooks/DashboardContext.tsx): `frontend/src/hooks/DashboardContext.tsx`
- [Dashboard API Client](https://github.com/vnkrthk08/ai-banking-agent/blob/main/frontend/src/services/dashboardApi.ts): `frontend/src/services/dashboardApi.ts`
- [Operations Workspaces](https://github.com/vnkrthk08/ai-banking-agent/tree/main/frontend/src/pages): `frontend/src/pages`
- [Browser Speech Input](https://github.com/vnkrthk08/ai-banking-agent/blob/main/frontend/src/providers/BrowserSTTProvider.ts): `frontend/src/providers/BrowserSTTProvider.ts`
- [Browser Speech Output](https://github.com/vnkrthk08/ai-banking-agent/blob/main/frontend/src/providers/BrowserTTSProvider.ts): `frontend/src/providers/BrowserTTSProvider.ts`

### Other components

- **Customer**
- **Browser Voice**

## Connections

- Customer → Browser Voice: speaks to (evidence: `README.md`)
- Browser Voice → Voice Orchestrator: streams audio (evidence: `README.md`)
- Conversation API → Voice Orchestrator: routes voice (evidence: `kural/api.py`)
- Voice Orchestrator → Conversation FSM: submits turns (evidence: `kural/voice/orchestrator.py`)
- Voice Orchestrator → AI and Speech Providers: uses speech contracts (evidence: `kural/voice/orchestrator.py`)
- Conversation FSM → Safety Policy: screens input (evidence: `kural/conversation/engine.py`)
- Conversation FSM → Transcript Privacy: sanitizes transcript (evidence: `kural/conversation/engine.py`)
- Conversation FSM → Intent Classifier: proposes intent
- Intent Classifier → AI and Speech Providers: requests classification (evidence: `kural/nlu/classifier.py`)
- Conversation FSM → Approved Knowledge: retrieves response (evidence: `kural/conversation/engine.py`)
- Conversation FSM → Conversation Session: updates conversation (evidence: `kural/conversation/engine.py`)
- Conversation API → Conversation FSM: processes turns (evidence: `kural/api.py`)
- Conversation FSM → Conversation Repository: persists turn (evidence: `kural/conversation/engine.py`)
- Conversation API → Conversation Repository: reads sessions (evidence: `kural/api.py`)
- Conversation API → Case Management: routes case actions (evidence: `kural/api.py`)
- Conversation API → Callback Scheduling: routes callbacks (evidence: `kural/api.py`)
- Operations API → Call Operations: serves call operations (evidence: `kural/api_operations.py`)
- Operations API → Case Management: serves cases (evidence: `kural/api_operations.py`)
- Operations API → Callback Scheduling: serves callbacks (evidence: `kural/api_operations.py`)
- Operations API → Campaign Management: serves campaigns (evidence: `kural/api_operations.py`)
- Operations API → Customer Registry: serves customers (evidence: `kural/api_operations.py`)
- Operations API → Reports and Recording: serves reports (evidence: `kural/api_operations.py`)
- Case Management → Database: reads and writes (evidence: `kural/services/case_service.py`)
- Callback Scheduling → Database: reads and writes (evidence: `kural/services/callback_service.py`)
- Campaign Management → Customer Registry: checks customer status (evidence: `kural/services/campaign_service.py`)
- Campaign Management → Database: reads and writes (evidence: `kural/services/campaign_service.py`)
- Customer Registry → Database: reads and writes (evidence: `kural/services/customer_service.py`)
- Conversation Repository → Database: opens sessions (evidence: `kural/persistence/repository.py`)
- Conversation Repository → Operational Tables: maps records (evidence: `kural/persistence/repository.py`)
- Database → Operational Tables: stores records (evidence: `kural/persistence/database.py`)
- Dashboard Application → Dashboard State: provides dashboard state (evidence: `frontend/src/App.tsx`)
- Dashboard Application → Operations Workspaces: routes workspaces (evidence: `frontend/src/App.tsx`)
- Dashboard State → Dashboard API Client: loads dashboard data (evidence: `frontend/src/hooks/DashboardContext.tsx`)
- Dashboard Application → Browser Speech Input: offers voice input
- Dashboard Application → Browser Speech Output: offers voice output
