FactorySemantics MES Open the plant
Manufacturing execution, agent-native

The MES that never invents production.

FactorySemantics MES is a modular manufacturing execution system built to be operated by people and by AI agents, and to be honest about every number it shows. Counters book production; a reset books nothing. OEE reports unknown, never a comforting zero.

One simulated plant is serving now: a measured hour of sixty million ids a day. Early access; no real plant has run this yet.

Disposable cutlery · FORK1 line · one hour, recorded sim time 30:12
1,100 4,000 3 2 118 Mould Degate Vision Stacker Wrapper Palletiser FORK1_Mold FORK1_Degate FORK1_Mark · 4 attributes STACK01 WRAP01 · starved PAL1 one OPC group per piece: serial, four readings, a pass word
FORK1_Moldrunning134,926
FORK1_Degaterunning133,823
FORK1_Markrunning131,252
STACK01running12,568
WRAP01starved25,012
PAL1running437
Inspection groups recorded100%of 1,981,758
Breakdowns detected15of 15 scripted
Pallet certificate40 mswith Cpk
One plant, measured, serving

Sign in and look around the cutlery plant.

A disposable-cutlery manufacturer makes ten million forks, ten million spoons and ten million knives a day. Every piece, stack, plate and wrap carries its own id — sixty million a day — and a vision station judges every piece and every stack on four attributes. What is serving is one measured hour of that plant, as the MES recorded it: 2.37 million units, 1,621 pallets, every inspection, every certificate. Nothing simulates on the demo; the record is the demo. The account can see everything and change nothing.

demo.factorysemantics.com

Where to look

  • Trace: pick a pallet and open it — 240 wraps, in each a stack and a plate, in each stack a fork, a spoon and a knife, each judged by its station. Where-used and quarantine walk the same tree.
  • Certificates: a pallet's certificate of analysis — Cpk on fifteen characteristics from the fifteen-minute dimensional checks, the automated inspections, and the listing of everything on it — issued immutable.
  • SPC and Quality: the checks the floor recorded through the same API a browser uses, with capability withheld until there are twelve points.
  • Floor and Machines: 83 stations, their states and bookings, the breakdowns the script put in and the MES saw.

What it measured

  • Every id an observed event: 1,981,758 inspection groups published by the stations in the real-time hour, 1,981,758 recorded, no sequence gap, none partial.
  • At the real rate the plant costs one desktop 23% of a core on the OPC agent and 5% on PostgreSQL; breakdowns seen 15 of 15.
  • Where it bends: one agent process is exact to three times the rate and bends at five; the fit puts its ceiling at 3,490 groups a second, six times the customer's.
  • Every figure with the run that produced it, in a notebook that re-derives the page from the kept databases.

Sign in with user DEMO and password look-around. The account is a viewer: every write returns 403, and the audit trail stays true.

The difference

Three commitments most MES products do not make.

Plants that cannot afford a six-figure MES implementation stitch together Node-RED, Grafana and spreadsheets, and every one of those tools will happily show a number that is not true. This one is built around not doing that.

Honest numbers

Production is booked from counter deltas, so a PLC counter that snaps to zero after a power blip re-baselines and books nothing. Unlabelled downtime is reported as unlabelled. Every screen states where its data came from, and a value that cannot be known renders as unknown rather than 0.

The product scores itself. A scripted line with known faults is replayed and the MES is graded on whether it told the truth: breakdowns detected, planned stops kept out of downtime, and how many seconds late each fault was seen.

fsmes score bottling → breakdown recall 100%, misbooked planned stops 0

Agent-native by mechanism

Every capability is an API and an agent tool first, a screen second. A test in the suite fails the build when a route ships without a screen, and another fails it when a write route ships without an agent tool or a written reason. Agent-first is not a policy here; it is a red test.

Agents act on behalf of a named person, every command tool takes a dry run, and repeated commands carry an idempotency key so a retried request cannot create a second order.

80+ tools across orders, quality, maintenance, scheduling, trace, triggers, adjustments, certificates

Runs on your hardware

SQLite on a laptop, PostgreSQL in a plant, the same models either way. Each plant is a separate process with its own database, port and secret key: there is no multi-tenant code path to get wrong, so one plant cannot read another's data by construction.

The operator screens are plain HTML and JavaScript with no build step and no font, script or call fetched from outside the box, because a plant PC must render them for years without a toolchain.

OPC UA in, ERP out: REST, file (B2MML-flavoured), ERPNext
How far it goes

Measured on sixty million ids a day, eleven times over.

One simulated plant was built to find the edges, and the numbers below are its. It ran on one desktop machine, the OPC agent one process, PostgreSQL a user service beside it, one database per run; every speed was run at least twice. No real plant has run this yet; a simulated one that reports honestly is how the edges are found before one does. The full report has the sixteen figures and the run behind each.

At the real rate, every id observed

Nine moulding lines at 2,315 pieces a minute, 32 stackers, 16 wrappers, four palletizers: 83 stations. Nothing is minted from a count. A station publishes one OPC UA group per unit — the serial, four vision readings, a pass word, the members — and the agent writes the unit, its inspection and its containment straight into the database. A piece that fails never reaches a stack.

