The Continuous Quality Guard (CQG) is a real-time monitoring and intervention system designed for flow regime monitoring in industrial fluid systems. It provides continuous quality assessment, risk detection, and automated supervisory control to maintain optimal system performance.
- Real-time Data Ingestion: High-throughput streaming data processing from sensors and IoT devices
- Feature Factory: Advanced feature engineering with temporal and statistical transformations
- Regime Detection: ML-powered flow regime classification with confidence scoring
- Quality & Risk Assessment: Multi-dimensional quality scoring and risk prediction
- Supervisory Policy Engine: Rule-based and adaptive control strategies
- Action Gateway: Safe, coordinated execution of control actions
- TimescaleDB Integration: Time-series optimized data storage and retrieval
- Kubernetes-Ready: Production-grade deployment with horizontal scaling
# Clone the repository git clone <repository-url> cd "Flow Regime Monitoring" # Set up environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt # Configure environment cp .env.example .env # Edit .env with your settings # Start services with Docker Compose docker-compose up -d # Run initialization python scripts/init_database.py python scripts/load_baseline_models.py # Start the CQG system python src/main.py
The CQG system consists of six core components:
- Ingestion Service: Receives and validates sensor data in real-time
- Feature Factory: Transforms raw data into engineered features
- Regime Detection: Classifies flow regimes using ML models
- Quality & Risk Engine: Evaluates system health and predicts risks
- Supervisory Policy: Determines optimal control actions
- Action Gateway: Executes approved control commands
See CQG_SYSTEM_ARCHITECTURE.md for detailed architecture.
- Master Index - Complete file and component index
- Implementation Quickstart - Step-by-step setup guide
- System Architecture - Technical architecture details
- API Reference - REST and gRPC API documentation
- Configuration Guide - Configuration options
- Deployment Guide - Production deployment
- Contributing - Development guidelines
- Python 3.10+
- PostgreSQL 14+ with TimescaleDB 2.8+
- 4 GB RAM
- 2 CPU cores
- Python 3.11+
- PostgreSQL 15+ with TimescaleDB 2.11+
- 16 GB RAM
- 8 CPU cores
- SSD storage
# Install dependencies pip install -r requirements.txt pip install -r requirements-dev.txt # Set up pre-commit hooks pre-commit install # Run tests pytest tests/
See Deployment Guide for:
- Docker deployment
- Kubernetes deployment
- Cloud provider setup (AWS, Azure, GCP)
- High availability configuration
- Monitoring and alerting
Primary configuration file: config/cqg_config.yaml
Key configuration sections:
- Database connection settings
- Feature engineering parameters
- Model hyperparameters
- Risk thresholds
- Control policies
- Logging and monitoring
See Configuration Guide for details.
# Run all tests pytest tests/ # Run specific test suites pytest tests/unit/ pytest tests/integration/ pytest tests/acceptance/ pytest tests/performance/ # Run with coverage pytest --cov=src --cov-report=html tests/
The CQG system includes built-in monitoring:
- Prometheus metrics export
- Grafana dashboards
- Health check endpoints
- Performance profiling
- Audit logging
Expected performance characteristics:
- Data ingestion: 10,000+ samples/second
- Feature computation: <10ms per sample
- Regime detection: <50ms per classification
- End-to-end latency: <100ms (p95)
- Throughput: 5,000+ decisions/second
- API authentication via JWT tokens
- Role-based access control (RBAC)
- Encrypted data at rest and in transit
- Audit logging for all control actions
- Configurable action approval workflows
MIT License - See LICENSE for details
We welcome contributions! Please see CONTRIBUTING.md for:
- Code style guidelines
- Testing requirements
- Pull request process
- Development workflow
- Documentation: docs/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
See CHANGELOG.md for version history and release notes.
Built with:
- Python 3.11
- FastAPI
- TimescaleDB
- scikit-learn
- pandas
- NumPy
- Kubernetes
Version: 1.0.0
Status: Production Ready
Last Updated: February 2026