EXPERIMENTS • Dec 5, 2026 • 8 Min Read

Lab Notes: Running EmbeddingGemma 2 on a Factory Floor (Without Cloud APIs)

Running EmbeddingGemma 2 offline on a factory floor: 256-D MRL vectors in IndexedDB, LAN FastAPI server, multi-angle photo search, and zero cloud bills.

A couple of weeks ago I started messing around with a problem that looks boring on paper until you actually stand inside an industrial storeroom.

Picture a mid-sized edible oil solvent extraction plant at 2:00 AM. An extractor pump starts leaking hexane. A technician pulls off a worn 45mm mechanical seal, walks into the MRO store with oily hands, and asks the night storekeeper for “extractor pump ka seal.”

Nobody knows the ERP item code. Half the guys call a stainless-steel filter screen “jali”, the other half call it “bleacher mesh”, and the purchase department ordered the exact same seal six months ago under “45mm Fluoroelastomer Pump Seal” instead of “45mm Viton Mechanical Seal”—so it's sitting in a completely different rack under General Stores while the plant waits.

When Google DeepMind dropped EmbeddingGemma 2 under Apache 2.0, I wanted to see if a single unified multimodal embedding model (text, images, and audio in one shared vector space) could actually solve this in a real offline-first web app—with zero cloud API bills.

Here is what I built in my lab, what broke along the way, and the architecture that actually held up.

Why a Unified Vector Space Matters Here

Normally, if you want photo search + voice search + fuzzy text search, you end up gluing together three different pipelines: a Whisper model for speech-to-text, a CLIP model for images, and a separate text embedder for descriptions. That's a nightmare to maintain on a local plant PC.

EmbeddingGemma 2 puts all three modalities—a 270M text backbone, a 170M vision encoder, and a 300M audio encoder—into one 768-dimensional vector space. Even better, it supports Matryoshka Representation Learning (MRL), which means you can chop the 768-D output down to 256 dimensions and L2-normalize it without losing much retrieval quality.

Storage & Latency Math // Why IndexedDB Is Enough
  • 256 floats × 4 bytes = 1 KB per vector.
  • For a 30-SKU test catalog, the entire vector index in browser IndexedDB is roughly 30 KB.
  • Even at 5,000 spare parts with 3 photo angles each, the whole vector database is still only ~20 MB—and a brute-force dot product in JavaScript across 5,000 normalized vectors takes under 5 milliseconds.

You don't need Pinecone. You don't need Qdrant. You just need IndexedDB and a for loop.

The First Architectural Reality Check: Browser vs. Store PC

My first instinct was to run the entire ONNX model inside the browser tab using transformers.js and WebGPU.

That works fine for the text backbone (~175 MB in 4-bit quantization). It falls apart the moment you think about the hardware people actually use in a factory storeroom: a ₹12,000 budget Android tablet with 3 GB of RAM and spotty Wi-Fi. Loading 740M parameters (text + vision + audio) inside Chrome on that tablet is a fast way to crash the tab.

So I split the architecture into a hybrid local-LAN setup:

  1. The Store Desktop PC (every plant store already has one sitting at the counter) runs a tiny FastAPI server (embed_server.py) with sentence-transformers hosting google/embeddinggemma-2 on port 8080.
  2. Tablets and phones on plant Wi-Fi send photos, audio clips, or text queries to the Store PC over the local network—zero internet, zero cloud cost, ~150ms response time.
  3. Offline Fallback: If Wi-Fi drops or the PC reboots, the PWA automatically drops back to a deterministic 256-D local synonym/token vector + Fuse.js inside the browser. The storekeeper can still issue parts and scan bin QRs without losing a beat.

One Photo Is Not Enough (Learned the Hard Way)

In a clean demo, one studio photo per spare part looks great.

Sample 45mm Viton mechanical seal reference photo
Reference part: 45mm Viton mechanical seal captured for multimodal catalog indexing.

On a real plant floor, a technician is holding a greasy seal sideways under dim yellow lighting. A single front-facing reference image misses too often when the angle changes.

So I updated the IndexedDB schema so every SKU holds an array of imageVectors[] alongside its textVector. When a storekeeper receives a delivery or creates a new part, they can snap 3 quick angles:

  1. Front / full part
  2. Side / bore / thickness profile
  3. Box or stamped code close-up (like 22220 EK)

At query time, the ranking function simply takes the maximum cosine similarity across the text vector and all stored angle vectors.

Visual search matching a 45mm Viton seal to its rack bin
Multimodal visual search matching a 45mm seal photo to primary bin R01-B02 while surfacing the duplicate SKU in General Stores (R07-B01).