In the real-time hour the stations published 1,981,758 groups and the agent recorded 1,981,758: no sequence gap, none partial, no stack naming a piece it had not seen. Three runs, the same answer.

agent at 23% of a core · PostgreSQL at 5% · 1.25 GB an hour · breakdowns 15 of 15

Where it bends, in order

At three times the rate the record is still exact at 56% of a core. At five times every inspection group is still recorded, but the counters and state words lag their half-second sample by two seconds, so the breakdown verdict is withheld: one agent process bends there. The fit through the runs that kept up gives it a ceiling of 3,490 groups a second, six times the customer's rate.

Past that the Python replay standing in for the plant is itself at its limit, about eight times real time, and the report says so rather than scoring what it could not produce. The next step is a second agent process over a partition of the stations, not a bigger box.

exact to 3× · bends at 5× · one process's ceiling ≈ 6× · the replay's own limit ≈ 8×

A certificate and a recall

Every fifteen minutes an inspector records five characteristics per utensil. A pallet's certificate of analysis states, per characteristic, the checks on record up to its close, the Cpk over them, and no capability outright when there are fewer than twelve. Under it, every wrap, stack, plate and piece, rendered from the containment record and issued immutable.

Against an hour's database: a pallet's 1,440 units in 9 ms, its certificate's data in 40 ms, a cascading quarantine in 30 to 60 ms, and where a resin lot went — 131,584 pieces in 3,671 packages, a third of everything made — in 1.5 seconds. The last is the one that grows with the plant.

pallet contents 9 ms · certificate 40 ms · lot recall 1.5 s over 131,584 pieces

The limits are stated with the numbers. This plant writes 30 GB a day, which is why storage is a module: the same models run on one SQLite file for a small plant and on PostgreSQL when a plant like this one switches it on. Before it, a 108-station plant a day old found the Floor summary at 58 seconds and left it at 1.3; that measurement is kept too. The stations' readings are drawn around a nominal; a real station's distribution has the shape the process gives it, and the method does not depend on the shape.

How AI is used

Deterministic first, model second, human approval always.

An AI agent in this system is an operator with a badge. It reads through the same API as a browser, proposes rather than acts, and everything it does is recorded under its own name and the name of the person it worked for. Nothing in the control path depends on a model being right.

TRIGGERS

Conditions are data, not code

A trigger is a row: a tag, a condition, a sustain time, a cooldown, and an action from a fixed catalogue such as opening a non-conformance or raising a maintenance order. An agent may draft one; a person approves it before it evaluates a single reading.

RECOMMENDATIONS

The agent proposes, an engineer approves, the PLC follows

A write to a setpoint passes three independent guards: the tag map must declare it writable, the value must sit inside declared bounds, and a human must approve it on screen. After the write, the process value is checked and the verdict is recorded.

EVALS

Agents are graded against known truth

The simulator scripts a fault and the eval asks a question with a known answer. The agent answers through the tools alone and is scored strictly: naming the symptom alongside the cause fails. Agent usability becomes a trend, the way honesty already is.

One loop, end to end, on the bottling plant that ran here

The washer drifts three degrees hot. Scrap climbs at the washer and, with no alarm of its own, the filler downstream starts short-filling by nine grams. Fill-weight checks fail.

An agent, asked which machine caused the failures, reads the alarm history and the tag trends and answers WASH01, not the filler where the checks were taken.

It proposes lowering the wash temperature setpoint from 71 to 68 with the evidence attached. An engineer approves on screen. Six seconds later the agent writes 68.0 to the simulated PLC. Four and a half minutes later the verification runs, and the receipt on the right is what it recorded.

Recorded verification, adjustment ADJ-00001, tag WASH01.WashTempSP
{
  "proposed_by": "AGENT on behalf of scott",
  "approved_by": "ADMIN",
  "written_after_approval_s": 6,
  "setpoint": 68.0,
  "pv_before": 71.6,
  "pv_after": 67.6,
  "followed": true
}
Eval: "Which machine caused the failed fill-weight checks?" → answer WASH01, pass. The filler was a distractor.
Floor assistantRoutes a question, quotes the approved procedure, points at the right guide. Runs on a local model; falls back to plain text matching when the model is down.
Instruction draftingDrafts work instructions from facts the plant already holds. Every draft arrives unapproved and stays that way until a supervisor signs it.
Nightly narrationOne note a day. The model is handed computed numbers and asked only what changed; it never computes a number itself.
No cloud requiredThe local model runs on an ordinary GPU on the same box. A hosted model is optional, and the control path never depends on either.
Security and data

Built for the questions an IT lead will ask first.

Where does the data live, who can change it, and what happens when an agent is wrong. The answers are in the design, not in a policy document.

Where data livesOn your hardware. One database per plant, SQLite or PostgreSQL, in a directory you choose. Nothing leaves the box unless you configure an ERP adapter or a tunnel. The operator screens fetch nothing from the internet.
Identity and rolesA role ladder of viewer, operator, supervisor, admin, plus an agent role that can propose and draft but never approve, never manage users, and never edit master data. The list of tools an agent sees is filtered by what its account may do.
Agent identityAn agent token never earns a role by itself. Every agent action records the person it acted on behalf of, and lands in the same audit trail as a human action, under both names.
Audit trailAppend-only, with before and after values on every change. It is the same spine the honesty scoring reads, so the evidence the product is judged on is the evidence you keep.
SessionsSigned tokens in an HttpOnly cookie, with a secret key per plant, so no plant accepts another plant's session. Passwords are hashed with PBKDF2 from the standard library.
IsolationPlants are separate processes with separate databases and separate machine connections. There is no tenant column to forget in a query.
Writes to machinesOnly tags the tag map declares writable, only inside declared bounds, only after a human approval on screen. Every write is verified afterwards and the result recorded, followed or not.
IdempotencyCommand tools carry a client reference; a retried request returns the original result instead of creating a second order, lot or check.
RetentionRaw tag samples are evidence and are pruned on a stated schedule; bookings, states, checks and the audit trail are kept. The policy is shown on the Ops screen so a trend that ends at the window's edge reads as pruned, not as a silent machine.
StandardsISA-95 names for the data model, PackML for machine states, ISO 22400 for KPIs, and B2MML only at the ERP border. Never a word the industry already has a word for.
Run it yourself

From a laptop to a line in five steps.

The same commands run a five-person shop and a plant with a fleet of machines. Each step below is what a plant engineer does, in the order they do it.

1

Install

Python 3.12 or newer on Windows or Linux. No database server, no build tools, no container required to start. The package is on PyPI; the source is on GitHub under Apache-2.0.

pipx install factorysemantics-mes
fsmes info
fsmes demo                     # one order, one simulated line, honest booking, done
2

Run a plant

A plant is an entry in a registry file: its database, its dashboard port, its machine endpoint, its tag map. Adding a plant is never a code change. The two demo plants ship as examples.

fsmes plant bottling init
fsmes plant bottling run      # API, OPC UA agent, simulator, shop-floor activity
3

Describe your machines

A tag map names each machine's OPC UA tags and what they mean: the state word and how it maps to running, down and planned stop; the counters that book production; the process values; the setpoints that may be written and their bounds. Point it at Kepware, an OPC UA server, or the built-in simulator.

4

Connect the ERP

Orders in, confirmations out, per operation, with cost center and component consumption. Adapters for REST, a file drop, and ERPNext. Messages that fail are retried with backoff, then parked where a person can see and retry them.

5

Give an agent the tools

One MCP server per site exposes the plant to any agent that speaks the protocol. Reads are free; writes take a dry run and an approval. What the agent can do is exactly what its account may do.

python -m fsmes.mcp_server     # 85 tools: orders, quality, maintenance, trace, triggers, adjustments ...
fsmes agent-eval bottling      # grade an agent against the plant's known truths
Three ways in

Free to run. Here is how to start with yours.

The software is Apache-2.0 and stays that way. What is on offer here costs nothing either: a sizing estimate from measured runs, a simulated plant shaped like yours, and a place to ask.

Plant engineer · plant manager

Size your plant, then have it simulated

Enter your stations, rate and ids a day and read what it costs in disk and CPU, scaled from the measured runs. Then ask for a scripted plant shaped like yours, run here and scored, with the report sent back.

Size your plant
Controls · IT · the person who owns the database

Integrate it and keep the data yours

The tag map for your OPC UA server or Kepware, the ERP adapter you need, and SQLite or PostgreSQL with backup, migration and retention spelled out. Every path ends in a docs page or a discussion.

Read the integration paths
Integrator · ERP partner · agent builder

Build on it, be listed

Integrators are how an MES reaches a plant. One merged plant pack or driver lists you, alphabetical, no fee, no tiers. ERPNext partners and agent builders have their own doors.

Partner with the project
Open source

Apache-2.0, in public, with the reasons written down.

The whole product is one repository: the kernel, every module, the connectors, the operator screens, the MCP servers, the simulator and the scoring harness that grades the MES against its own plant. No enterprise edition, no feature behind a licence key.

Sourcegithub.com/factorysemantics/factorysemantics-mes — Apache-2.0, contributions under the Developer Certificate of Origin. Pull requests are squash-merged so every line of the changelog is one change with one author.
Documentationdocs.factorysemantics.com — a book each for the plant, the operator, the developer and the agent. The CLI, API, settings and tool references are generated from the code at build time so they cannot drift.
Installpipx install factorysemantics-mes, or the container image ghcr.io/factorysemantics/fsmes, signed and shipped with a software bill of materials.
TalkGitHub Discussions for questions and ideas; issues for bugs, with forms that ask whether your plant is simulated or real. No chat server: questions should be findable a year later.
GovernanceOne maintainer today, decisions proposed in public and recorded as decision records with the options that lost. The governance file says what happens if the maintainer stops. It is one page.
ConnectorsERPNext ships as a module inside the package and needs nothing installed on the ERPNext side. SAP and Oracle are the next modules and do not exist yet; the typed contract they will implement does.
What is not claimedNo real plant has run this. Every number on this site is from a simulated plant and says so. The roadmap names the risks by name.