How maddmdr/invise-ihsg-intelligence-platform works
Project type and purpose
• This is a full-stack, single‐page dashboard application built in Python using Streamlit for the UI and a modular “hybrid AI” backend for data ingestion, ML prediction, and LLM-powered narrative. It combines real-time financial data (IHSG and correlated assets) with ensemble models (XGBoost/LightGBM) and Ollama LLM reasoning to drive a predictive analytics dashboard.
File structure
• Top level:
• app.py → Streamlit entry-point (Presentation Layer)
• css.py → UI styling helpers
• chart_utils.py → Plotly chart helper functions
• ihsg_platform.py → Quantitative ML pipeline (feature engineering, model training/inference)
• ollama_chat.py → Adapter for Ollama LLM calls (narrative analysis & chat)
• requirements.txt → Dependency manifest
• __pycache__ → compiled Python bytecode
• No separate “frontend” folder—UI lives in app.py + helper modules.
• No persistent database; data is fetched on the fly via yfinance (Data Acquisition Layer).
• External service integration via ollama_chat.py (Ollama API).
README for architectural insights
• The README explicitly calls out a 3-layer architecture:
1. Presentation Layer (Streamlit)
2. Hybrid AI Engine (Quant ML pipeline + LLM Reasoning)
3. Data Acquisition Layer (yfinance)
• Technologies: Python 3.10+, Streamlit, Pandas, NumPy, Scikit-learn, XGBoost, LightGBM, Plotly, Ollama.
• Presentation Layer
• app.py (Streamlit server)
• css.py (styles)
• chart_utils.py (visualizations)
• Hybrid AI Engine
• Quantitative Pipeline (ihsg_platform.py)
• LLM Reasoner (ollama_chat.py)
• Data Acquisition Layer
• Yahoo Finance API adapter (inside ihsg_platform.py)
• External Services
• Ollama (local LLM server)
• Yahoo Finance REST API
• User → Streamlit UI (app.py)
• UI → Data Acquisition Layer (fetch raw time-series via yfinance)
• UI → Quantitative Pipeline (train/infer calls to ihsg_platform.py)
• Quantitative Pipeline ↔ LLM Reasoner (pass model outputs to ollama_chat.py for narrative)
• LLM Reasoner → External Ollama service → returns narrative
• AI Engine results → Streamlit UI → rendered via chart_utils.py & css.py
c. Architectural patterns & principles:
• Three-tier layered architecture (separation of concerns)
• Adapter pattern for external services (ollama_chat.py for LLM, direct calls to yfinance)
• Pipeline pattern in ihsg_platform.py (feature engineering → ensemble models → recursive forecasting)
• Modular monolith: all code in a single repo but logically separated by function
d. Key technologies & libraries:
• Python 3.10+, Streamlit (UI), Pandas/NumPy (data manip), Plotly (charts)
• Scikit-learn, XGBoost, LightGBM (ML)
• Ollama local LLM server (LLM reasoning)
• yfinance (data ingestion)