





// Example of manufacturing-data.json workflow for the current project
{
"Receiving Sensor Data": "Webhook → Data Analysis → Notification Generation",
"Threshold-Based Notifications": "Temperature > 200°C, Pressure > 3.0 → Immediate Notification",
"Batch Tracking": "Linking Quality Data Based on Lot ID"
}{
"센서 데이터 수신": "Webhook Endpoint",
"데이터 분석": "Threshold Check with JavaScript Function",
"알림 생성": "Conditional Notification System",
"응답 전송": "Real-time Feedback"
}{
"메트릭 수집": "CPU, Memory, Disk, Network Monitoring",
"상태 분석": "Threshold-based Health Assessment",
"알림 발송": "Multi-channel Notifications such as Email, Slack",
"보고서 생성": "System Status Summary Report"
}// manufacturing_consultant template for current project
{
"Areas of Expertise": [
"Manufacturing process optimization (productivity improvement, process improvement)",
"Quality control (QC/QA, defect rate reduction, quality system)",
"Safety management (industrial safety, risk assessment, safety training)",
"Equipment management (preventive maintenance, failure diagnosis, equipment selection)",
"Production planning (scheduling, inventory management, delivery management)"
],
"Response Method": [
"Provide specific and actionable solutions",
"Mention relevant laws or standards if available",
"Always emphasize safety-related matters",
"Provide step-by-step guidance if necessary"
]
}# Core functionality of backend/routers/dify_agent.py
@router.post("/agents/auto-create/{template_id}")
async def auto_create_agent_from_template(
template_id: str,
name: str,
description: str = ""
):
# 1. Automatically create a Dify app
# 2. Configure app settings (model, prompt, tools)
# 3. Automatically generate API key
# 4. Register local agent// Currently implemented 9 domain-specific expert AI agents
{
"manufacturing_consultant": "Manufacturing Consultant Bot",
"quality_analyst": "Quality Analysis Expert",
"safety_manager": "Safety Management Expert",
"equipment_engineer": "Equipment Engineer",
"cost_optimizer": "Cost Optimization Expert",
"process_analyst": "Process Analysis Expert",
"maintenance_planner": "Maintenance Planner",
"inventory_manager": "Inventory Management Expert",
"production_scheduler": "Production Planning Expert"
}# Currently Implemented Context Engineering System
class ContextEngineer:
def create_situation_context(self, params: Dict[str, Any], topic: str) -> str:
"""Creates situation awareness context by topic"""
if topic == "experimental_design":
return self._create_experimental_design_context(params)
elif topic == "process_analysis":
return self._create_process_analysis_context(params)
elif topic == "cost_management":
return self._create_cost_management_context(params)
// Passing Real-time Simulation Parameters
simulationParams={{
activeTab: activeTab,
hasData: !!data,
dataInfo: dataInfo,
uploadedFileName: uploadedFile?.name,
selectedColumns: selectedColumns,
correlationThreshold: correlationThreshold,
selectedColumn: selectedColumn,
chartType: chartType,
preprocessingCompleted: !!preprocessingResult,
isAnalyzing: isAnalyzing,
isPreprocessing: isPreprocessing
}}// Example of real-time data from the production site
{
"production_context": {
"current_lot": "LOT-2024-001",
"equipment_status": {
"reactor_01": "running",
"reactor_02": "maintenance",
"reactor_03": "idle"
},
"quality_metrics": {
"temperature": 185.5,
"pressure": 2.3,
"purity": 98.2,
"yield": 94.8
},
"alerts": [
"reactor_01_temperature_high",
"reactor_02_maintenance_due"
],
"production_schedule": {
"current_phase": "reaction",
"time_remaining": "2h 15m",
"next_phase": "cooling"
}
}
}// Real-time monitoring data
{
"monitoring_context": {
"sensor_data": {
"temperature_sensors": [185.5, 187.2, 183.8],
"pressure_sensors": [2.3, 2.4, 2.2],
"flow_rates": [150, 148, 152],
"vibration_levels": [0.2, 0.3, 0.1]
},
"anomaly_detection": {
"anomalies_detected": 2,
"severity_levels": ["medium", "low"],
"recommended_actions": [
"check_temperature_control",
"schedule_maintenance"
]
},
"performance_metrics": {
"oee": 87.5,
"uptime": 94.2,
"quality_rate": 96.8
}
}
}// Real-time data for quality management
{
"quality_context": {
"current_batch": {
"batch_id": "BATCH-2024-001",
"sample_count": 150,
"defect_count": 3,
"defect_rate": 2.0,
"quality_score": 98.0
},
"quality_trends": {
"last_24h_defect_rate": 1.8,
"weekly_average": 2.1,
"monthly_trend": "improving"
},
"quality_alerts": [
"defect_rate_increasing",
"sample_quality_degrading"
]
}
}