# kasturimaheshbabu2316-mc/capstone---bank architecture

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

- Interactive diagram: https://gitdiagram.com/kasturimaheshbabu2316-mc/capstone---bank
- Repository: https://github.com/kasturimaheshbabu2316-mc/capstone---bank

## Overview

Cred Domain Support Agent is an offline lending-support service. A customer submits a policy or application-status question through the API; request controls lead into a multi-agent workflow, with policy retrieval or application lookup, structured response generation, and secondary compliance review. The repository also documents document ingestion, session memory, caching, budgeting, and audit logging. The README and excerpts establish the main workflow, but do not expose every integration detail, so unsampled subsystem links are limited to documented relationships.

Main entry points: [`api/app.py`](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/api/app.py) (HTTP and WebSocket API), [`app/main.py`](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/app/main.py) (FastAPI gateway), [`agents/crew.py`](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/agents/crew.py) (Support agent crew), [`rag/vector_store.py`](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/rag/vector_store.py) (Local vector retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_service["Service interface"]
  node_gateway["HTTP and WebSocket API<br/>[app.py]"]
  node_alternate_gateway["FastAPI gateway<br/>[main.py]"]
  node_response_contract["Response contracts<br/>[models.py]"]
  node_audit["Request audit logger<br/>[logger.py]"]
end

subgraph group_orchestration["Agent workflow"]
  node_pipeline["Pipeline coordinator<br/>[pipeline.py]"]
  node_crew["Support agent crew<br/>[crew.py]"]
  node_llm["Deterministic LLM<br/>[mock_llm.py]"]
  node_agent_schemas["Agent response schema<br/>[schemas.py]"]
  node_memory[("Session memory<br/>[memory.py]")]
  node_peer_review["Compliance peer review<br/>[autogen_review.py]"]
end

subgraph group_knowledge["Knowledge and records"]
  node_agent_tools["Lookup and escalation tools<br/>[tools.py]"]
  node_application_data[("Seeded applications<br/>[dataset.py]")]
  node_policy_docs["Banking policy documents"]
  node_chunking["Policy chunking<br/>[chunking.py]"]
  node_vector_store[("Local vector retrieval<br/>[vector_store.py]")]
  node_dataset_store[("Application lookup store<br/>[db.py]")]
end

subgraph group_controls["Safety and governance"]
  node_input_safety["Input and output guardrails<br/>[guardrails.py]"]
  node_budget["Request budget guard<br/>[budget_guard.py]"]
  node_cache[("Query response cache<br/>[cache.py]")]
end

node_customer(("Customer"))

node_customer -->|"submits inquiry"| node_gateway
node_customer -->|"submits inquiry"| node_alternate_gateway
node_gateway -->|"checks budget"| node_budget
node_gateway -->|"guards input"| node_input_safety
node_gateway -->|"checks cache"| node_cache
node_gateway -->|"runs workflow"| node_crew
node_gateway -->|"reviews draft"| node_peer_review
node_gateway -->|"logs request"| node_audit
node_gateway -->|"chunks documents"| node_chunking
node_gateway -->|"indexes documents"| node_vector_store
node_alternate_gateway -->|"runs workflow"| node_pipeline
node_alternate_gateway -->|"checks budget"| node_budget
node_alternate_gateway -->|"guards input"| node_input_safety
node_alternate_gateway -->|"checks cache"| node_cache
node_alternate_gateway -->|"logs request"| node_audit
node_alternate_gateway -->|"checks grounding"| node_vector_store
node_pipeline -->|"runs primary crew"| node_crew
node_pipeline -->|"reviews draft"| node_peer_review
node_crew -->|"uses inference"| node_llm
node_crew -->|"reads and records"| node_memory
node_crew -->|"calls lookup"| node_agent_tools
node_crew -->|"builds response"| node_agent_schemas
node_peer_review -->|"reviews response"| node_agent_schemas
node_agent_tools -->|"looks up records"| node_application_data
node_policy_docs -->|"chunks policies"| node_chunking
node_chunking -->|"indexes chunks"| node_vector_store
node_crew -.->|"retrieves policy"| node_vector_store
node_dataset_store -->|"loads records"| node_application_data
node_gateway -->|"returns structured response"| node_response_contract
node_alternate_gateway -->|"returns structured response"| node_response_contract

click node_gateway "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/api/app.py"
click node_alternate_gateway "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/app/main.py"
click node_response_contract "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/app/models.py"
click node_audit "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/api/logger.py"
click node_pipeline "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/app/pipeline.py"
click node_crew "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/agents/crew.py"
click node_llm "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/agents/mock_llm.py"
click node_agent_schemas "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/agents/schemas.py"
click node_memory "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/agents/memory.py"
click node_peer_review "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/review/autogen_review.py"
click node_agent_tools "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/agents/tools.py"
click node_application_data "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/dataset.py"
click node_policy_docs "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/tree/main/knowledge_base"
click node_chunking "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/rag/chunking.py"
click node_vector_store "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/rag/vector_store.py"
click node_input_safety "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/agents/guardrails.py"
click node_budget "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/governance/budget_guard.py"
click node_cache "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/governance/cache.py"
click node_dataset_store "https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/app/db.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_gateway,node_alternate_gateway,node_response_contract,node_audit toneBlue
class node_pipeline,node_crew,node_llm,node_agent_schemas,node_memory,node_peer_review toneAmber
class node_agent_tools,node_application_data,node_policy_docs,node_chunking,node_vector_store,node_dataset_store toneMint
class node_input_safety,node_budget,node_cache toneRose
class node_customer toneIndigo
```

## Components

### Service interface

- [HTTP and WebSocket API](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/api/app.py): `api/app.py`
- [FastAPI gateway](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/app/main.py): `app/main.py`
- [Response contracts](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/app/models.py): `app/models.py`
- [Request audit logger](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/api/logger.py): `api/logger.py`

### Agent workflow

- [Pipeline coordinator](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/app/pipeline.py): `app/pipeline.py`
- [Support agent crew](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/agents/crew.py): `agents/crew.py`
- [Deterministic LLM](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/agents/mock_llm.py): `agents/mock_llm.py`
- [Agent response schema](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/agents/schemas.py): `agents/schemas.py`
- [Session memory](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/agents/memory.py): `agents/memory.py`
- [Compliance peer review](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/review/autogen_review.py): `review/autogen_review.py`

### Knowledge and records

- [Lookup and escalation tools](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/agents/tools.py): `agents/tools.py`
- [Seeded applications](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/dataset.py): `dataset.py`
- [Banking policy documents](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/tree/main/knowledge_base): `knowledge_base`
- [Policy chunking](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/rag/chunking.py): `rag/chunking.py`
- [Local vector retrieval](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/rag/vector_store.py): `rag/vector_store.py`
- [Application lookup store](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/app/db.py): `app/db.py`

### Safety and governance

- [Input and output guardrails](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/agents/guardrails.py): `agents/guardrails.py`
- [Request budget guard](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/governance/budget_guard.py): `governance/budget_guard.py`
- [Query response cache](https://github.com/kasturimaheshbabu2316-mc/capstone---bank/blob/main/governance/cache.py): `governance/cache.py`

### Other components

- **Customer**

## Connections

- Customer → HTTP and WebSocket API: submits inquiry (evidence: `README.md`)
- Customer → FastAPI gateway: submits inquiry (evidence: `README.md`)
- HTTP and WebSocket API → Request budget guard: checks budget (evidence: `api/app.py`)
- HTTP and WebSocket API → Input and output guardrails: guards input (evidence: `api/app.py`)
- HTTP and WebSocket API → Query response cache: checks cache (evidence: `api/app.py`)
- HTTP and WebSocket API → Support agent crew: runs workflow (evidence: `api/app.py`)
- HTTP and WebSocket API → Compliance peer review: reviews draft (evidence: `api/app.py`)
- HTTP and WebSocket API → Request audit logger: logs request (evidence: `api/app.py`)
- HTTP and WebSocket API → Policy chunking: chunks documents (evidence: `api/app.py`)
- HTTP and WebSocket API → Local vector retrieval: indexes documents (evidence: `api/app.py`)
- FastAPI gateway → Pipeline coordinator: runs workflow (evidence: `app/main.py`)
- FastAPI gateway → Request budget guard: checks budget (evidence: `app/main.py`)
- FastAPI gateway → Input and output guardrails: guards input (evidence: `app/main.py`)
- FastAPI gateway → Query response cache: checks cache (evidence: `app/main.py`)
- FastAPI gateway → Request audit logger: logs request (evidence: `app/main.py`)
- FastAPI gateway → Local vector retrieval: checks grounding (evidence: `app/main.py`)
- Pipeline coordinator → Support agent crew: runs primary crew (evidence: `app/pipeline.py`)
- Pipeline coordinator → Compliance peer review: reviews draft (evidence: `app/pipeline.py`)
- Support agent crew → Deterministic LLM: uses inference (evidence: `agents/crew.py`)
- Support agent crew → Session memory: reads and records (evidence: `agents/crew.py`)
- Support agent crew → Lookup and escalation tools: calls lookup (evidence: `agents/crew.py`)
- Support agent crew → Agent response schema: builds response (evidence: `agents/crew.py`)
- Compliance peer review → Agent response schema: reviews response (evidence: `review/autogen_review.py`)
- Lookup and escalation tools → Seeded applications: looks up records (evidence: `agents/tools.py`)
- Banking policy documents → Policy chunking: chunks policies (evidence: `README.md`)
- Policy chunking → Local vector retrieval: indexes chunks (evidence: `rag/vector_store.py`)
- Support agent crew → Local vector retrieval: retrieves policy
- Application lookup store → Seeded applications: loads records (evidence: `app/db.py`)
- HTTP and WebSocket API → Response contracts: returns structured response (evidence: `api/app.py`)
- FastAPI gateway → Response contracts: returns structured response (evidence: `app/main.py`)
