Taking a factory from 0 to 1
Open an intro to economics textbook from the mid-2000s and you will learn that manufacturing software is a solved problem. The factory was automated back in the 1980s. (See computer-integrated manufacturing for some very ambitious standardization attempts). The machines ran themselves, the hard thinking was done, and the interesting work had moved on.
I grew up in the long shadow of North American industrial might, and like most of my peers, I was pointed toward careers in research and SaaS. Nobody suggested we go build things. And while we were being taught that manufacturing was a legacy industry, financial interests were busy hollowing out the industrial core that had made it look so permanent.
Selected countries' shares of global manufacturing value added
Share of world manufacturing value added, calculated in current US dollars, 1982–2024.
- United States
- China
- Japan
- Germany
Source: U.N. National Accounts Main Aggregates Database, value added by economic activity (manufacturing, ISIC D), at current prices in U.S. dollars. Redrawn from Figure 2 of Congressional Research Service report R42135, U.S. Manufacturing in International Perspective, and extended to 2024. The U.N. does not report China's manufacturing value added separately before 2004.
View the data as a table
| Year | United States | China | Japan | Germany |
|---|---|---|---|---|
| 1982 | 24.2% | – | 11.8% | 7.5% |
| 1983 | 25.5% | – | 12.8% | 7.3% |
| 1984 | 27.9% | – | 13.5% | 6.6% |
| 1985 | 28.1% | – | 14.0% | 6.8% |
| 1986 | 25.2% | – | 17.3% | 8.5% |
| 1987 | 23.9% | – | 18.4% | 9.1% |
| 1988 | 23.5% | – | 19.8% | 8.7% |
| 1989 | 23.8% | – | 19.2% | 8.4% |
| 1990 | 22.8% | – | 18.5% | 9.8% |
| 1991 | 22.0% | – | 20.3% | 9.8% |
| 1992 | 22.1% | – | 20.7% | 10.1% |
| 1993 | 23.4% | – | 22.7% | 9.1% |
| 1994 | 23.7% | – | 22.7% | 8.9% |
| 1995 | 22.7% | – | 22.8% | 9.2% |
| 1996 | 23.4% | – | 20.4% | 8.8% |
| 1997 | 25.0% | – | 19.0% | 8.0% |
| 1998 | 26.8% | – | 17.5% | 8.4% |
| 1999 | 27.2% | – | 18.9% | 8.0% |
| 2000 | 27.6% | – | 19.9% | 7.1% |
| 2001 | 28.0% | – | 17.5% | 7.5% |
| 2002 | 27.6% | – | 16.3% | 7.7% |
| 2003 | 25.7% | – | 16.0% | 8.4% |
| 2004 | 22.2% | 8.6% | 14.3% | 7.8% |
| 2005 | 21.8% | 9.5% | 13.3% | 7.4% |
| 2006 | 21.3% | 10.7% | 11.7% | 7.4% |
| 2007 | 19.5% | 12.3% | 10.6% | 7.5% |
| 2008 | 17.6% | 14.5% | 10.6% | 7.3% |
| 2009 | 18.1% | 17.5% | 10.7% | 6.4% |
| 2010 | 16.9% | 18.4% | 11.2% | 6.3% |
| 2011 | 15.8% | 20.4% | 10.2% | 6.5% |
| 2012 | 16.0% | 22.2% | 10.2% | 6.0% |
| 2013 | 16.2% | 23.7% | 8.1% | 6.1% |
| 2014 | 16.1% | 24.8% | 7.5% | 6.2% |
| 2015 | 17.4% | 26.0% | 7.4% | 5.6% |
| 2016 | 17.1% | 25.5% | 8.2% | 5.8% |
| 2017 | 16.1% | 26.4% | 7.7% | 5.8% |
| 2018 | 16.1% | 27.6% | 7.4% | 5.7% |
| 2019 | 16.4% | 27.5% | 7.5% | 5.5% |
| 2020 | 16.0% | 28.5% | 7.5% | 5.4% |
| 2021 | 15.2% | 30.5% | 6.6% | 5.1% |
| 2022 | 16.6% | 29.5% | 5.2% | 4.7% |
| 2023 | 17.2% | 27.9% | 5.3% | 5.1% |
| 2024 | 17.2% | 28.1% | 4.9% | 5.0% |
So, a generation of software engineers aimed their automation urges elsewhere: distributed systems, social networks, e-commerce, an endless parade of CRUD startups. Then we went home and spent our evenings driving factory-building video games to the top of the Steam charts.
Which is why, in June of 2025, I got very interested in exactly how Base was going to pull off not just designing a new product, but building the factory and the manufacturing line to make it.
One of the best things about Base's culture is that you can grab time with a world-class expert in almost any area the company touches. In this case, that meant our cofounder Justin Lopas (former head of manufacturing at Anduril and self-described manufacturing geek), Andy Ross (former Director of Manufacturing Engineering, Module/Pack at Tesla, who launched 7 battery factories across 3 continents) and Mike Webb (who spent a decade building custom automation, most recently for Tesla's global battery manufacturing). I locked the three of them in a room with me and started asking questions about how this was actually going to work.
This is the story of how we built Base's manufacturing execution system (MES), on the same timeline as our first product and our first factory. On top of that, we set out to do it in eight months, compared to an industry standard of 3+ years.
What a factory's software actually does
Strip away the nerd romance and a factory is a simple machine. Components come in one end, a repeatable sequence of operations happens to them, and finished products come out the other. Those operations happen at stations: physical places equipped to do one particular job. One station installs components. The next fastens them. Another runs an electrical test. A station might be run by a person, by automated equipment, or by some combination of the two. Stringing stations along are production lines, which connect stations together into a route through the building.
Just like a factory, the software can also be divided into three layers. At the top sits enterprise resource planning software, or ERP, which handles the business of the factory: what to buy, what is in stock, and what needs to be built. (ERPs are endlessly complex and critical to any company that makes things. We will not go deep on them here; that is a future post.)
At the bottom sits the machine controls, which locally operate individual pieces of equipment. That is the domain of controls engineering, another future post.
In between sits the manufacturing execution system, or MES. The MES tracks the work performed on each individual unit and connects the manufacturing plan to evidence that the plan was carried out. It does not tell a machine how to move. It knows that the machine ran, on which unit, with what result.
A typical system/network diagram looks something like this:
Don't build an MES
Naturally, plenty of Base veterans were nervous about bringing what looked like a complicated and important piece of software in-house. I argued that building the problem up from first principles was not scary. After a couple of days of discovery, I came back to the factory brain trust with a modest proposal in four parts.
1. Build our own factory software stack:
Some software was going to run this factory no matter what; the only real choice was build versus buy. And Base is operations-obsessed. Manufacturing is the ultimate test of operational excellence, where any downtime means lighting a pile of money on fire and pushing back the company's timeline. We wanted that software in our own hands.
2. Start very simple:
Deploy the MES months ahead of full-speed manufacturing and exercise it on early NPI (new product introduction) builds and B-builds instead, long before anything runs at rate.
3. Start on AWS:
The most controversial point, from a software engineering perspective. But we did not yet have a network engineer for the factory, let alone a server rack. Base is still a startup, and this created a strategic shortcut in order to move quickly.
4. Descope line-side software entirely:
A web UI served from the cloud would be more than enough to run a station. It would let us take full advantage of Base's existing cloud infrastructure without managing any local state on the floor.
With these starting pieces, we would have a data model and process flow that could become the foundation of controls integration and adding line-side edge compute.
Something like this:
The alternatives, however, did not look better up close. Manufacturing had, as I said, been "software-ified" in the 1980s. The companies lining up to sell us an MES were the same companies that had hollowed out America's manufacturing core and stopped investing in R&D around that same time. Bragging about connectors to Active Directory and SAP syncs was not going to cut it. Neither was a 30-year-old codebase we had no access to, maintained by an entirely outsourced software department and technical staff. These solutions were also being quoted in the millions of dollars and would no doubt incur more hidden costs than advertised.
Base's entire thesis is to break the mold of what a standard industrial company is capable of in 2026. That means less Detroit and more Silicon Valley.
The build: execution
So what is the simplest possible MES you could build to get a factory off the ground? Let's walk through ours, starting with the thing it exists to do: define a process, then execute it, over and over, in the physical world.
Both configuration and execution needed to live in one consistent, highly available system. (Backend note: we partition by line.) And the MES had to consume its process configuration from a source of truth that was easy to edit and properly versioned. Since the owner of a process definition is a manufacturing process engineer and not a software engineer tending a Go backend, this mattered more than almost anything else.
The mental model we landed on borrows from programming. A process definition is a program. A demand signal invokes it, which initializes an execution: a running instance of that program, playing out on a real line. Each step in the process is a task.
A process definition is a program; an execution is a running instance of it
We define process configurations in Protobuf and use ProtoJSON to represent them as editable JSON. A manufacturing engineer can update tasks, dependencies and parameter limits directly in that JSON, and the backend loads the result into generated Go types. Each configuration carries a name and a version, and we store it in Postgres as JSONB alongside both.

