# poojaellanti/maica architecture

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

- Interactive diagram: https://gitdiagram.com/poojaellanti/maica
- Repository: https://github.com/poojaellanti/maica

## Overview

This repository combines an investment-advisor workflow with MAICA responsible-AI auditing. The main user path collects a profile in the web UI, requests a recommendation, profiles risk, generates a portfolio, fetches market prices, and invokes an audit coordinator. The audit agents provide distinct inspection, regulation, monitoring, explainability, security, data-protection, and comparison capabilities; their relationships to the coordinator are not established by the sampled coordinator source, so those links are omitted. Several dashboards and audit entry points are documented by source imports, but their unsampled internals are not inferred.

Main entry points: [`investment_app/app.py`](https://github.com/poojaellanti/maica/blob/main/investment_app/app.py) (Recommendation API), [`maica_dashboard.py`](https://github.com/poojaellanti/maica/blob/main/maica_dashboard.py) (Portfolio Audit Dashboard), [`maica_investment_audit.py`](https://github.com/poojaellanti/maica/blob/main/maica_investment_audit.py) (Investment Audit Runner), [`investment_app/risk_profiler.py`](https://github.com/poojaellanti/maica/blob/main/investment_app/risk_profiler.py) (Risk Profiler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_advisor["Investment Advisor"]
  node_web_ui["Advisor Web UI<br/>[script.js]"]
  node_recommendation_api["Recommendation API<br/>[app.py]"]
  node_risk_profiler["Risk Profiler<br/>[risk_profiler.py]"]
  node_portfolio_generator["Portfolio Generator<br/>[portfolio_model.py]"]
  node_market_data["Market Snapshot<br/>[stock_fetcher.py]"]
  node_dashboard["Portfolio Audit Dashboard<br/>[maica_dashboard.py]"]
end

subgraph group_audit["MAICA Audit"]
  node_audit_integration["Audit Integration"]
  node_coordinator["Report Coordinator"]
  node_regulation["Regulation Checks"]
  node_model_inspection["Model Inspection"]
  node_monitoring["Runtime Monitoring"]
  node_explainability["Explainability"]
  node_security["Security Checks<br/>[security_agent.py]"]
  node_data_protection["Data Protection"]
  node_comparison["Audit Comparison"]
  node_investment_audit["Investment Audit Runner"]
  node_ui_app["Audit UI<br/>[ui_app.py]"]
end

subgraph group_data["Audit Data"]
  node_training_data["Adult Audit Data"]
  node_healthcare_setup["Healthcare Setup"]
  node_manual_audit["Manual Audit Workbook"]
end

node_investor(("Investor"))
node_market_service["Yahoo Finance"]

node_investor -->|"enters profile"| node_web_ui
node_web_ui -->|"requests recommendation"| node_recommendation_api
node_recommendation_api -->|"determines risk"| node_risk_profiler
node_recommendation_api -->|"generates portfolio"| node_portfolio_generator
node_recommendation_api -->|"fetches snapshot"| node_market_data
node_market_data -->|"queries prices"| node_market_service
node_recommendation_api -->|"runs audit"| node_audit_integration
node_audit_integration -->|"requests report"| node_coordinator
node_dashboard -->|"determines risk"| node_risk_profiler
node_dashboard -->|"generates portfolio"| node_portfolio_generator
node_dashboard -->|"requests report"| node_coordinator
node_investment_audit -->|"determines risk"| node_risk_profiler
node_investment_audit -->|"generates portfolio"| node_portfolio_generator
node_investment_audit -->|"requests report"| node_coordinator
node_comparison -->|"loads workbook"| node_manual_audit
node_training_data -->|"writes audit CSV"| node_training_data

click node_web_ui "https://github.com/poojaellanti/maica/blob/main/frontend/script.js"
click node_recommendation_api "https://github.com/poojaellanti/maica/blob/main/investment_app/app.py"
click node_risk_profiler "https://github.com/poojaellanti/maica/blob/main/investment_app/risk_profiler.py"
click node_portfolio_generator "https://github.com/poojaellanti/maica/blob/main/investment_app/portfolio_model.py"
click node_market_data "https://github.com/poojaellanti/maica/blob/main/investment_app/stock_fetcher.py"
click node_audit_integration "https://github.com/poojaellanti/maica/blob/main/investment_app/audit_integration.py"
click node_coordinator "https://github.com/poojaellanti/maica/blob/main/agents/coordinator_agent.py"
click node_regulation "https://github.com/poojaellanti/maica/blob/main/agents/regulation_agent.py"
click node_model_inspection "https://github.com/poojaellanti/maica/blob/main/agents/model_inspection_agent.py"
click node_monitoring "https://github.com/poojaellanti/maica/blob/main/agents/monitoring_agent.py"
click node_explainability "https://github.com/poojaellanti/maica/blob/main/agents/explainability_agent.py"
click node_security "https://github.com/poojaellanti/maica/blob/main/agents/security_agent.py"
click node_data_protection "https://github.com/poojaellanti/maica/blob/main/agents/data_protection_agent.py"
click node_comparison "https://github.com/poojaellanti/maica/blob/main/agents/comparison_agent.py"
click node_training_data "https://github.com/poojaellanti/maica/blob/main/data/adult_model_setup.py"
click node_healthcare_setup "https://github.com/poojaellanti/maica/blob/main/data/healthcare_model_setup.py"
click node_manual_audit "https://github.com/poojaellanti/maica/blob/main/manual_audit/Manual_Audit_Adult.xlsx"
click node_dashboard "https://github.com/poojaellanti/maica/blob/main/maica_dashboard.py"
click node_investment_audit "https://github.com/poojaellanti/maica/blob/main/maica_investment_audit.py"
click node_ui_app "https://github.com/poojaellanti/maica/blob/main/ui_app.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_web_ui,node_recommendation_api,node_risk_profiler,node_portfolio_generator,node_market_data,node_dashboard toneBlue
class node_audit_integration,node_coordinator,node_regulation,node_model_inspection,node_monitoring,node_explainability,node_security,node_data_protection,node_comparison,node_investment_audit,node_ui_app toneAmber
class node_training_data,node_healthcare_setup,node_manual_audit toneMint
class node_investor,node_market_service toneIndigo
```

## Components

### Investment Advisor

- [Advisor Web UI](https://github.com/poojaellanti/maica/blob/main/frontend/script.js): `frontend/script.js`
- [Recommendation API](https://github.com/poojaellanti/maica/blob/main/investment_app/app.py): `investment_app/app.py`
- [Risk Profiler](https://github.com/poojaellanti/maica/blob/main/investment_app/risk_profiler.py): `investment_app/risk_profiler.py`
- [Portfolio Generator](https://github.com/poojaellanti/maica/blob/main/investment_app/portfolio_model.py): `investment_app/portfolio_model.py`
- [Market Snapshot](https://github.com/poojaellanti/maica/blob/main/investment_app/stock_fetcher.py): `investment_app/stock_fetcher.py`
- [Portfolio Audit Dashboard](https://github.com/poojaellanti/maica/blob/main/maica_dashboard.py): `maica_dashboard.py`

### MAICA Audit

- [Audit Integration](https://github.com/poojaellanti/maica/blob/main/investment_app/audit_integration.py): `investment_app/audit_integration.py`
- [Report Coordinator](https://github.com/poojaellanti/maica/blob/main/agents/coordinator_agent.py): `agents/coordinator_agent.py`
- [Regulation Checks](https://github.com/poojaellanti/maica/blob/main/agents/regulation_agent.py): `agents/regulation_agent.py`
- [Model Inspection](https://github.com/poojaellanti/maica/blob/main/agents/model_inspection_agent.py): `agents/model_inspection_agent.py`
- [Runtime Monitoring](https://github.com/poojaellanti/maica/blob/main/agents/monitoring_agent.py): `agents/monitoring_agent.py`
- [Explainability](https://github.com/poojaellanti/maica/blob/main/agents/explainability_agent.py): `agents/explainability_agent.py`
- [Security Checks](https://github.com/poojaellanti/maica/blob/main/agents/security_agent.py): `agents/security_agent.py`
- [Data Protection](https://github.com/poojaellanti/maica/blob/main/agents/data_protection_agent.py): `agents/data_protection_agent.py`
- [Audit Comparison](https://github.com/poojaellanti/maica/blob/main/agents/comparison_agent.py): `agents/comparison_agent.py`
- [Investment Audit Runner](https://github.com/poojaellanti/maica/blob/main/maica_investment_audit.py): `maica_investment_audit.py`
- [Audit UI](https://github.com/poojaellanti/maica/blob/main/ui_app.py): `ui_app.py`

### Audit Data

- [Adult Audit Data](https://github.com/poojaellanti/maica/blob/main/data/adult_model_setup.py): `data/adult_model_setup.py`
- [Healthcare Setup](https://github.com/poojaellanti/maica/blob/main/data/healthcare_model_setup.py): `data/healthcare_model_setup.py`
- [Manual Audit Workbook](https://github.com/poojaellanti/maica/blob/main/manual_audit/Manual_Audit_Adult.xlsx): `manual_audit/Manual_Audit_Adult.xlsx`

### Other components

- **Investor**
- **Yahoo Finance**

## Connections

- Investor → Advisor Web UI: enters profile (evidence: `frontend/script.js`)
- Advisor Web UI → Recommendation API: requests recommendation (evidence: `frontend/script.js`)
- Recommendation API → Risk Profiler: determines risk (evidence: `investment_app/app.py`)
- Recommendation API → Portfolio Generator: generates portfolio (evidence: `investment_app/app.py`)
- Recommendation API → Market Snapshot: fetches snapshot (evidence: `investment_app/app.py`)
- Market Snapshot → Yahoo Finance: queries prices (evidence: `investment_app/stock_fetcher.py`)
- Recommendation API → Audit Integration: runs audit (evidence: `investment_app/app.py`)
- Audit Integration → Report Coordinator: requests report (evidence: `investment_app/audit_integration.py`)
- Portfolio Audit Dashboard → Risk Profiler: determines risk (evidence: `maica_dashboard.py`)
- Portfolio Audit Dashboard → Portfolio Generator: generates portfolio (evidence: `maica_dashboard.py`)
- Portfolio Audit Dashboard → Report Coordinator: requests report (evidence: `maica_dashboard.py`)
- Investment Audit Runner → Risk Profiler: determines risk (evidence: `maica_investment_audit.py`)
- Investment Audit Runner → Portfolio Generator: generates portfolio (evidence: `maica_investment_audit.py`)
- Investment Audit Runner → Report Coordinator: requests report (evidence: `maica_investment_audit.py`)
- Audit Comparison → Manual Audit Workbook: loads workbook (evidence: `agents/comparison_agent.py`)
- Adult Audit Data → Adult Audit Data: writes audit CSV (evidence: `data/adult_model_setup.py`)
