Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

GenAI Factory Control Tower: Real-Time Predictive Maintenance

Python Google Cloud Streamlit LangChain Groq

Overview

The GenAI Factory Control Tower is an end-to-end, distributed cloud data pipeline and predictive maintenance dashboard. It simulates real-time IoT sensor telemetry from a factory floor, streams the data into an enterprise data warehouse, and uses Machine Learning and Generative AI to predict equipment failures before they happen.

This project demonstrates the complete lifecycle of enterprise data engineering, machine learning deployment, and agentic AI integration.

System Architecture

  1. The Factory Floor (Local Generator): A Python microservice continuously generates synthetic IoT sensor data (Temperature, Vibration, Pressure) for 50 factory machines.
  2. The Data Pipeline (ETL): Automated scripts push this streaming telemetry data into Google BigQuery in real-time.
  3. The Nervous System (Microservice Alerts): A local agent continuously scans the data stream. If a machine's current state breaches critical thermal thresholds (e.g., > 120°C), it triggers a localized smtplib protocol to send real-time email warnings to the shift manager.
  4. The Brain (Predictive ML): A pre-trained Machine Learning model (scikit-learn) calculates a real-time "Health Score" for each machine based on historical failure patterns.
  5. The Control Tower (Streamlit Cloud): A globally accessible web application visualizes the BigQuery database in real-time.
  6. The AI Agent (LangChain + Groq): A built-in LLM interface translates natural language questions (e.g., "Which machines are currently at risk?") into SQL queries, executes them against BigQuery, and returns human-readable insights.

Technology Stack

  • Cloud & Database: Google Cloud Platform (GCP), BigQuery
  • Frontend / Hosting: Streamlit, Streamlit Community Cloud
  • AI & LLM: LangChain, Groq API, Llama-3
  • Machine Learning: Scikit-Learn, Joblib, Pandas
  • Automation: Python subprocess, smtplib

Key Features

  • Real-Time Database Syncing: Dashboard reflects live changes as the local generator pumps data to the cloud.
  • Agentic Alerting: Intelligent threshold monitoring that actively emails stakeholders during critical anomalies.
  • Natural Language Database Querying: Bypasses the need for SQL knowledge by letting users "talk" directly to the factory floor using LLMs.
  • Secure Cloud Secrets Management: Robust handling of GCP Service Accounts and API keys via Streamlit's encrypted secrets.

Running the Factory Simulation Locally

To wake up the factory floor and start pumping data to the cloud dashboard:

  1. Clone this repository.
  2. Install the required dependencies:
    pip install -r requirements.txt

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages