# SmartMOM **Repository Path**: honeymeta/SmartMOM ## Basic Information - **Project Name**: SmartMOM - **Description**: 蜂元智能 MOM(SmartMOM):开源 MES 制造执行系统 / MOM 制造运营管理,覆盖生产、质量、设备、仓库,内置 ERP 和 AI 助手,支持私有化部署。AGPL-3.0。 - **Primary Language**: Unknown - **License**: AGPL-3.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2026-12-04 - **Last Updated**: 2026-12-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
SmartMOM: open-source MOM / MES for discrete manufacturing

Open-source MOM / MES for discrete manufacturing

Python + Vue 3 · SQLite or PostgreSQL · self-hosted · AGPL-3.0

[![Stars](https://img.shields.io/github/stars/HoneyMeta/SmartMOM?style=flat-square&logo=github&color=yellow)](https://github.com/HoneyMeta/SmartMOM/stargazers) [![Release](https://img.shields.io/github/v/release/HoneyMeta/SmartMOM?style=flat-square&color=blue)](https://github.com/HoneyMeta/SmartMOM/releases) [![CI](https://img.shields.io/github/actions/workflow/status/HoneyMeta/SmartMOM/ci.yml?branch=main&style=flat-square&label=CI)](https://github.com/HoneyMeta/SmartMOM/actions/workflows/ci.yml) [![Docker](https://img.shields.io/badge/image-ghcr.io%2Fhoneymeta%2Fsmartmom-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/HoneyMeta/SmartMOM/pkgs/container/smartmom) [![Python](https://img.shields.io/badge/python-3.12-3776AB?style=flat-square&logo=python&logoColor=white)](requirements.txt) [![Vue](https://img.shields.io/badge/vue-3-42B883?style=flat-square&logo=vuedotjs&logoColor=white)](web/package.json) [![License](https://img.shields.io/github/license/HoneyMeta/SmartMOM?style=flat-square)](LICENSE) [![Last commit](https://img.shields.io/github/last-commit/HoneyMeta/SmartMOM?style=flat-square)](https://github.com/HoneyMeta/SmartMOM/commits) [简体中文](README.md) · **English** [Online demo](https://www.honeymeta.com/smartmom/trial/) · [Quick start](#quick-start) · [Screenshots](#screenshots) · [Features](#features) · [Architecture](#architecture) · [Docs](docs/getting-started.md) · [SimFactory](https://github.com/HoneyMeta/SimFactory) Commercial edition: online trial, quote and contact (site in Chinese)
> **Latest release: [v1.1.1](https://github.com/HoneyMeta/SmartMOM/releases/tag/v1.1.1)** (2026-12-04): two security > fixes. The agent HTTP node now refuses loopback, link-local and similar addresses, and reaches private-network > addresses only if an administrator has allowed the host or network in the system parameter `agent_http_allow`; if > your agents call internal services, add them there after upgrading. A report export can be downloaded only by the > people it was made for: a manual export by whoever made it, a scheduled report by recipients grouped by roles and data > scope, each group getting its own copy. The workbench is also plainer, and on phones the top bar no longer overflows > and page titles no longer wrap one character per line. One migration (`v0883`) runs at start-up. > See [CHANGELOG.md](CHANGELOG.md). > > SmartMOM (Chinese name 蜂元智能 MOM) was formerly HoneyMOM; only the name changed. SmartMOM is an open-source MOM / MES for discrete manufacturing plants, built first for foundries, machine shops and plants that do both. The backend is Python (FastAPI, SQLAlchemy) on SQLite or PostgreSQL, the web UI is Vue 3, and it runs on the plant's own servers.

SmartMOM architecture

## Highlights - Covers the four ISA-95 Level 3 areas (production, quality, maintenance and inventory operations) and includes an ERP for sales, purchasing, MRP and costing. A plant that already has an ERP runs SmartMOM in external-ERP mode and connects the two over REST, signed webhooks and a staging database. - Collects machine data itself over MQTT (unified namespace), Sparkplug B, OPC UA and Modbus TCP, plus HTTP push and SQL staging tables. OEE is computed from machine states and part events; nobody types it in. - Goes into detail where foundries and machine shops need it: heat records, least-cost charge optimization, NC program approval and release, tool life. A defect that only shows up in machining can be traced back to the heat, the ladle and the pouring temperature. - Comes with a recorded 24-hour day of a demo foundry. After `docker compose up` the replayer plays it back over MQTT, OPC UA and Modbus, so you can try everything without a plant. Add `--profile factory` to swap the recording for [SimFactory](https://github.com/HoneyMeta/SimFactory), a live simulation where you can change the speed and inject faults. - The AI assistant answers from read-only queries within the user's permissions and data scope, and any write is drafted first and executed only after the user confirms. Agent flows can include human approval steps, and external AI tools query plant data through an MCP endpoint. Any OpenAI-compatible model works, self-hosted ones included. ## Quick start > Want to look around first? [Request an online trial](https://www.honeymeta.com/smartmom/trial/) (page in Chinese); we open a trial account after review. The online demo runs the commercial edition, which has more industry packs than this repository (die casting, automotive parts, SMT); the plant data is fictional. ### Docker (demo) Requires Docker with Compose v2. ```bash git clone https://github.com/HoneyMeta/SmartMOM.git cd SmartMOM docker compose up ``` The first run builds the image, which takes a few minutes. Then open http://localhost:8900 and log in as `admin` with password `honey123`. Other demo accounts: `manager`, `planner`, `leader`, `operator`, `qc`, `maint`, `wh`, `engineer` (same password). The cockpit, plant map and OEE fill within about a minute as the replayer sends data. `docker compose up` starts three containers: `mom` (SmartMOM and the web UI), `db` (PostgreSQL 17) and `replayer`. ### Docker with the live plant simulator (SimFactory) The replayer plays back a recorded day of the demo plant. [SimFactory](https://github.com/HoneyMeta/SimFactory) simulates the same plant live: you can change the speed, inject faults or stop machines and watch SmartMOM react. To use it as the data source: ```bash docker compose --profile factory up ``` This adds a `simfactory` container (image `ghcr.io/honeymeta/simfactory:latest`, demo mode) with its web UI on http://localhost:8800 (`admin` / `honey123`). The replayer then plays nothing and relays the demo ports (MQTT 1883, OPC UA 4840, Modbus TCP 5020, web 8800) to SimFactory, so SmartMOM's demo data sources need no change. Start without `--profile factory` to go back to the recording. Requires Docker Compose 2.20 or later. To build SimFactory from a checkout next to this one instead of pulling the image: ```bash git clone https://github.com/HoneyMeta/SimFactory.git ../SimFactory docker compose -f docker-compose.yml -f docker/compose.factory-build.yml --profile factory up --build ``` Other plants, and SimFactory on another machine: see [docs/getting-started.md](docs/getting-started.md#with-the-live-plant-simulator-simfactory). For production (no demo data, the first start asks you to create the administrator): ```bash cp docker/env.example .env # set POSTGRES_PASSWORD, TZ, ... docker compose -f docker-compose.yml -f docker/compose.production.yml up -d ``` See [docs/deployment.md](docs/deployment.md) for production, backups and upgrades. ### Manual setup (development) Requires Python 3.12 and Node.js 20 or later. ```bash python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -r requirements.txt -r replayer/requirements.txt cd web && npm ci && npm run build && cd .. # terminal 1: plant data python -m replayer # terminal 2: SmartMOM in demo mode, SQLite database in data/mes.db MOM_DEMO=1 python -m smartmom serve # Windows: set MOM_DEMO=1 && python -m smartmom serve ``` Instead of the replayer you can run [SimFactory](https://github.com/HoneyMeta/SimFactory) in demo mode on the same machine: it serves the same demo plant on the same ports (MQTT 1883, OPC UA 4840, Modbus TCP 5020). Open http://localhost:8900. Without `MOM_DEMO=1` you get a production install: no accounts and no demo data; create the administrator in the browser or with `python -m smartmom create-admin --username admin`. For front-end work, run `npm run dev` in `web/` (Vite on port 5190, `/api` is proxied to port 8900). More in [docs/getting-started.md](docs/getting-started.md). ## Screenshots Demo plant "Northfield Castings" fed by the replayer. | | | |---|---| | ![Home: production cockpit with live plant map](docs/images/home.webp) | ![Scheduling and dispatch](docs/images/scheduling.webp) | | Home: KPIs per operations area, live plant map, alerts | Finite-capacity scheduling with constraint markers | | ![Live equipment monitor](docs/images/equipment-monitor.webp) | ![OEE by machine](docs/images/oee.webp) | | Live monitor of all machines | OEE by machine | | ![Quality overview](docs/images/quality.webp) | ![Connectivity: delivery package import](docs/images/connectivity.webp) | | Quality overview: defect Pareto, NCR disposition | Connectivity: import a delivery package, check tags | ## Features Grouped by the ISA-95 (IEC 62264) activity areas. The left-hand menu of the web UI follows the same grouping. ### Production operations - Master data: plants, workshops, lines, workstations, materials, BOMs, routings, shifts and teams. - Work orders, finite-capacity scheduling by priority and due date with constraint markers (material shortage, equipment downtime, operator skills, molds and fixtures, changeover times), what-if schedule change proposals, dispatching. - Production reporting from the desktop, a workstation terminal (`/station`) and a mobile PWA (`/m`, barcode scanning). Reporting gates reject duplicate, over-quantity and out-of-sequence reports, require first-article release, and block reports on held lots. - Serialized parts and lots, traceability from part to process data and back, traceability reconciliation. - Andon, clock-in/out, labor hours, operator daily reports with approval, production daily report. - Cycle-time analysis down to individual machine actions (for example clamp, spindle, door), with baselines and drift. - Foundry: heat records (chemistry, temperature, power), nodularization records, least-cost charge optimization (linear programming). - Machining: NC program approval and release, tool register and tool life, tool-wear estimation from spindle load. - Casting–machining: defects found in machining traced back to heat, ladle, pouring temperature, residual magnesium and sand parameters (chi-square test), coordinated scheduling of both sections. - Labels (ZPL, TSPL, SVG, PDF) and laser marking, packing, palletizing, shipping notices (JSON, Excel, flat file, EDIFACT), subcontracting. ### Quality operations - Inspection templates; incoming, in-process, first-article and final inspection. - Nonconformance reports with disposition, rework and re-inspection, 8D reports, SPC and process capability. - PFMEA with action priority (AIAG-VDA 2019) → control plan → inspection templates. - Gauges and calibration with release by electronic signature; MSA (GR&R by average-and-range and ANOVA, bias, linearity). - Controlled documents and engineering change notices (ECN) with impact analysis and electronic signatures. - Customer complaints, containment of affected stock, recall simulation. ### Maintenance operations - Equipment register and live monitor, alarms, OEE (computed from machine states and part events). - Inspection and preventive maintenance plans, repair orders, spare parts linked to repairs, energy per hour. ### Inventory operations - Stock, receipts and issues, stocktaking, lot hold and release, material requests and kitting, AGV transport tasks. ### Planning and business (built-in ERP) - Sales: price lists, orders with delivery schedules, credit checks, quotations, shipping, returns, statements. - Purchasing: approved suppliers, requisitions, purchase orders, receiving with incoming inspection, supplier ratings. - MRP: multi-level BOM explosion netted against stock, open orders and WIP, lead-time offsetting, pegging to the demand, rough-cut capacity; suggestions released as work orders or purchase orders. - Costing (moving average, actual work-order cost, standard cost roll-up, variances, period close), receivables and payables, accounting vouchers with configurable export formats. - External ERP mode: when another ERP is the system of record, SmartMOM exchanges data through a REST API, signed webhooks with retries and a staging database. ### Equipment connectivity - Data sources: MQTT (unified namespace topics), Sparkplug B, OPC UA (subscribe or poll, address-space browsing), Modbus TCP, HTTP push and SQL staging tables. - Onboarding from a delivery package (point table `points.xlsx`, floor plan `layout.dxf`, 3D models `*.glb`): validate, preview, confirm, then check and confirm tag by tag; commissioning acceptance report. - Time series for every tag (raw values, 1-minute and 1-hour rollups, retention; TimescaleDB when available), store-and-forward when the database is unavailable, 2D/3D plant map with live states. ### AI The AI features are off by default. They start working once an administrator has configured a model and turned on the master switch; see [AI configuration](#ai-configuration). - Assistant panel on every page: questions answered from read-only SQL and business queries under the user's permissions; write actions (repair order, NCR, andon, material request, schedule proposal) only after the user confirms a draft. - Daily report with AI commentary, AI watch over quality, equipment, schedule and material, one-sentence automations, knowledge-base Q&A, AI-assisted onboarding (column mapping, tag meaning, reading PLC programs). - Agents: a visual flow editor with chat, schedule, event and webhook triggers, human approval steps, step-by-step debugging, versions and an action allow-list. - MCP endpoint (`/mcp`) so external AI tools can query plant data with an API key. - Demo mode replays recorded answers without calling a model. ### Platform - Roles with page, button and API permissions plus data scopes (plant, workshop, line); audit log with hash chain; API keys with expiry and IP allow-list. - Versioned database migrations, daily and manual backups with restore drills. - Configuration without code: custom fields, form layouts, approval flows, report designer, industry templates, an Excel import framework and a set-up wizard. - Industry templates for foundry, machining, injection molding and assembly. - English and Simplified Chinese UI and demo data. ## Architecture The diagram at the top of this page shows the layers. - `smartmom/schema*.py`: entity definitions. One definition creates the database table, the generic REST API (`/api/e/`) and the list and form pages in the UI. - `smartmom/services/`, `smartmom/erp/`, `smartmom/factory/`, `smartmom/impl/`, `smartmom/agent/`: business services, built-in ERP, factory model and onboarding, configuration tools, agent engine. - `smartmom/collector.py`, `smartmom/ingest.py`, `smartmom/ts.py`: protocol connectors, mapping of tag values to business records (machine states, alarms, energy, counters, tool life, part events), time series. - `smartmom/migrations/`: versioned migrations, run automatically at start-up. - `web/`: Vue 3 single-page app, built into `web/dist` and served by the backend. - `replayer/`: plays back recordings over the same interfaces a plant offers; see [replayer/README.md](replayer/README.md). - `tests/`: API and in-process checks (`*_check.py`), browser walk-throughs (`*_ui.js`). Business time follows the data clock (timestamps of the collected data), so reports stay correct when a source runs faster than real time. ## Configuration SmartMOM reads environment variables at start-up. The most used ones: | Variable | Default | Meaning | |---|---|---| | `MOM_DEMO` | off | `1`: demo accounts (password `honey123`) and the demo plant. Off: production install. | | `MOM_DEMO_LANG` | `en` | Demo dataset language, `en` or `zh`. Used when the database is first seeded. | | `MOM_LANG` | demo language, else `en` | Default language for requests without a language and for background texts. | | `MOM_DB` | `sqlite:////mes.db` | Database URL, e.g. `postgresql+psycopg://user:password@host:5432/smartmom`. | | `MOM_DATA` | `./data` | Data directory: SQLite database, uploaded files, backups. | | `MOM_BACKUP_DIR` | `/backups` | Where backups are written. | | `MOM_LLM_BASE_URL`, `MOM_LLM_API_KEY`, `MOM_LLM_MODEL` | – | OpenAI-compatible model endpoint for the AI features. | | `MOM_ADMIN_PASSWORD` | – | Password for `python -m smartmom create-admin` without a prompt. | | `MOM_LOGIN_MAX_FAILS`, `MOM_LOGIN_LOCK_MINUTES` | `5`, `15` | Failed sign-ins before a user name is locked, and for how many minutes (`MOM_LOGIN_IP_MAX_FAILS`, default `30`, per client address). `0` turns the lock off. | Variables from earlier versions (`MES_DB`, `HM_DATA`, `MES_LLM_*`, other `MES_*` / `HM_*`) still work; the `MOM_*` name wins when both are set. `python -m smartmom serve` also takes `--http ` (default 8900), `--host` (default `0.0.0.0`) and `--db `. The full list is in [docs/configuration.md](docs/configuration.md). Plant-specific settings (company, shifts, backup time, AI switches, MCP limits) are changed in the UI under **System**. ## AI configuration The AI features use the OpenAI chat-completions API format (`POST /chat/completions`, with tool calling), so they work with hosted services and with self-hosted servers such as vLLM, Ollama or LM Studio that offer an OpenAI-compatible endpoint. 1. Configure the endpoint, either with environment variables ```bash MOM_LLM_BASE_URL=https://api.example.com/v1 MOM_LLM_API_KEY=... MOM_LLM_MODEL=your-model-name ``` or by copying `config/llm.example.json` to `config/llm.local.json` (git-ignored) and filling it in. Environment variables take precedence over the file; the old names `MES_LLM_*` still work. 2. Log in as an administrator, open **System → AI features** and turn on the master switch. On-demand features (the model is called only when someone asks) are then available; background / scheduled features stay off until you turn them on one by one. A daily limit on calls and tokens (default 300 / 400,000) stops AI with a message that says so when it is reached; the page shows today's usage. SmartMOM ships with no model endpoint, model name or key, and the repository stores no keys. Until all three values are configured no model is called: the AI features use their rule-based versions, and demo mode replays recorded answers. Once a model is configured, prompts that contain plant data (query results, page context) are sent to that endpoint. Details: [docs/ai.md](docs/ai.md). ## Roadmap Possible next steps, not commitments. Discussion is welcome in the issues. - more industry templates and device templates - more UI and demo-data languages - a Helm chart for Kubernetes and an official image with TimescaleDB - replaying OPC UA history and alarm events in the replayer - running the browser walk-throughs (Playwright) in CI ## Contributing Bug reports, fixes, translations, device templates and industry templates are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) first. Contributors sign the [CLA](CLA.md) once; the CLA bot asks on your first pull request. Please follow the [code of conduct](CODE_OF_CONDUCT.md) and report security problems privately as described in [SECURITY.md](SECURITY.md). Main repository: https://github.com/HoneyMeta/SmartMOM. Read-only mirror for users in China: https://gitee.com/honeymeta/SmartMOM (synced automatically). ## License Copyright (C) 2026 蜂元科技(郑州)有限责任公司 (HoneyMeta Technology (Zhengzhou) Co., Ltd.) SmartMOM is licensed under the **GNU Affero General Public License v3.0 or later** ([LICENSE](LICENSE)). If you run a modified version for users over a network, the AGPL requires you to offer them its source code. A **commercial license** is available for organisations that want to use SmartMOM without the AGPL obligations, for example in a proprietary product or a hosted service, and it can include support with an SLA. See [COMMERCIAL-LICENSE.md](COMMERCIAL-LICENSE.md) or contact dev@honeymeta.com. The commercial edition's features, industry packs, online trial and quotes are on [its product page](https://www.honeymeta.com/smartmom/) (in Chinese). Third-party components and acknowledgements: [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md).