← All case studies

AI product engineering · 2026

LeanManufacturing.mx: a consultancy platform that answers questions on its own

The platform for a Monterrey lean manufacturing practice: an open Spanish documentation corpus, a five-layer maturity self-assessment drawn from my own working paper, hybrid RAG over pgvector, and a public MCP server so agents can read it too.

5 min read

LeanManufacturing.mx: a consultancy platform that answers questions on its own

LeanManufacturing.mx is the platform for a lean manufacturing practice based in Monterrey that works with food, metalworking, and automotive plants. Its technical direction comes from Dr. Mohammad Reza Azarang Esfandiari, an industrial engineering professor at Tecnológico de Monterrey since 1986. Four decades of method existed. None of it was reachable by a plant manager at eleven at night, in Spanish, without booking a meeting first.

I built the platform that made it reachable: an open documentation corpus, two working tools, a retrieval assistant grounded in that corpus, and an MCP server so AI agents can read the same material a person reads.

The self-assessment is a paper, shipped

The five-layer maturity self-assessment: fifteen shop-floor questions, one level per layer

The centerpiece is an operational maturity self-assessment, and it is the most direct thing on the site: fifteen questions you answer from the floor, three per layer, across five layers — data, logic, interface, orchestration, feedback. Each layer gets the lowest level it actually meets. Your real capacity is the minimum across the five, not the average. If four layers are strong and one is weak, you are paying for capacity you cannot use, and the next investment belongs to the weak layer.

That is not a marketing device. It is Proposition 3 of a working paper I co-wrote on structural waste in digital operations — the weakest-layer constraint — turned into a ten-minute instrument a plant manager can run alone, plus a printable PDF checklist for a gemba walk.

The OEE calculator: availability, performance, and quality separated so the lowest component is visible

Next to it sits an OEE calculator that takes one real shift's numbers and separates availability, performance, and quality, so the component dragging the number down is visible rather than averaged away. It runs entirely in the browser: nothing about a plant's shift leaves the machine it was typed on.

Documentation as the product, not the brochure

The documentation corpus: six categories of lean method, open and citable

Forty-six documentation pages cover fundamentals, floor tools, flow and pull, measurement, problem solving, and structural waste in digital operations. Around them: fifty answered questions, a blog, and thirty-two consultancy pages by state, city, and industry. One hundred forty-seven URLs, all of it open, all of it citable.

That corpus is also the retrieval base. The Agente Lean widget answers questions against it using hybrid search over Neon Postgres with pgvector: 1536-dimension embeddings on an HNSW index, unioned with a Spanish-language full-text index, merged in a single SQL function. The embeddings are optional by design — without an OpenAI key the search falls back to the lexical index and every other part of the site keeps working. Generation runs on DeepSeek through an OpenAI-compatible interface, so the answering model is a swap, not a rewrite.

An MCP server, because agents read too

The public MCP server: lean tools exposed to any MCP-aware client, no key required

The site exposes a public MCP server over Streamable HTTP at /mcp, with no key and no token. Claude, ChatGPT, Cursor, or Codex can query the documentation, the blog, the questions, the consultancy services, and calculate OEE directly. Alongside it: /llms.txt and /llms-full.txt, a markdown version of every content page at /api/public/md/<slug>, and a machine-readable index at /api/public/contenido.json.

The reasoning is simple. In Spanish-language manufacturing, the person researching a problem increasingly is not a person — it is an assistant working on their behalf. A site that only renders HTML is invisible to that reader. This one is written to be quoted correctly by both.

Under the hood

TanStack Start v1 on React 19 and Vite, Tailwind v4, deployed to Vercel through the Build Output API. Neon serverless Postgres holds three tables: leads from the checklist and contact forms, tool and chat events that feed a private dashboard, and the document chunks behind retrieval.

Every database call happens on the server with parameterized SQL through a single server-only module. No environment variable carries a client-side prefix, none is read at module level, and the private panel sits behind its own key. Content security policy and HSTS are set in the SSR entry itself, so they apply identically in every environment rather than living in a platform config someone forgets to copy. Reindexing the corpus after a documentation change is one authenticated POST.

What it adds up to

A consultancy whose method used to travel by meeting now has a surface that works without one: a plant manager can self-assess in ten minutes, calculate their own OEE, read the method, and ask follow-up questions in Spanish — and an agent can do the same on their behalf, correctly attributed.

The theory that argues capacity is bounded by the weakest layer is now the thing that tells a plant which layer that is.