# anilch963/multi-agent-banking-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/anilch963/multi-agent-banking-assistant
- Repository: https://github.com/anilch963/multi-agent-banking-assistant

## Overview

Anil Bank is a fictional, seeded-data banking assistant. A customer submits a message to FastAPI; the LangGraph screens it, selects up to three specialists, gathers their findings, synthesizes a reply, and applies a compliance review. Specialists use scoped MCP banking tools and, where enabled, product-policy retrieval. Separate API routes list or resolve confirmation-gated actions. The map follows documented orchestration and source-index references; some specialist-to-tool wiring and unsampled integrations are therefore omitted.

Main entry points: [`app/main.py`](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/main.py) (FastAPI routes), [`app/agents/graph.py`](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/agents/graph.py) (LangGraph workflow), [`app/mcp_server/server.py`](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/mcp_server/server.py) (Banking MCP tools), [`app/db/database.py`](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/db/database.py) (SQLite banking data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Customer API"]
  node_fastapi["FastAPI routes<br/>[main.py]"]
end

subgraph group_orchestration["Conversation orchestration"]
  node_guardrail["Input guardrail<br/>[nodes.py]"]
  node_supervisor["Supervisor<br/>[nodes.py]"]
  node_graph["LangGraph workflow<br/>[graph.py]"]
  node_synth["Response synthesis<br/>[nodes.py]"]
  node_compliance["Compliance review<br/>[nodes.py]"]
end

subgraph group_specialists["Banking specialists"]
  node_specialists["Specialist agents<br/>[registry.py]"]
  node_react["Tool-calling loop<br/>[react.py]"]
end

subgraph group_services["Banking services"]
  node_mcp["Banking MCP tools<br/>[server.py]"]
  node_rag["Policy search<br/>[store.py]"]
  node_finance["Financial calculators<br/>[finance.py]"]
  node_analytics["SQL analytics sandbox<br/>[analytics.py]"]
  node_actions["Pending actions<br/>[actions.py]"]
end

subgraph group_data["Data and knowledge"]
  node_documents["Banking policy docs"]
  node_seed["Demo data seeding<br/>[seed.py]"]
  node_database[("SQLite banking data<br/>[database.py]")]
  node_config["Runtime configuration<br/>[config.py]"]
end

node_customer(("Customer"))
node_llm(("OpenAI chat model"))

node_customer -->|"submits request"| node_fastapi
node_fastapi -->|"invokes chat"| node_graph
node_fastapi -->|"lists or resolves"| node_actions
node_fastapi -->|"checks customer"| node_database
node_fastapi -->|"starts MCP server"| node_mcp
node_fastapi -->|"ingests knowledge"| node_rag
node_graph -->|"routes messages"| node_guardrail
node_graph -->|"routes allowed turns"| node_supervisor
node_graph -->|"dispatches assignments"| node_specialists
node_graph -->|"routes findings"| node_synth
node_graph -->|"routes draft"| node_compliance
node_guardrail -.->|"classifies message"| node_llm
node_supervisor -.->|"plans assignments"| node_llm
node_specialists -->|"creates agent loops"| node_react
node_react -.->|"calls banking tools"| node_mcp
node_react -->|"searches policy"| node_rag
node_synth -.->|"drafts answer"| node_llm
node_compliance -.->|"reviews answer"| node_llm
node_mcp -->|"reads and writes"| node_database
node_mcp -->|"calculates figures"| node_finance
node_mcp -->|"runs sandbox SQL"| node_analytics
node_mcp -->|"proposes actions"| node_actions
node_analytics -->|"copies customer data"| node_database
node_actions -->|"persists proposals"| node_database
node_actions -->|"calculates deposit maturity"| node_finance
node_seed -->|"loads demo records"| node_database
node_seed -->|"calculates seeded maturity"| node_finance
node_rag -->|"ingests documents"| node_documents
node_fastapi -->|"initializes database"| node_seed
node_fastapi -->|"configures MCP launch"| node_config
node_rag -->|"uses storage settings"| node_config
node_database -->|"uses database path"| node_config
node_llm -->|"uses model settings"| node_config

click node_fastapi "https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/main.py"
click node_guardrail "https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/agents/nodes.py"
click node_supervisor "https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/agents/nodes.py"
click node_graph "https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/agents/graph.py"
click node_specialists "https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/agents/registry.py"
click node_react "https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/agents/react.py"
click node_synth "https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/agents/nodes.py"
click node_compliance "https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/agents/nodes.py"
click node_mcp "https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/mcp_server/server.py"
click node_rag "https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/rag/store.py"
click node_documents "https://github.com/anilch963/multi-agent-banking-assistant/tree/main/knowledge_base"
click node_finance "https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/finance.py"
click node_analytics "https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/db/analytics.py"
click node_actions "https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/db/actions.py"
click node_seed "https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/db/seed.py"
click node_database "https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/db/database.py"
click node_config "https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/config.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_fastapi toneBlue
class node_guardrail,node_supervisor,node_graph,node_synth,node_compliance toneAmber
class node_specialists,node_react toneMint
class node_mcp,node_rag,node_finance,node_analytics,node_actions toneRose
class node_documents,node_seed,node_database,node_config,node_customer,node_llm toneIndigo
```

## Components

### Customer API

- [FastAPI routes](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/main.py): `app/main.py`

### Conversation orchestration

- [Input guardrail](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/agents/nodes.py): `app/agents/nodes.py`
- [Supervisor](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/agents/nodes.py): `app/agents/nodes.py`
- [LangGraph workflow](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/agents/graph.py): `app/agents/graph.py`
- [Response synthesis](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/agents/nodes.py): `app/agents/nodes.py`
- [Compliance review](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/agents/nodes.py): `app/agents/nodes.py`

### Banking specialists

- [Specialist agents](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/agents/registry.py): `app/agents/registry.py`
- [Tool-calling loop](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/agents/react.py): `app/agents/react.py`

### Banking services

- [Banking MCP tools](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/mcp_server/server.py): `app/mcp_server/server.py`
- [Policy search](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/rag/store.py): `app/rag/store.py`
- [Financial calculators](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/finance.py): `app/finance.py`
- [SQL analytics sandbox](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/db/analytics.py): `app/db/analytics.py`
- [Pending actions](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/db/actions.py): `app/db/actions.py`

### Data and knowledge

- [Banking policy docs](https://github.com/anilch963/multi-agent-banking-assistant/tree/main/knowledge_base): `knowledge_base`
- [Demo data seeding](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/db/seed.py): `app/db/seed.py`
- [SQLite banking data](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/db/database.py): `app/db/database.py`
- [Runtime configuration](https://github.com/anilch963/multi-agent-banking-assistant/blob/main/app/config.py): `app/config.py`

### Other components

- **Customer**
- **OpenAI chat model**

## Connections

- Customer → FastAPI routes: submits request (evidence: `README.md`)
- FastAPI routes → LangGraph workflow: invokes chat (evidence: `app/main.py`)
- FastAPI routes → Pending actions: lists or resolves (evidence: `app/main.py`)
- FastAPI routes → SQLite banking data: checks customer (evidence: `app/main.py`)
- FastAPI routes → Banking MCP tools: starts MCP server (evidence: `app/main.py`)
- FastAPI routes → Policy search: ingests knowledge (evidence: `app/main.py`)
- LangGraph workflow → Input guardrail: routes messages (evidence: `app/agents/graph.py`)
- LangGraph workflow → Supervisor: routes allowed turns (evidence: `app/agents/graph.py`)
- LangGraph workflow → Specialist agents: dispatches assignments (evidence: `app/agents/graph.py`)
- LangGraph workflow → Response synthesis: routes findings (evidence: `app/agents/graph.py`)
- LangGraph workflow → Compliance review: routes draft (evidence: `app/agents/graph.py`)
- Input guardrail → OpenAI chat model: classifies message
- Supervisor → OpenAI chat model: plans assignments
- Specialist agents → Tool-calling loop: creates agent loops (evidence: `app/agents/nodes.py`)
- Tool-calling loop → Banking MCP tools: calls banking tools
- Tool-calling loop → Policy search: searches policy
- Response synthesis → OpenAI chat model: drafts answer
- Compliance review → OpenAI chat model: reviews answer
- Banking MCP tools → SQLite banking data: reads and writes (evidence: `app/mcp_server/server.py`)
- Banking MCP tools → Financial calculators: calculates figures (evidence: `app/mcp_server/server.py`)
- Banking MCP tools → SQL analytics sandbox: runs sandbox SQL (evidence: `app/mcp_server/server.py`)
- Banking MCP tools → Pending actions: proposes actions (evidence: `app/mcp_server/server.py`)
- SQL analytics sandbox → SQLite banking data: copies customer data (evidence: `app/db/analytics.py`)
- Pending actions → SQLite banking data: persists proposals (evidence: `app/db/actions.py`)
- Pending actions → Financial calculators: calculates deposit maturity (evidence: `app/db/actions.py`)
- Demo data seeding → SQLite banking data: loads demo records (evidence: `app/db/seed.py`)
- Demo data seeding → Financial calculators: calculates seeded maturity (evidence: `app/db/seed.py`)
- Policy search → Banking policy docs: ingests documents (evidence: `app/rag/store.py`)
- FastAPI routes → Demo data seeding: initializes database (evidence: `app/main.py`)
- FastAPI routes → Runtime configuration: configures MCP launch (evidence: `app/main.py`)
- Policy search → Runtime configuration: uses storage settings (evidence: `app/rag/store.py`)
- SQLite banking data → Runtime configuration: uses database path (evidence: `app/db/database.py`)
- OpenAI chat model → Runtime configuration: uses model settings
