Global Hackathon 2024 - "Cerebral" (Copilot for Industries)
MIT License
The "Cerebral" Microsoft Global Hackathon 2024 team has laid the foundation for the next generation of the Cerebral solution, an intelligent assistant at the edge that utilizes Generative AI and various Adaptive cloud approach and services. This innovative solution is designed to simplify tasks for different roles across industries such as Retail, Logistics, and Manufacturing.
Cerebral serves as the central intelligence engine that interacts with different personas, showcasing how it assists in various scenarios. By integrating seamlessly across different roles, Cerebral demonstrates its multi-industry, multi-role capabilities, making it a powerful AI assistant for enhancing operational workflows, decision-making processes, and cross-functional collaboration in diverse industries.
Retail (Lisa): As a store manager, Lisa relies on Cerebral to monitor inventory levels. When Cerebral detects low stock for certain products, it proactively alerts Lisa and helps her pre-fill the order form with the required quantities. This feature saves Lisa time and ensures that the store is always well-stocked, preventing potential sales losses due to out-of-stock items.
Logistics (Mark): As a warehouse supervisor, Mark uses Cerebral to stay informed about operational issues. In this case, Cerebral detects a problem with a sensor indicating a broken fridge that could lead to a shortage of products (e.g., 10 boxes of cheese). Cerebral notifies Mark about this issue and helps him by pre-filling the service order form. This ensures that Mark can quickly respond to maintenance needs and avoid further product losses, maintaining the warehouse's efficiency.
Manufacturing (Tom): As an operations technician (OT), Tom benefits from Cerebral's ability to provide step-by-step troubleshooting guidance. Tom can consult Cerebral for documentation and even ask natural language questions to understand how to resolve complex problems, such as fixing an issue with a production machine or addressing food safety concerns. For example, if there's an electricity issue affecting the salmon production line, Cerebral helps guide Tom through the process of identifying and fixing the problem, reducing downtime and ensuring product quality.
Watch our quick 3-minutes video:
The work done during the Hackathon week has focused on the following pillars:
Note: Cerebral is part of the Arc Jumpstart program and a key component of future Jumpstart product investments. It's first implementation was showcased at the Microsoft Build 2004 conference as part of "the Adaptive cloud approach: Build and scale apps from cloud to edge". An additional reference implementation can be found in the form of a Jumpstart Drop as team continues to invest in the solution development.
The architecture of Cerebral is designed to facilitate seamless integration and real-time interaction across various components, making it a versatile solution for different industrial scenarios.
Cerebral Engine: The Cerebral Engine is composed of several logical layers, each playing a vital role in the overall architecture. It integrates seamlessly with different components to provide a flexible and adaptive AI-driven experience. The web application is developed in ReactJS, allowing it to adapt to multiple scenarios and user requirements across various industries.
React JS Web Application: This is the user interface layer that offers an intuitive and user-friendly graphical experience. It enables users to interact with Cerebral's capabilities, presenting data and insights in an accessible format. The use of ReactJS makes the application highly adaptable, capable of supporting various workflows and scenarios.
REST API Query Processing Orchestrator: The REST API layer acts as the main communication hub, managing incoming queries and orchestrating data retrieval from multiple sources. It serves as a gateway that allows Cerebral’s functionalities to be accessed through REST APIs, providing the flexibility to embed Cerebral in different processes and making it agnostic to any graphical interface. This approach enables integration with other systems or applications, enhancing Cerebral's interoperability.
Proactive Recommendation and Alerts Engine: This component provides proactive alerts and recommendations based on predefined rules or AI insights. It continuously monitors the conditions within databases and generates alerts for critical scenarios. Users can configure natural language questions that the engine converts into queries for time-series or relational databases, enabling analysis of the most critical aspects of their business. This ensures that users are always informed about potential issues or opportunities, helping them make data-driven decisions.
RAG (Retrieval Augmented Generation) at the Edge: This module utilizes Chroma vector databases along with SLM/LLM models (such as Phi-3) to deliver intelligent responses. The design pattern of Retrieval Augmented Generation (RAG) allows users to work in environments with limited or no internet connectivity while still benefiting from AI capabilities. This enables the deployment of advanced generative AI models at the edge, ensuring low latency and minimal dependence on cloud connectivity.
Database Connectors: The database connectors facilitate seamless integration with various databases, including InfluxDB, MSSQL Lite, and custom solutions. Cerebral's ability to convert natural language questions into database queries means that users can interact with their data in a more intuitive way. This allows non-technical users to extract insights from time-series or relational databases without needing to understand complex query languages.
Data Sources: Cerebral’s REST API has the capability to analyze natural language questions posed by users and determine whether they relate to real-time data or document/manual-based information. When the question is identified as related to real-time data, the API consults the appropriate data sources, such as InfluxDB for time-series data or SQLite for relational data.
InfluxDB: InfluxDB handles telemetry data from various assets, providing near real-time insights. This data source is ideal for monitoring sensor data, allowing users to keep track of asset conditions and operational metrics.
SQLite: SQLite serves as the storage for point-of-sale (POS) and inventory data, enabling relational queries. This data source is critical for accessing structured data related to products, transactions, and inventory levels within a data warehouse.
Data Simulator: The data simulator generates both time-series and relational data, providing a testing environment for the Cerebral system. This ensures that users can validate their use cases and workflows in a controlled setting before deploying the solution in a live environment.
Azure IoT Operations: Cerebral leverages the capabilities of Azure IoT Operations to facilitate data communication and processing at the edge. It utilizes the MQTT broker as part of the logic for the Retrieval Augmented Generation (RAG) process, ensuring efficient data flow at the edge. Additionally, Azure IoT Operations data flow connectors are employed to transmit data to Azure's data services.
Azure Cognitive Services & OpenAI: These services enhance Cerebral’s capabilities by providing advanced AI functionalities.
PowerBI Dashboards & Azure Data Factory: These components provide visualization and data orchestration capabilities that are essential for monitoring and analyzing business operations.
The decision tree architecture of Cerebral illustrates how different data types and queries are handled to provide relevant insights and recommendations.
Cerebral uses a bi-directional query workflow to handle various use cases:
Queries are classified into three main types:
Cerebral offers a versatile solution designed to support various roles:
Cerebral’s multi-industry, multi-role capabilities make it a powerful assistant that integrates AI into day-to-day operations seamlessly.
The Business Intelligence (BI) data pipeline in Cerebral is designed to provide comprehensive insights into sales, inventory management, and operational data across various retail locations. It integrates edge data processing with cloud-based analytics to deliver both real-time and historical insights for different roles, including local store managers, operations teams, business analysts, and accounting professionals.
Data Ingestion
Data Storage
Cerebral Integration The Cerebral engine processes data stored in the SQLite databases, enabling advanced analytics and generating insights based on sales, inventory, and operational metrics. This allows Cerebral to assist in decision-making and provide real-time recommendations to users.
Data Synchronization and Replication
Data Visualization
This architecture ensures that Cerebral provides actionable insights, enabling users across different roles to make informed decisions based on accurate and up-to-date data.
Note: For more information, please refer to the dashboards folder.
Follow these steps to set up and use Cerebral in your environment:
Before deploying Cerebral, several prerequisites must be fulfilled to ensure a successful installation and operation. The system is designed to run on both virtual machines and physical servers that can handle edge computing tasks effectively.
Linux-Based System: Cerebral requires a Linux-based system, specifically a VM or physical machine running Linux Ubuntu 22.04. This system will perform as an edge server, handling queries directly from the production line and interfacing with other operational systems.
Resource Specifications:
To ensure smooth communication and operation of the Cerebral, specific network configurations are necessary. These configurations cater to the infrastructure's hybrid nature, leveraging both Azure services and on-premises components.
Cerebral utilizes Azure Arc-enabled Kubernetes to extend Azure management capabilities to Kubernetes clusters anywhere. This integration allows for the management of Kubernetes clusters across on-premises, edge, and multi-cloud environments through Azure's control plane.
The control plane of Cerebral, managed through Azure Arc, requires network configurations that adhere to Azure Arc's networking requirements. It's crucial to ensure that all necessary ports and endpoints are accessible to facilitate command and control operations seamlessly.
For the data plane, which handles the direct processing and movement of operational data:
git clone https://github.com/Azure/jumpstart-cerebral
cd jumpstart-cerebral/infrastructure/bicep
nano main.bicepparam
az group create -n Cerebral -l eastus2
az deployment group create -g Cerebral -f main.bicep -p main.bicepparam
kubectl apply -f https://raw.githubusercontent.com/Azure/jumpstart-cerebral/refs/heads/main/deployment/cerebral-ns.yaml
sudo mkdir /var/lib/influxdb2
sudo chmod 777 /var/lib/influxdb2
kubectl apply -f https://raw.githubusercontent.com/Azure/jumpstart-cerebral/refs/heads/main/deployment/influxdb.yaml
kubectl apply -f https://raw.githubusercontent.com/Azure/jumpstart-cerebral/refs/heads/main/deployment/influxdb-setup.yaml
kubectl apply -f https://raw.githubusercontent.com/Azure/jumpstart-cerebral/refs/heads/main/deployment/cerebral-simulator.yaml
kubectl apply -f https://raw.githubusercontent.com/Azure/jumpstart-cerebral/refs/heads/main/deployment/mssql.yaml
kubectl apply -f https://raw.githubusercontent.com/Azure/jumpstart-cerebral/refs/heads/main/deployment/mssql-setup.yaml
kubectl get all -n cerebral
Use a web browser to connect to the Server IP of the InfluxDB service to access its interface, for example http://<IP_Server>:8086
Validate that there is a bucket named manufacturing
and that it contains a measurement called assemblyline
with values.
To access to Grafana use the admin
and the password of ArcPassword123!!
kubectl apply -f https://raw.githubusercontent.com/Azure/jumpstart-cerebral/refs/heads/main/deployment/redis.yaml
Create an Azure OpenAI service in your subscription and obtain the key and endpoint for use in the application configuration.
Download the Cerebral application deployment file:
wget https://raw.githubusercontent.com/Azure/jumpstart-cerebral/refs/heads/main/deployment/cerebral-api.yaml
nano cerebral-api.yaml
kubectl apply -f cerebral-api.yaml
Ensure that all components are functioning correctly by checking the pods and services.
At this point in the setup, "Cerebral" is fully operational using only Azure Open AI for processing queries. Here are the steps to test the functionality of the system:
Open your web browser and navigate to the web address of your server appended with port 5003. For example, if you are running the server locally, you would go to:
http://localhost:5003
Cloud-Based LLM Deployment: This setup requires minimal resources at the Edge and leverages Azure's robust cloud capabilities for processing and data handling, suitable for scenarios with adequate network connectivity and less stringent data locality requirements.
On-premises SLM Deployment: This approach is ideal for environments where the integration with on-premises data is required and is requires to have the SLM at the edge. It demands more substantial resources but provides enhanced control over data and processes.
The Cerebral solution is built to be adaptive, efficient, and scalable, making it an indispensable tool across multiple industries. By leveraging the power of Generative AI, real-time data processing, and seamless integration with cloud and edge services, Cerebral offers a robust platform for enhancing operational workflows and decision-making processes.