Building the software behind Base's factory

Allan Hamzic

Software infrastructure

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
2024United States 17.2%China 28.1%Japan 4.9%Germany 5.0%

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
Shares of global manufacturing value added, by year, in percent.
YearUnited StatesChinaJapanGermany
198224.2%–11.8%7.5%
198325.5%–12.8%7.3%
198427.9%–13.5%6.6%
198528.1%–14.0%6.8%
198625.2%–17.3%8.5%
198723.9%–18.4%9.1%
198823.5%–19.8%8.7%
198923.8%–19.2%8.4%
199022.8%–18.5%9.8%
199122.0%–20.3%9.8%
199222.1%–20.7%10.1%
199323.4%–22.7%9.1%
199423.7%–22.7%8.9%
199522.7%–22.8%9.2%
199623.4%–20.4%8.8%
199725.0%–19.0%8.0%
199826.8%–17.5%8.4%
199927.2%–18.9%8.0%
200027.6%–19.9%7.1%
200128.0%–17.5%7.5%
200227.6%–16.3%7.7%
200325.7%–16.0%8.4%
200422.2%8.6%14.3%7.8%
200521.8%9.5%13.3%7.4%
200621.3%10.7%11.7%7.4%
200719.5%12.3%10.6%7.5%
200817.6%14.5%10.6%7.3%
200918.1%17.5%10.7%6.4%
201016.9%18.4%11.2%6.3%
201115.8%20.4%10.2%6.5%
201216.0%22.2%10.2%6.0%
201316.2%23.7%8.1%6.1%
201416.1%24.8%7.5%6.2%
201517.4%26.0%7.4%5.6%
201617.1%25.5%8.2%5.8%
201716.1%26.4%7.7%5.8%
201816.1%27.6%7.4%5.7%
201916.4%27.5%7.5%5.5%
202016.0%28.5%7.5%5.4%
202115.2%30.5%6.6%5.1%
202216.6%29.5%5.2%4.7%
202317.2%27.9%5.3%5.1%
202417.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:

HA resiliant network (cloud like)secure factory network (edge like)what was builtwhat to buildthis connectionshould be ableto drop andthe factorymust not stopencrypted tunnel over WANresults of tasksdispatch instructionsLANmultitudeof localprotocolsHMIanalogERP (self-hosted or external)business planning and inventory:what to buy, what is in stock, what to buildingressingressMEStracks the work done on each individual unit;connects the plan to evidence of its executiondatabaseedge applicationspeaks local protocolsmaintains local stateUIcontrols(the domain of controlsengineering)
The plan flows down from the ERP; the evidence of what was actually built flows back up through the MES.

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:

AWS (Base's existing cloud infrastructure)MES backend (Go)Process definitions, executions, paramsSyncs parts and orders with the ERPPostgresCentrally locking source of truthProcess versions as JSONB, genealogyweb UI served from the cloudStation 1Browser and barcode scannerNo local software or stateStation 2Browser and barcode scannerNo local software or stateStation NBrowser and barcode scannerNo local software or state
Everything stateful lives in the cloud; a station is just a browser pointed at it.

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

invoked by a demand signalstepsargumentsscanProcess definitionProtobuf config, editable as JSONName + version, content-hashed, JSONB in PostgresExecutionA running instance of the program, on a real linePinned to one definition versionPart (work in progress)Scanned on the floorResolves to its executionTaskOne step in the process (a function)Blocked until its critical params have resultsParameterA named, typed data field on a task (its argument)Measurement, operator check or installed component
A scanned part leads to its execution, and from there, to the exact process version it is following.

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.

Screenshot of the MES process config editor: a list of stations on the left and a graph of task nodes and their dependencies on the right.
How a process engineer sees their process-configs.

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.
Illustration of three steampunk badgers at three stations, each working on a battery pinned to a different process version.
Steampunk badgers working from multiple configs on the same line at Base factory.

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.

Screenshot of an execution order in the MES: task completion at 100% above a parts tree listing each installed component with its part number, identifier and quantity.

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.

Photo of a touchscreen at a station on the factory floor showing an early version of the MES operator interface.
Early version of the HMI (human-machine interface) used in C pre-production.

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.

The MES web interface on desktop, showing an assembly's task timeline, beside two phone screens of the mobile MES.

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.

Photo of the factory team gathered on the production floor, one person holding up a laptop showing a dashboard.
Breaking a production record in summer 2026, on the simple Grafana dashboard we built at the very beginning, with its one big green number.

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.

Follow what we’re building

Deep dives into the engineering, hardware, software, and systems behind Base.

205 E Riverside Dr, Suite 100,
Austin, TX 78704

Existing members:

Chat with us from your Base Power app or dashboard


Base Power, Inc | Base Texas REP, LLC (PUCT #10338) | Base Retail, LLC (ICC #26-0121) | Base Power Development, LLC (CT HIC.0707034)

Product availability, system configurations, and pricing vary by state.

Registered Retail Electric Provider (REP) with the Texas Public Utility Commission (PUCT), PUCT License #10338. Registered Alternative Retail Electricity Supplier (ARES) with the Illinois Commerce Commission (ICC), License #26-0121.

You can obtain important standardized information that will allow you to compare this product with other offers. Contact Base Texas REP, LLC, 512-518-1009, and www.basepowercompany.com.

Base Retail, LLC is not the same entity as your electric delivery company. You are not required to enroll with Base Retail, LLC. Beginning on October 1, 2026, the electric supply price to compare is 10.103¢/kWh. The electric utility electric supply price will expire on May 31, 2027. The utility electric supply price to compare does not include the purchased electricity adjustment factor. For more information go to the Illinois Commerce Commission's free website at plugin.illinois.gov

Base Retail, LLC is an independent seller of electric power and energy service certified by the Illinois Commerce Commission. Base Power is not representing, endorsed by, or acting on behalf of any utility, utility program, consumer group, or governmental body.

For more information about choosing an electricity supplier in Illinois, visit the Illinois Commerce Commission's free website at plugin.illinois.gov

In Colorado, Base offers home battery equipment and installation. Base is not an electric utility or a retail electric supplier in Colorado.

In Connecticut, Base offers home battery equipment and installation. Base is not an electric utility or a retail electric supplier in Connecticut. Base Power Development, LLC is a registered home improvement contractor in Connecticut, registration #HIC.0707034.

Base Power, Base Pace, and the Base logo are trademarks of Base Power Company. All other trademarks are the property of their respective owners. Products and services are subject to terms, conditions, and availability.

Accredited by the Better Business Bureau (BBB).

*Savings may vary. The percentage shown is an estimate, not a guarantee. Actual savings depend on, but are not limited to, your home's energy use, local weather, your rate plan, and current energy prices.

Base Power Development, LLC battery systems are certified under standards UL 1973, UL 1741, UL 9540, and UL 9540A for safety and performance.

AICPA SOC for Service Organizations

Built in Austin, TX