# analytica-manulife/aiservices architecture

> Architecture diagram of the GitHub repository analytica-manulife/aiservices, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/analytica-manulife/aiservices
- Repository: https://github.com/analytica-manulife/aiservices

## Overview

##### Project type and purpose
- From the file tree and README, this is a Python-based AI Services collection (“AIServices”) composed of several analysis and generation scripts (e.g. NewsAnalyzer, KYCAnalyzer, ImageGenerator, StockSuggest, TransectionAnalysis).
- It is a backend CLI/service application for performing different AI/ML–powered analyses, with a central orchestrator (main.py) that invokes specialized modules and writes/reads data from local JSON/CSV stores.

##### File structure
- Top-level scripts:
- main.py – the entry point that wires everything together
- AnalyzerFunction.py – common utilities or shared model-invocation code
- ImageGenerator.py – module for AI image creation
- NewsAnalyzer.py – module for news sentiment/insight analysis
- KYCAnalyzer.py – module for “Know Your Customer” document analysis
- StockSuggest.py – module to suggest stocks based on data
- TransectionAnalysis.py – module for transaction data analysis
- Data directories/files:
- company_news/*.json – cached news data for various companies
- news.csv – a flat-file log of incoming news items or analysis results
- Configuration:
- requirements.txt – lists Python dependencies (e.g., TensorFlow, PyTorch, scikit-learn, requests)
- .gitignore – standard ignores
- No separate “frontend” or microservice directories indicate a monolithic service-oriented design.

##### README for additional insights
- README is minimal (“# AIServices”), so all architectural understanding comes from the file names and directory layout.

## Diagram (Mermaid)

```mermaid
flowchart TB
    Client["Client/CLI"]:::cli
    Orch["Orchestrator (main.py)"]:::orchestrator
    Util["Shared Utilities (AnalyzerFunction.py)"]:::util

    subgraph "Analysis Modules"
        KYC["KYC Analyzer"]:::analyzer
        News["News Analyzer"]:::analyzer
        Trans["Transaction Analyzer"]:::analyzer
        Stock["Stock Suggestion Engine"]:::engine
        Img["Image Generator"]:::generator
    end

    subgraph "Data Stores"
        JSON["JSON Data Store<br/>(company_news/)"]:::datastore
        CSV["CSV Data Store<br/>(news.csv)"]:::datastore
    end

    subgraph "External Services"
        NewsAPI["News API"]:::external
        FinanceAPI["Financial Data API"]:::external
        CloudAI["Cloud AI Services"]:::external
    end

    Client --> Orch
    Orch --> KYC
    Orch --> News
    Orch --> Trans
    Orch --> Stock
    Orch --> Img

    Util --> KYC
    Util --> News
    Util --> Trans
    Util --> Stock
    Util --> Img

    KYC --> JSON
    KYC --> CSV
    News --> NewsAPI
    News --> JSON
    News --> CSV
    Trans --> CSV
    Stock --> FinanceAPI
    Stock --> CSV
    Img --> CloudAI

    classDef cli fill:#f9f,stroke:#333,stroke-width:1px
    classDef orchestrator fill:#bbf,stroke:#333,stroke-width:1px
    classDef util fill:#ffeb3b,stroke:#333,stroke-width:1px
    classDef analyzer fill:#88f,stroke:#333,stroke-width:1px
    classDef engine fill:#8f8,stroke:#333,stroke-width:1px
    classDef generator fill:#8f8,stroke:#333,stroke-width:1px
    classDef datastore fill:#faa,stroke:#333,stroke-width:1px
    classDef external fill:#ccc,stroke:#333,stroke-width:1px

    click Orch "https://github.com/analytica-manulife/aiservices/blob/main/main.py"
    click Util "https://github.com/analytica-manulife/aiservices/blob/main/AnalyzerFunction.py"
    click KYC "https://github.com/analytica-manulife/aiservices/blob/main/KYCAnalyzer.py"
    click News "https://github.com/analytica-manulife/aiservices/blob/main/NewsAnalyzer.py"
    click Trans "https://github.com/analytica-manulife/aiservices/blob/main/TransectionAnalysis.py"
    click Stock "https://github.com/analytica-manulife/aiservices/blob/main/StockSuggest.py"
    click Img "https://github.com/analytica-manulife/aiservices/blob/main/ImageGenerator.py"
    click JSON "https://github.com/analytica-manulife/aiservices/tree/main/company_news/"
    click CSV "https://github.com/analytica-manulife/aiservices/blob/main/news.csv"
```
