# vidhuson/ai-banking-copilot architecture

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

- Interactive diagram: https://gitdiagram.com/vidhuson/ai-banking-copilot
- Repository: https://github.com/vidhuson/ai-banking-copilot

## Overview

The product is a conversational layer over an existing banking API: a user submits a request in Streamlit, the FastAPI chat handler classifies it, performs supported backend operations, and turns returned data into a customer-facing response. Profile retrieval, profile updates, and account details are wired; statements and deposits are recognized as intents but are not integrated in the chat handler. The README describes broader backend and UI capabilities, but the sampled implementation does not show them. Edges reflect shown calls or documented relationships; no database access by this app is shown.

Main entry points: [`app/main.py`](https://github.com/vidhuson/ai-banking-copilot/blob/main/app/main.py) (Chat API), [`app/ai/intent_engine.py`](https://github.com/vidhuson/ai-banking-copilot/blob/main/app/ai/intent_engine.py) (Intent engine), [`streamlit/app.py`](https://github.com/vidhuson/ai-banking-copilot/blob/main/streamlit/app.py) (Streamlit UI), [`app/ai/ollama_client.py`](https://github.com/vidhuson/ai-banking-copilot/blob/main/app/ai/ollama_client.py) (Ollama client)

## Diagram (Mermaid)

```mermaid
flowchart TD

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

subgraph group_orchestration["Chat orchestration"]
  node_chat_api["Chat API<br/>[main.py]"]
  node_unintegrated_intents["Unintegrated intents<br/>[main.py]"]
end

subgraph group_ai["AI processing"]
  node_intent_engine["Intent engine<br/>[intent_engine.py]"]
  node_command_validation["Command validation<br/>[intent_engine.py]"]
  node_ollama_client["Ollama client<br/>[ollama_client.py]"]
  node_response_generator["Response generator"]
end

subgraph group_banking["Banking integration"]
  node_node_client["Node client<br/>[node_client.py]"]
end

node_customer(("Customer"))
node_ollama["Ollama runtime"]
node_banking_api["Banking API"]

node_customer -->|"enters request"| node_streamlit
node_streamlit -->|"posts message"| node_chat_api
node_chat_api -->|"returns JSON"| node_streamlit
node_chat_api -->|"classifies request"| node_intent_engine
node_intent_engine -->|"requests generation"| node_ollama_client
node_intent_engine -->|"validates JSON"| node_command_validation
node_command_validation -->|"returns command"| node_intent_engine
node_ollama_client -->|"sends prompt"| node_ollama
node_chat_api -->|"requests banking data"| node_node_client
node_node_client -->|"calls API"| node_banking_api
node_chat_api -->|"formats response"| node_response_generator
node_response_generator -->|"requests generation"| node_ollama_client
node_chat_api -->|"leaves unhandled"| node_unintegrated_intents

click node_streamlit "https://github.com/vidhuson/ai-banking-copilot/blob/main/streamlit/app.py"
click node_chat_api "https://github.com/vidhuson/ai-banking-copilot/blob/main/app/main.py"
click node_intent_engine "https://github.com/vidhuson/ai-banking-copilot/blob/main/app/ai/intent_engine.py"
click node_command_validation "https://github.com/vidhuson/ai-banking-copilot/blob/main/app/ai/intent_engine.py"
click node_ollama_client "https://github.com/vidhuson/ai-banking-copilot/blob/main/app/ai/ollama_client.py"
click node_response_generator "https://github.com/vidhuson/ai-banking-copilot/blob/main/app/ai/response_generator.py"
click node_node_client "https://github.com/vidhuson/ai-banking-copilot/blob/main/app/backend/node_client.py"
click node_unintegrated_intents "https://github.com/vidhuson/ai-banking-copilot/blob/main/app/main.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_chat_api,node_unintegrated_intents toneAmber
class node_intent_engine,node_command_validation,node_ollama_client,node_response_generator,node_banking_api toneMint
class node_node_client toneRose
class node_customer,node_ollama toneIndigo
```

## Components

### User interface

- [Streamlit UI](https://github.com/vidhuson/ai-banking-copilot/blob/main/streamlit/app.py): `streamlit/app.py`

### Chat orchestration

- [Chat API](https://github.com/vidhuson/ai-banking-copilot/blob/main/app/main.py): `app/main.py`
- [Unintegrated intents](https://github.com/vidhuson/ai-banking-copilot/blob/main/app/main.py): `app/main.py`

### AI processing

- [Intent engine](https://github.com/vidhuson/ai-banking-copilot/blob/main/app/ai/intent_engine.py): `app/ai/intent_engine.py`
- [Command validation](https://github.com/vidhuson/ai-banking-copilot/blob/main/app/ai/intent_engine.py): `app/ai/intent_engine.py`
- [Ollama client](https://github.com/vidhuson/ai-banking-copilot/blob/main/app/ai/ollama_client.py): `app/ai/ollama_client.py`
- [Response generator](https://github.com/vidhuson/ai-banking-copilot/blob/main/app/ai/response_generator.py): `app/ai/response_generator.py`

### Banking integration

- [Node client](https://github.com/vidhuson/ai-banking-copilot/blob/main/app/backend/node_client.py): `app/backend/node_client.py`

### Other components

- **Customer**
- **Ollama runtime**
- **Banking API**

## Connections

- Customer → Streamlit UI: enters request (evidence: `streamlit/app.py`)
- Streamlit UI → Chat API: posts message (evidence: `streamlit/app.py`)
- Chat API → Streamlit UI: returns JSON (evidence: `streamlit/app.py`)
- Chat API → Intent engine: classifies request (evidence: `app/main.py`)
- Intent engine → Ollama client: requests generation (evidence: `app/ai/intent_engine.py`)
- Intent engine → Command validation: validates JSON (evidence: `app/ai/intent_engine.py`)
- Command validation → Intent engine: returns command (evidence: `app/ai/intent_engine.py`)
- Ollama client → Ollama runtime: sends prompt (evidence: `app/ai/ollama_client.py`)
- Chat API → Node client: requests banking data (evidence: `app/main.py`)
- Node client → Banking API: calls API (evidence: `app/backend/node_client.py`)
- Chat API → Response generator: formats response (evidence: `app/main.py`)
- Response generator → Ollama client: requests generation (evidence: `app/ai/response_generator.py`)
- Chat API → Unintegrated intents: leaves unhandled (evidence: `app/main.py`)