Since all tasks and params are defined in Protobuf, we effectively have a strongly typed language and runtime in which our processes execute.
Every execution order points at one specific configuration version. Changing a process means publishing a new version, and a content hash stops anyone from overwriting an existing version with different content. Orders already in flight keep running on the definition they started with.
Versioning your programs results in elegant consequences on the factory floor:
- Scan a work-in-progress part and you can walk the data model from that part to its execution to the exact process version it is following.
- Running two versions of a process side by side is trivial: this problem notoriously plagues factories that are less configuration-driven, and generally require entire lines to be shut down at a time while transitioning to new versions - in contrast this functionality emerged naturally from our design.
- The ability to express design changes as flow configurations naturally falls out of this design. Some popular examples from the software world come to mind: A/B testing, canary builds, chaos testing.
- Running two different processes to make two different parts on the same line. Take that far enough and a sufficiently capable line should be able to make entirely different products.

The build: params
Stretch the programming analogy one step further. If a process is a program and an execution is a running instance of it, then tasks are functions and params are their arguments. (Believe me, process engineers do not care about the distinction between a parameter and an argument :p )
A parameter is simply a named data field attached to a task. We use parameters to collect measurements, record operator checks and identify the components being installed. Each one has a type, and the type determines how the MES evaluates its result.
We implemented parameter behavior as a Go interface with a separate implementation for each type. A switch picks the evaluator from the parameter type, while result storage and quality checks stay in the shared execution path. The interface looks like this:
type Evaluatable interface {
// Evaluate a single parameter and return the evaluation result as an updated task param.
// Returns a failure note describing why the parameter failed (empty string if evaluation passed).
// Returns related entities (catalog_id, serial_part_id, lot_id) that the evaluator resolved.
Evaluate(ctx context.Context, tx pgx.Tx, requestParameter *pbfactoryconfig.Parameter) (updatedTaskParam *sqlc.ExecutionsTaskParam, err error)
// Remove the side effects of this specific task parameter.
UndoSideEffect(ctx context.Context, tx pgx.Tx, deps Deps, taskParam *sqlc.ExecutionsTaskParam) (err error)
// Extract the result of the parameter.
ExtractResult(param *pbfactoryconfig.Parameter) (results []*pbparams.ParameterAttribute, attributes []*pbparams.ParameterAttribute, err error)
}Three methods carry the whole design. Evaluate runs inside the current database transaction, so a parameter's result and any genealogy updates it triggers are committed atomically. UndoSideEffect unwinds those database effects when recorded work has to be corrected. ExtractResult returns the stored attributes and results for display.
The MES saves both the submitted value and its evaluation result. Parameters marked critical must have a recorded result before their task can complete, and a failed critical evaluation opens a quality check that also has to be resolved before the task can close.
This interface bought us an enormous amount of flexibility, which mattered because we were building the MES before our factory, line, or process existed. In the early days, simple boolean pass/fail parameters were all we needed to gain confidence in the foundations. Everything more complex was added piecemeal, one evaluator at a time.
The build: genealogy
Remember what we are actually doing here: building stuff out of other pieces of stuff. One of the most valuable things an MES owns over the long term is genealogy, which is the record of exactly which physical components went into each finished product. For a company as obsessed with hardware performance and quality as Base, that record is a gold mine. It is how you answer the question every hardware company eventually asks: what, exactly, is inside this unit?
Naturally, we made component installation a parameter too. An operator scans a serial number. The MES checks that the serial belongs to an acceptable part and carries no blocking quality checks, then records the component under the assembly being built. Because the database is centrally locking, a serialized component can never be consumed into two assemblies. And as with every other parameter, the result and the genealogy update land in the same transaction.

