SynExisAI is a full-stack, containerized platform for real-time factory machine monitoring and analytics. It collects machine data via MQTT, stores it in a time-series database, and provides a modern web interface for visualization and AI-powered data queries.
The primary goal of this project is to empower users to interact with their industrial operating environments using natural language queries. This enables users in industries such as manufacturing, oil & gas, or data centers to ask questions like:
- "What's the stock level of product A in store B?"
- "What's my OEE for factory C over the past 4 months?"
- "What's the current temperature of machine B on line 2?"
- "What line has the capacity to run this new production order?"
- "What's the status to complete on production order 256?"
To achieve this, the platform contextualizes and organizes real-time operational data (following ISA 95 naming conventions and Unified Namespace best practices) and connects it to a Large Language Model (LLM) using the Model Context Protocol (MCP). This allows users to gain actionable insights from live data through simple, conversational queries.
Benthos plays a key role in this architecture by enabling advanced, real-time data processing—such as running complex calculations (e.g., OEE) or transforming data streams—before the data is made available for natural language querying.
The system consists of five main components:
- MQTT Broker (Mosquitto): Receives real-time machine data from factory devices.
- Benthos Stream Processor: Subscribes to MQTT topics, performs real-time calculations (like OEE), and outputs processed data to the database and/or backend API.
- Backend API (FastAPI):
- Subscribes to MQTT topics, ingests and processes messages (optionally from Benthos).
- Stores data in TimescaleDB (a time-series extension of PostgreSQL).
- Exposes REST endpoints for the frontend.
- Integrates with OpenAI GPT for natural language data queries.
- Database (TimescaleDB): Stores all machine status, metrics, production, and order progress data.
- Frontend (React + Chakra UI):
- Visualizes machine data in real time.
- Allows users to ask questions about the data using natural language.
+-------------------+ MQTT +-------------------+ Stream +-------------------+ SQL +-------------------+
| | <-------------- | | <---------------> | | <-------------> | |
| Factory Devices | (machine data) | Mosquitto MQTT | (processed | Benthos | (data ingest) | TimescaleDB |
| | --------------> | Broker | events) | Stream Proc. | --------------> | (Postgres) |
+-------------------+ +-------------------+ +-------------------+ +-------------------+
|
| (optional HTTP)
v
+-------------------+
| |
| FastAPI App |
| (Python) |
+-------------------+
|
v
+-------------------+
| |
| React Frontend |
| (Chakra UI) |
+-------------------+
- Receives real-time messages from factory equipment.
- Publishes messages to topics that the backend and Benthos subscribe to.
- Configured via
mosquitto/config/mosquitto.conf.
- Subscribes to MQTT topics.
- Performs real-time calculations and data transformations (e.g., OEE, aggregations, or other advanced analytics) to contextualize and enrich operational data.
- Outputs processed data to the database and/or backend API, making it available for natural language queries via the LLM.
- Configured via a YAML file.
- Located in the
app/directory. - Subscribes to MQTT topics, parses messages, and writes to TimescaleDB.
- Exposes REST endpoints for the frontend (e.g.,
/machine_status,/machine_metrics,/ask). - Integrates with OpenAI GPT for natural language queries.
- Main entrypoint:
app/main.py.
- Stores all time-series data for machines, production, and orders.
- Runs as a Docker service, data persisted in a Docker volume.
- Located in the
frontend/directory. - Modern, responsive UI for data visualization and AI-powered queries.
- Main entrypoint:
frontend/src/App.js.
- Factory devices send real-time data to the Mosquitto MQTT broker.
- Benthos subscribes to MQTT topics, processes data, and outputs results to the TimescaleDB and/or FastAPI backend.
- The FastAPI backend can also subscribe to MQTT topics, process incoming messages, and store them in TimescaleDB.
- The React frontend fetches data from the backend via REST endpoints and displays it to users.
- Users can ask questions in natural language; the backend uses OpenAI GPT to generate SQL queries and return results.
- "Show me the status of all machines in Area 1."
- "What was the average temperature for Line 2 last week?"
- "How many bad products were produced today?"
MIT
git clone [email protected]:yourusername/MQTTtoMCP.git
cd MQTTtoMCPcd app
pip install -r requirements.txtIf using Docker:
docker-compose up -d mosquittopython simulate_factory.pypython main.pycd ../frontend
npm install
npm start- The backend ingests and processes factory data.
- The frontend displays metrics and allows for queries.
- (Planned) Benthos can be added for advanced real-time calculations.
- Fork the repo and create your branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin feature/your-feature - Open a pull request
- MQTT connection issues: Ensure Mosquitto is running and accessible.
- Database errors: Check your database service and credentials.
- Frontend not loading: Make sure you've run
npm installandnpm startin thefrontend/directory.
This project is a work in progress. Contributions and suggestions are welcome!
This project now supports a robust, multi-UNS (Unified Namespace) management system. You can manage multiple namespaces, add/remove elements at any level, and safely collaborate with others. All changes are reflected in both the backend (FastAPI) and the frontend UI.
- List all UNSs
GET /api/unified_namespaces
- Create a new UNS
POST /api/unified_namespaces(body:{ "name": "my_uns", "data": {} })
- Get a specific UNS
GET /api/unified_namespace/{name}
- Add element to a UNS
POST /api/unified_namespace/{name}/add(body:{ "path": ["Enterprise", "Site"], "key": "Area", "value": {} })
- Remove element from a UNS
POST /api/unified_namespace/{name}/remove(body:{ "path": ["Enterprise", "Site", "Area"] })
- Update/replace a UNS
PUT /api/unified_namespace/{name}(body: full JSON structure)
- UNS Selector: Use the dropdown at the top to select which namespace to view or edit.
- Create New UNS: Enter a name and click "Create" to start a new namespace.
- Add/Remove Elements: Use the + icon to add, and the trash icon to remove, at any level. When adding, an inline input appears for the new name.
- All changes are saved to the backend and reflected in the UI.
- You can manage multiple namespaces (e.g., for different enterprises, projects, or environments).
- Each UNS is stored as a separate JSON file in
app/unified_namespaces/. - Switch between namespaces using the selector; changes are isolated to the selected UNS.
{
"Demo Enterprise Inc.": {
"Alberta Subsidiary": {
"Assembly Plant": {
"Cell Tower Assembly": {
"CNC Welding": {
"CNCWelderR25": {}
}
}
}
}
}
}- If you see errors about missing endpoints, ensure your FastAPI backend is running and up to date.
- If the UI does not update after changes, try refreshing the page.
- For CORS or network errors, check your backend and frontend server addresses/ports.
- If you see extra "+" icons, update to the latest code (see NamespaceLevel logic).
- Existing
unified_namespace.jsonfiles should be moved toapp/unified_namespaces/and renamed (e.g.,demo_enterprise.json). - The new system supports multiple namespaces; you can create as many as needed from the UI.
For more details, see the project file: app/UNS_management_project.md

