# 04karthik/bankai-banking-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/04karthik/bankai-banking-assistant
- Repository: https://github.com/04karthik/bankai-banking-assistant

## Overview

BankAI is a local, fictional-data Streamlit banking assistant. A customer asks a question or selects a demo; the supervisor routes it to banking, fraud, and/or loan logic, then the interface presents the answer and execution trace. Account data comes from SQLite; fraud scoring and loan eligibility/EMI are deterministic. Optional LLM providers assist only with intent routing. The graph focuses on this documented Python product; workspace React artifacts are not part of its banking workflow. Some internal dispatch details are documented but not visible in the sampled excerpts.

Main entry points: [`bankai/agents.py`](https://github.com/04karthik/bankai-banking-assistant/blob/main/bankai/agents.py) (Supervisor), [`app.py`](https://github.com/04karthik/bankai-banking-assistant/blob/main/app.py) (Chat dashboard), [`bankai/storage.py`](https://github.com/04karthik/bankai-banking-assistant/blob/main/bankai/storage.py) (SQLite storage), [`bankai/llm.py`](https://github.com/04karthik/bankai-banking-assistant/blob/main/bankai/llm.py) (Intent classifier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_streamlit["Chat dashboard<br/>[app.py]"]
end

subgraph group_routing["Intent routing"]
  node_supervisor["Supervisor<br/>[agents.py]"]
  node_intent["Intent classifier<br/>[llm.py]"]
end

subgraph group_domain["Banking services"]
  node_banking["Banking agent<br/>[agents.py]"]
  node_fraud["Fraud agent<br/>[agents.py]"]
  node_loan["Loan agent<br/>[agents.py]"]
  node_storage[("SQLite storage<br/>[storage.py]")]
end

node_customer(("Customer"))
node_providers{{"LLM providers"}}

node_customer -->|"asks question"| node_streamlit
node_streamlit -->|"submits prompt"| node_supervisor
node_streamlit -->|"loads profiles"| node_storage
node_streamlit -->|"loads settings"| node_intent
node_supervisor -->|"requests routing"| node_intent
node_supervisor -->|"dispatches banking"| node_banking
node_supervisor -->|"dispatches fraud"| node_fraud
node_supervisor -->|"dispatches loan"| node_loan
node_banking -->|"reads account data"| node_storage
node_fraud -->|"reads customer data"| node_storage
node_loan -->|"reads customer data"| node_storage
node_intent -.->|"requests intent plan"| node_providers
node_supervisor -->|"returns answer"| node_streamlit

click node_streamlit "https://github.com/04karthik/bankai-banking-assistant/blob/main/app.py"
click node_supervisor "https://github.com/04karthik/bankai-banking-assistant/blob/main/bankai/agents.py"
click node_intent "https://github.com/04karthik/bankai-banking-assistant/blob/main/bankai/llm.py"
click node_banking "https://github.com/04karthik/bankai-banking-assistant/blob/main/bankai/agents.py"
click node_fraud "https://github.com/04karthik/bankai-banking-assistant/blob/main/bankai/agents.py"
click node_loan "https://github.com/04karthik/bankai-banking-assistant/blob/main/bankai/agents.py"
click node_storage "https://github.com/04karthik/bankai-banking-assistant/blob/main/bankai/storage.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_streamlit toneBlue
class node_supervisor,node_intent toneAmber
class node_banking,node_fraud,node_loan,node_storage toneMint
class node_customer,node_providers toneIndigo
```

## Components

### User interface

- [Chat dashboard](https://github.com/04karthik/bankai-banking-assistant/blob/main/app.py): `app.py`

### Intent routing

- [Supervisor](https://github.com/04karthik/bankai-banking-assistant/blob/main/bankai/agents.py): `bankai/agents.py`
- [Intent classifier](https://github.com/04karthik/bankai-banking-assistant/blob/main/bankai/llm.py): `bankai/llm.py`

### Banking services

- [Banking agent](https://github.com/04karthik/bankai-banking-assistant/blob/main/bankai/agents.py): `bankai/agents.py`
- [Fraud agent](https://github.com/04karthik/bankai-banking-assistant/blob/main/bankai/agents.py): `bankai/agents.py`
- [Loan agent](https://github.com/04karthik/bankai-banking-assistant/blob/main/bankai/agents.py): `bankai/agents.py`
- [SQLite storage](https://github.com/04karthik/bankai-banking-assistant/blob/main/bankai/storage.py): `bankai/storage.py`

### Other components

- **Customer**
- **LLM providers**

## Connections

- Customer → Chat dashboard: asks question
- Chat dashboard → Supervisor: submits prompt (evidence: `app.py`)
- Chat dashboard → SQLite storage: loads profiles (evidence: `app.py`)
- Chat dashboard → Intent classifier: loads settings (evidence: `app.py`)
- Supervisor → Intent classifier: requests routing (evidence: `bankai/agents.py`)
- Supervisor → Banking agent: dispatches banking (evidence: `bankai/agents.py`)
- Supervisor → Fraud agent: dispatches fraud (evidence: `bankai/agents.py`)
- Supervisor → Loan agent: dispatches loan (evidence: `bankai/agents.py`)
- Banking agent → SQLite storage: reads account data (evidence: `bankai/agents.py`)
- Fraud agent → SQLite storage: reads customer data (evidence: `bankai/agents.py`)
- Loan agent → SQLite storage: reads customer data (evidence: `bankai/agents.py`)
- Intent classifier → LLM providers: requests intent plan
- Supervisor → Chat dashboard: returns answer (evidence: `app.py`)
