Natural language interface for manufacturing operations — query production data, quality metrics, and equipment sensors across multiple plants
Table of Contents: Problem | Solution | Features | Architecture | Quick Start | Configuration
Manufacturing teams spend hours digging through dashboards, running SQL queries, and waiting for report generation. Non-technical operators and supervisors can't access the data they need when they need it. Critical insights are locked behind complex queries that only database administrators can write.
A typical scenario:
- Operator needs OEE (Overall Equipment Effectiveness) data from 3 plants
- Sends Slack message to data team
- Waits 2-4 hours for response
- By then, the issue has grown worse
A conversational AI copilot that lets any team member query production data, quality metrics, and sensor readings in plain English — across all plants simultaneously. No SQL knowledge required.
Key metrics from production deployment:
- 500+ daily active users across 12 manufacturing facilities
- Sub-3-second response time for complex multi-plant queries
- 87% reduction in time-to-insight for operations teams
- 24/7 availability vs business-hours-only data team support
- 92% query accuracy on manufacturing-specific terminology
- Natural Language to SQL — Convert plain English questions directly to optimized queries
- Multi-Plant Federation — Query across 12+ manufacturing facilities with unified interface
- Real-Time Dashboard — Production metrics with drill-down capabilities
- Predictive Maintenance Alerts — Anomalies and equipment health predictions from sensor data
- Quality Analytics — Yield, defect rate, and root cause analysis
- Role-Based Access Control — Operator vs Manager vs Executive views with appropriate data filtering
- Conversation History — Save and recall previous queries for recurring analyses
- Export Functionality — Download reports as Excel/PDF for meetings and documentation
- Manufacturing Terminology — Built-in knowledge of industry metrics (OEE, MTBF, MTTR, takt time, etc.)
┌─────────────────────────────────────────────────────────────┐
│ User Interface │
│ (Streamlit Dashboard) │
└──────────────────────┬──────────────────────────────────────┘
│
┌──────────────────────▼──────────────────────────────────────┐
│ Query Processing │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Query Interpreter (NLP) → Intent Understanding │ │
│ │ SQL Generator → Optimized Query Creation │ │
│ │ Query Router → Plant Selection & Federated Exec │ │
│ └─────────────────────────────────────────────────────┘ │
└──────────────────────┬──────────────────────────────────────┘
│
┌──────────────┼──────────────┐
│ │ │
┌───────▼─────┐ ┌─────▼──────┐ ┌────▼───────┐
│ Plant DB 1 │ │ Plant DB 2 │ │ Plant DB N │
│ (Factory A) │ │ (Factory B) │ │ (Factory Z)│
└───────┬─────┘ └─────┬──────┘ └────┬───────┘
│ │ │
└──────────────┼──────────────┘
│
┌──────────────────────▼──────────────────────────────────────┐
│ Data Aggregation & Analytics │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Multi-Plant Aggregator → Cross-Plant Metrics │ │
│ │ Anomaly Detector → Quality & Sensor Analysis │ │
│ │ Response Formatter → Human-Readable Output │ │
│ └─────────────────────────────────────────────────────┘ │
└──────────────────────┬──────────────────────────────────────┘
│
┌──────────────────────▼──────────────────────────────────────┐
│ Response & Visualization │
│ (Charts, Tables, Alerts) │
└─────────────────────────────────────────────────────────────┘
- Python 3.9+
- Access to manufacturing databases
- OpenAI API key (for LLM query generation)
git clone https://github.com/SainathPattipati/manufacturing-ai-copilot.git
cd manufacturing-ai-copilot
pip install -r requirements.txtCreate a .env file:
OPENAI_API_KEY=sk-...
DATABASE_PLANT_1_URL=postgresql://user:pass@host:5432/plant1_db
DATABASE_PLANT_2_URL=postgresql://user:pass@host:5432/plant2_db
DATABASE_PLANT_N_URL=postgresql://user:pass@host:5432/plantN_db
STREAMLIT_SERVER_PORT=8501streamlit run src/ui/dashboard.pyThen open http://localhost:8501 in your browser.
After startup, try these natural language queries:
- "What's the OEE for all plants today?"
- "Show me yield trends for the last 7 days"
- "Which plant has the highest downtime?"
- "What are the quality defects in Assembly Line 3?"
- "Are there any anomalies in temperature sensors?"
- "Compare production output across all facilities"
The copilot connects to multiple manufacturing databases. Each plant database should have:
production_runstablequality_metricstableequipment_sensorstableequipment_inventorytable
See docs/ARCHITECTURE.md for detailed schema requirements.
Define plants in config/plants.yaml:
plants:
- id: plant_a
name: "Assembly Plant A"
location: "Midwest Region"
connection_string: ${DATABASE_PLANT_1_URL}
timezone: "America/Chicago"
- id: plant_b
name: "Manufacturing Plant B"
connection_string: ${DATABASE_PLANT_2_URL}
timezone: "America/New_York"- OEE (Overall Equipment Effectiveness) = Availability × Performance × Quality
- MTBF (Mean Time Between Failures) = Total Operating Time / Number of Failures
- MTTR (Mean Time To Repair) = Total Downtime / Number of Repairs
- Takt Time = Available Production Time / Customer Demand
- First Pass Yield = Units Passing QC First Time / Total Units Produced
- Role-based access control (RBAC) filters sensitive data
- All database connections use SSL/TLS encryption
- Audit logging for all queries
- No sensitive data in conversation history
- PII removal in aggregated reports
docs/ARCHITECTURE.md- System design and component detailsdocs/DATABASE_SCHEMA.md- Required database structuredocs/API_REFERENCE.md- Python API documentation
pytest tests/ -v --cov=srcContributions welcome! Please see CONTRIBUTING.md for guidelines.
MIT License - see LICENSE file for details
Built by Sainath Pattipati for enterprise manufacturing environments requiring real-time intelligence across distributed operations.
Questions? Open an issue or contact via GitHub.