A few cases complicate the picture. A module we manufacture ourselves already has a component history of its own, so installing it attaches that entire existing tree to the new parent. Materials like adhesive are tracked by lot and quantity rather than by individual serial number, and one lot can feed many assemblies, with a separate record for each consumption. We need to be able to ask the question in both directions: what went into this battery, and where did the material from this lot end up?
(I could write a whole separate deep dive on units of measure, and on how exciting it was to write code that handles linear feet and fluid volumes of glue. Another post.)
Start of production
Once we were armed with process definitions, executions we could create and track, and genealogy we could record, we were ready to make some batteries. Very slowly, at first. We were still building the factory around ourselves (literally, we moved the entire factory software team to the middle of the production floor). Most of the equipment had not landed, and every build was carried out through NPI and manual processes.

In January 2026 we started building the MES web interface around the execution model. The first pages exposed parts and orders. Then came task results, quality checks and undo operations. My backend friends will no doubt assume that at this stage we were living life through a psql REPL. (It wasn't that bad.) But the time had come to build ourselves out of the system. Operators on the floor needed to inspect an assembly, understand why work was blocked, and record or correct work without anyone editing database rows. One of the most awesome experiences of my career was walking around our factory in those early days and seeing MES open on every second or third computer.

By May 2026 the factory reached the start of production. The software had grown from requirements and parts synchronization into a system that could represent an assembly's work, evaluate its results, preserve its genealogy and coordinate updates with the rest of the business.
Because the MES was the natural funnel from process definition to the factory floor, it quickly became the default home for all factory data. Since day one, not a single unit has left the factory without passing through it, and we hold a full history of every task completed, every parameter evaluated and every process on every piece of hardware Base has ever built.

We're just getting started
Owning the MES turned out to be worth more than the license fee we never paid. Because we wrote it, it is part of the Base stack and not a box bolted onto the side of it. It runs on the same cloud, speaks the same Protobuf and is maintained by engineers who sit in the middle of the production floor. When we want factory data to meet the rest of the company, we do not file a ticket with a vendor or wait for a connector.
The system we have described here is the simple one, on purpose. The next version is harder. We will have to think about sharding our database as our second and third factories come online. We have to go deeper, down into the edge compute and application. And our next products will arrive with bills of materials ten times the size of this one.
Then there is the number that keeps us honest. Over the next five to ten years, Base intends to build a million of these batteries. Every one of them will be defined, built, tested and traced by software we wrote ourselves, starting from an empty building and a room full of questions.
The textbook was wrong. Manufacturing was never solved. It was just waiting for people who wanted to work on it again.
Come help us build the next version.
About the Author
Allan Hamzic built software infrastructure for Base's first member, battery and factory. He is currently trying to solve the AI-energy crunch. Previously, he deployed novel spectral imaging systems and realtime audio decoders.