When you test a 45mm seal photo against the catalog, it immediately pulls up the primary SKU (R01-B02) at 85–90% match—and interestingly, it also surfaces the duplicate SKU sitting in General Stores (R07-B01).

Stopping Duplicate Buying Before the PO Is Raised

That side effect turned out to be the most valuable part of the whole experiment.

Because EmbeddingGemma 2 understands that “Fluoroelastomer” and “Viton” live in the same neighborhood—and “60 Mesh Filter Leaf” sits right next to “Bleacher Jali”—I wired the same similarity check into the New Part / Purchase Indent form.

If someone tries to create a new SKU for a part that already exists in another rack, a red Duplicate Blocker banner fires immediately showing the existing bin location and live stock count. Managers also get a 1-click Merge SKUs view to collapse duplicate racks into one primary SKU.

Catalog hygiene and duplicate blocker view
Duplicate Blocker warning in the New Part / Purchase Indent flow with 1-click Merge SKUs support.

Two Practical Details That Actually Matter on a Plant Floor

1. Don't hide out-of-stock (Qty = 0) parts from AI search

My first thought was: “If stock hits zero, filter it out of search.” Bad idea.

If a technician searches for a 25mm steam trap and it disappears because stock is zero, they assume the store doesn't carry it and raise a brand-new duplicate SKU. Instead, I kept Qty = 0 items visible in search with the Issue button disabled and a red Reorder Alert badge.

On the flip side, when a part is permanently scrapped (for example, spares left over from a decommissioned boiler), clicking Scrap / Retire soft-archives the SKU, deletes its vector from IndexedDB so AI never recommends it again, and logs a RETIRE entry in the Stock Ledger for accounting.

2. Printable Bin QR Stickers

Typing with oily fingers is miserable. I added an offline qrcode sheet generator so the storekeeper can print A4 sticker sheets by plant zone and tape them straight onto the physical bins. Scanning R02-B01 opens the 10-second Issue/Receive drawer directly for that part.

Offline printable A4 Rack and Bin QR label sheet
Offline A4 Rack & Bin QR sticker sheet generator for 10-second floor issue and receive workflows.

Giving Management What They Actually Care About

Technicians care about finding the right bin in 10 seconds. Plant heads care about cash trapped on shelves.

Using the exact same local IndexedDB store, I built a Control Cockpit that rolls up four live INR numbers:

  • Total Inventory Value
  • Cash locked in Dead Stock (zero movement for >24 months)
  • Cash locked in Obsolete Assets (decommissioned equipment)
  • Active Reorder Alerts (restricted to Critical/High/Standard tiers so low-value clutter doesn't spam the alert list)
Working capital control cockpit
Control Cockpit tracking total inventory value, dead stock (>24 months), obsolete assets, and critical reorder alerts in real time.

Every table exports to CSV in one click for Tally/ERP reconciliation.

One Bug Worth Mentioning

While testing the PWA outside my dev environment, Chrome threw React's classic Invalid hook call / Cannot read properties of null (reading 'useState') error.

Turned out my own Service Worker (sw.js) was caching Vite's pre-bundled react chunk in dev mode—so after I installed qrcode, Vite re-bundled dependencies and the browser ended up executing two different copies of React at the same time. The fix was simple: only register the Service Worker in production builds (import.meta.env.PROD), explicitly bypass Vite's /@ and /node_modules/ paths in sw.js, and add resolve.dedupe: ['react', 'react-dom'] in vite.config.js.

What I'd Try Next

I also built a small 2D PCA Vector Space Explorer tab inside the app so I can visually plot Hinglish queries ("Extractor pump ka seal", "60 mesh jali") as a star on a 2D scatter plot and watch which SKUs cluster together. Seeing duplicate SKUs land almost pixel-for-pixel on top of each other makes it dead simple to explain embeddings to non-technical plant leadership.

Lab Takeaway // Right-Size the Stack

If you're experimenting with EmbeddingGemma 2 for real-world industrial or retail inventory: don't force the whole model into a cheap mobile browser, and don't over-engineer the vector DB. A local desktop PC running FastAPI over LAN + 256-D MRL vectors in IndexedDB gives you offline reliability, zero cloud bills, and sub-second multimodal search on hardware the factory already owns.

Companion Business Essay: Want the plant leadership and working-capital perspective? Read .

#embeddinggemma-2 #local-ai #vector-search #indexeddb #offline-first #industrial-mro
visibility 1
Allied Signal // Partner Network
Verified Sponsor
CloneVoice.ai

CloneVoice.ai

State-of-the-art neural voice cloning and speech synthesis. Replicate human vocal timbre, cadence, and emotion with pinpoint fidelity.

SYNTHESIZE open_in_new

Signal Feedback

No signals yet. Be the first to transmit.