# tasoo-oos/llmfactor architecture

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

- Interactive diagram: https://gitdiagram.com/tasoo-oos/llmfactor
- Repository: https://github.com/tasoo-oos/llmfactor

## Overview

##### Main Components Identification
The system can be broken down into three main components:

a. Data Management Layer
- Location: dataset_manager/
- Purpose: Handles financial data (news and price data) for various stock symbols
- Sub-components:
- News data processor (news_data_cmin.py)
- Price data processor (price_data_cmin.py)

b. Core Processing Layer
- Location: llmfactor/core/
- Purpose: Main processing logic
- Components:
- Analyzer (analyzer.py)
- Runner (runner.py)

c. Utility Layer
- Location: llmfactor/utils/
- Purpose: Supporting functionality
- Components:
- Logger
- Statistics

**[Data Sources]**

- ▼
**[Data Management Layer]**

- ▼
**[Core Processing Layer]**

- ▼
**[Output/Analysis Results]**

##### Component Relationships

Following flows:
a. Data Flow:
- Raw data → Dataset Manager → Core Processor
- Core Processor → Analysis Results

b. Control Flow:
- CLI → Runner → Analyzer
- Analyzer ↔ Utils

##### Detailed Component Breakdown

a. Data Sources Section:
- News Data Repository (CMIN-US/news)
- Price Data Repository (CMIN-US/price)

b. Dataset Manager:
- News Data Processor
- Price Data Processor
- Data Transformation Logic

c. Core Processing:
- Analyzer Component
- Runner Component
- Processing Pipeline

d. Utility Components:
- Logging System
- Statistical Analysis Tools

##### Implementation Notes

- The modular nature of the system
- Clear separation between data management and processing
- The pipeline nature of the processing flow
- Integration points for potential extensions

## Diagram (Mermaid)

```mermaid
graph TB
    %% Data Sources
    subgraph DataSources[Data Sources Layer]
        NewsRepo["News Data Repository"]:::data
        PriceRepo["Price Data Repository"]:::data
    end

    %% Data Management Layer
    subgraph DataManagement[Data Management Layer]
        NewsProc["News Data Processor"]:::processor
        PriceProc["Price Data Processor"]:::processor
        DataTransform["Data Transformation"]:::processor
    end

    %% Core Processing Layer
    subgraph CoreProcessing[Core Processing Layer]
        Runner["Runner Component"]:::core
        Analyzer["Analyzer Component"]:::core
        Pipeline["Processing Pipeline"]:::core
    end

    %% Utility Layer
    subgraph Utils[Utility Layer]
        Logger["Logging System"]:::utility
        Stats["Statistical Analysis"]:::utility
    end

    %% Interface Layer
    CLI["CLI Interface"]:::interface
    Main["Main Entry Point"]:::interface
    Results["Analysis Results"]:::output

    %% Relationships
    NewsRepo --> NewsProc
    PriceRepo --> PriceProc
    NewsProc --> DataTransform
    PriceProc --> DataTransform
    DataTransform --> Pipeline
    Pipeline --> Runner
    Runner --> Analyzer
    Analyzer --> Results
    
    CLI --> Main
    Main --> Runner

    Analyzer -.-> Logger
    Analyzer -.-> Stats
    Runner -.-> Logger

    %% Styles
    classDef data fill:#b3e0ff,stroke:#333,stroke-width:2px
    classDef processor fill:#90EE90,stroke:#333,stroke-width:2px
    classDef core fill:#FFB366,stroke:#333,stroke-width:2px
    classDef utility fill:#E0E0E0,stroke:#333,stroke-width:2px
    classDef interface fill:#FF9999,stroke:#333,stroke-width:2px
    classDef output fill:#DDA0DD,stroke:#333,stroke-width:2px

    %% Click Events
    click NewsRepo "https://github.com/tasoo-oos/LLMFactor/tree/master/dataset_manager/CMIN-US/news/raw"
    click PriceRepo "https://github.com/tasoo-oos/LLMFactor/tree/master/dataset_manager/CMIN-US/price/raw"
    click NewsProc "https://github.com/tasoo-oos/LLMFactor/blob/master/dataset_manager/news_data_cmin.py"
    click PriceProc "https://github.com/tasoo-oos/LLMFactor/blob/master/dataset_manager/price_data_cmin.py"
    click Runner "https://github.com/tasoo-oos/LLMFactor/blob/master/llmfactor/core/runner.py"
    click Analyzer "https://github.com/tasoo-oos/LLMFactor/blob/master/llmfactor/core/analyzer.py"
    click Logger "https://github.com/tasoo-oos/LLMFactor/blob/master/llmfactor/utils/logger.py"
    click Stats "https://github.com/tasoo-oos/LLMFactor/blob/master/llmfactor/utils/statistics.py"
    click CLI "https://github.com/tasoo-oos/LLMFactor/blob/master/llmfactor/cli.py"
    click Main "https://github.com/tasoo-oos/LLMFactor/blob/master/llmfactor/__main__.py"

    %% Legend
    subgraph Legend
        L1["Data Storage"]:::data
        L2["Data Processing"]:::processor
        L3["Core Components"]:::core
        L4["Utility Components"]:::utility
        L5["Interface Components"]:::interface
        L6["Output"]:::output
    end
```
