# m-agni17/fingenix architecture

> Architecture diagram of the GitHub repository m-agni17/fingenix, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/m-agni17/fingenix
- Repository: https://github.com/m-agni17/fingenix

## Overview

Key Components to Include:

##### Frontend Layer
- Two main interaction paths: MySQL and CSV upload

##### Processing Layer (Core)
- Two processing pipelines:
a. MySQL Pipeline
b. CSV Pipeline

##### Data Layer
- CSV file storage on the other side

##### User Input Flow
- User → Streamlit Interface → Query Processing
##### Data Source Flow
- MySQL/CSV → Schema/Data Extraction → Processing Layer
##### Processing Flow
- Natural Language → Llama 3 Model → SQL/Python Query
##### Result Flow
- Query Results → Result Beautification → User Interface

Specific Elements to Include:

##### Input Components
- MySQL Connection Panel
- CSV File Uploader
- Natural Language Query Input

##### Processing Components
- Schema Extraction Module
- Query Refinement Engine
- Fine-tuned Llama 3 Model
- Query Execution Engine
- Result Beautification Module

##### Output Components
- Results Display
- Formatted Data View
- Error Handling Display

Design Guidelines:

- User Interface (Top)
- Processing Layer (Middle)
- Data Sources (Bottom)

##### Labels
- Component Names
- Key Technologies (Streamlit, Llama 3, MySQL)
- Major Functions

##### Boundaries
- System Boundary
- Security Perimeter
- External Integration Points

Special Considerations:

##### Fine-tuning Aspect
- Fine-tuned Llama 3 model's position
- Performance metrics mentioned in README

##### Error Handling
- Error feedback loops
- Validation checkpoints

##### Scalability
- Potential scaling points
- Where additional data sources could be added

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef processing fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#e67e22,stroke:#d35400,color:white
    classDef error fill:#e74c3c,stroke:#c0392b,color:white

    %% Frontend Layer
    subgraph Frontend
        UI[Streamlit Web Interface]:::frontend
        NLQ[Natural Language Query Input]:::frontend
        RD[Results Display]:::frontend
        EH[Error Handling Display]:::frontend
    end

    %% Processing Layer
    subgraph Core
        L3[Fine-tuned Llama 3 Model]:::processing
        QR[Query Refinement Engine]:::processing
        QE[Query Execution Engine]:::processing
        RB[Result Beautification]:::processing
        SE[Schema Extraction Module]:::processing
    end

    %% Data Layer
    subgraph Data
        MySQL[(MySQL Database)]:::data
        CSV[("CSV Storage")]:::data
    end

    %% Connections
    UI --> NLQ
    NLQ --> L3
    L3 --> QR
    QR --> QE
    QE --> RB
    RB --> RD
    
    MySQL --> SE
    CSV --> SE
    SE --> L3
    
    QE --> MySQL
    QE --> CSV
    
    QE -.-> EH
    EH -.-> UI

    %% Click Events
    click UI "https://github.com/m-agni17/FinGenix/blob/main/app.py"
    click L3 "https://github.com/m-agni17/FinGenix/blob/main/requirements.txt"
    click CSV "https://github.com/m-agni17/FinGenix/tree/main/images/"
    click MySQL "https://github.com/m-agni17/FinGenix/blob/main/README.md"

    %% Legend
    subgraph Legend
        F[Frontend Component]:::frontend
        P[Processing Component]:::processing
        D[Data Component]:::data
        E[Error Handling]:::error
    end
```
