-
-
The live dashboard: the customer and two technicians on iMessage, with the board that decides who gets each job in the middle.
-
Customers text a photo of the problem to one number. No app, no account, no forms. Electron runs entirely over iMessage.
-
AI reads the photo, then a scoring formula ranks technicians on skill, distance, rating, free time and workload. Top match gets the offer.
Electron: Autonomous AI Dispatch for the Skilled Trades
The Problem
This summer, one of us worked as an assistant at a small contracting shop. When we asked the owner what slowed him down most, the answer wasn't the work. It was dispatch.
Every job starts the same way:
- A customer texts a photo: "water under my sink."
- Someone has to figure out what's actually broken, because most people can't tell a P-trap from a supply line.
- Someone has to decide who's skilled, who's close, and who's free, usually from memory.
- Someone calls plumbers one by one until one says yes.
- The plumber shows up and doesn't have the right part.
That someone is the owner. Instead of plumbing, he's dispatching.
The numbers back it up:
- Only 52% of calls to home service businesses reach a live person (Invoca, 2026 Home Services Benchmarks).
- 83% of consumers hire whoever responds first (Moneypenny / Censuswide, 2026).
- Small trade shops spend 15.4 hours a week on admin (HVAC Industry Pulse, 2025).
- About 1 in 4 field service jobs needs a second visit (Aquant, 2025 benchmark).
- Meanwhile, the average water damage claim is about $14,000 (Triple-I), and the clock is running while the customer waits for a callback.
Customers already text the shop, so getting the message was never the problem.
The Solution
Electron is an AI dispatcher that runs entirely inside iMessage, built on Photon 2.0. One photo in, a booked plumber out. No app, no forms, no phone tag.
The AI understands. Code decides. People approve.
Imagine this
- 11:02 PM: Maria texts a photo: "My kitchen pipes are leaking."
- About a second later: Gemini reads the photo: a leaking P-trap under the kitchen sink, high urgency. Maria's first reply is a safety step: "While you wait: close the shutoff valves under the sink by turning them clockwise."
- Instantly: Electron remembers Maria. A related job last August goes into the plumber's brief, and her saved address is used for matching.
- Seconds later: the ranking algorithm scores every plumber, and Marco ranks first. He gets the offer in iMessage: the photo, what the AI saw, likely parts with live prices, a quote, and why he was picked.
- Marco replies NO, and Dana gets the offer seconds later. She replies YES, and Electron sends her a picture of each part to grab on the way.
- Maria texts OK to the estimate. Electron books Dana's first open slot on her real Google Calendar, and only then shares Maria's number with her.
Nobody at the shop picked up a phone.

What Makes It Work
1. It reads the photo, not just the text
Gemini vision turns a blurry phone photo into a structured job: trade, issue, urgency, likely parts with confidence, and a description of what's visible. The board labels the photo with what the AI read. If the photo is unclear, Electron asks a question instead of guessing.

2. Safety comes first
When something is actively going wrong, the customer's first reply is what to do right now. For a gas smell, Electron never trusts the model: a hardcoded message tells the customer to leave the house and call the gas company or 911 from outside.
3. Matching is an algorithm, not an AI guess
Every plumber is scored on skill, distance, open time on their Google Calendar, rating and fair share, so the same person doesn't get every job. Every point is on screen, and every plumber is told why they were picked.

4. It runs a whole crew, not one conversation
Most agents talk to one person. Electron coordinates a customer, several plumbers and the owner at once. NO or no reply passes the job on within seconds. Plumbers can ask the agent about the job, and the customer approves the estimate before anyone rolls.
5. It remembers
Returning customers are recognized. Related past jobs go into the plumber's brief, and their address is reused.
6. It books the real thing
The customer's OK books the first open slot on the plumber's real Google Calendar. The customer's number is shared only after approval.

How We Built It
Messaging
- Photon 2.0 REST API with signed webhooks
- Idempotency keys, so a retry never double-texts
- A short merge window, because a photo and its caption arrive as two separate messages
AI layer (Google Gemini)
- Constrained structured output: the model has to fill in a Pydantic-validated schema, not write free text
- Separate Gemini agents for intake, message routing, a plumber assistant and job prep (causes, tools, parts plan)
- A model fallback chain: gemini-3.5-flash-lite, then gemini-3.1-flash-lite, then gemini-3.6-flash, with a keyword fallback underneath
Matching
A weighted score over every plumber with the required skill, using distance \( d \) in miles (haversine), rating \( r \), hours until their first free slot \( h \), and jobs taken in the last 24 hours \( n \):
$$ S = 30\,\sigma + 10\cdot\frac{r}{5} + 25\cdot\max!\left(0,\,1-\frac{d}{25}\right) + 20\,u\cdot\max!\left(0,\,1-\frac{h}{48}\right) + \max!\left(-15,\;15-6n\right) $$
Here \( \sigma = 1 \) for a specialist (\( \tfrac{2}{3} \) for a general plumber on drain, sewer or water-heater work) and \( u = 1.5 \) for urgent jobs. The last term is fair share.
Pricing
Labor comes from Bureau of Labor Statistics wage data for plumbers (SOC 47-2152, May 2025, 25th to 75th percentile for the local metro) times a stated \( 2.5\times \) overhead factor, plus parts. The low end only counts parts the model is at least 50% confident in:
$$ \text{Quote} = \Big[\,h_{\text{low}}\cdot 2.5\,w_{25} + \sum_{c_i \ge 0.5} p_i,\;\; h_{\text{high}}\cdot 2.5\,w_{75} + \sum_i p_i\,\Big] $$
Parts
Live Google Shopping prices via SerpAPI, with all parts looked up in parallel. An eBay Browse integration is built and waiting on API approval, and a hardcoded catalog backs both up. Links only: nothing is ever bought automatically.
Dispatch and scheduling
- A single state machine behind a lock: only one function can change a job's status, so a YES and a timeout can never both win
- Google Calendar API for real availability and booking
- Python, FastAPI, Supabase (Postgres), Pillow and pillow-heif for iPhone photos
The pipeline
Photon webhook → Gemini intake → safety check → parts + quote → ranking → offer → YES/NO → customer OK → Google Calendar
Challenges We Ran Into
1. Model availability. At times the newest Gemini models returned "high demand" errors or timed out on images. We built a fallback chain of three models plus a keyword fallback, so every job still gets triaged.
2. Messaging is messier than it looks. Photos and captions arrive separately, iPhone photos are often HEIC, and a shared line can only message people who texted it first. Each needed its own handling.
3. Race conditions. A plumber's YES can land at the same moment their offer times out. A lock and a single status function made that safe.
4. Trusting the model. Language models are overconfident when they state their own confidence (Xiong et al., ICLR 2024). So we cap any part size read from a photo at 70% unless it's clearly visible, label every part "likely," and never order automatically.
5. Three people, one dispatch loop. We agreed on shared data contracts up front and required an end-to-end smoke test to pass before every merge.
Accomplishments That We're Proud Of
- A complete loop from customer photo to booked Google Calendar event, running live over iMessage
- About a second from photo to diagnosis with our fast model
- Explainable dispatch: every plumber knows exactly why they got the job
- Safety first: the agent protects the customer's home before it dispatches anyone
- It degrades gracefully: model outages, timeouts and declines don't stop a job
What We Learned
The best agent isn't the one that does everything. People trust algorithms they can override (Dietvorst et al., Management Science, 2018). So the AI understands, code decides, and a person approves every step that matters.
Structured output turns a chatbot into a component. Once the model has to fill in a schema, everything downstream can rely on it.
Fallbacks are a feature. A business can't stop because one model is overloaded.
The hardest part isn't the AI. It's the people. Customers, plumbers and an owner all text differently, at different times, about the same job. Coordinating them is the real product.
What's Next
- A voice line, since many customers still call
- Proactive check-ins: "Is the sink still dry?" two days later, with an automatic return visit if not
- More trades: the trade is just a field, so electricians are next
- A pilot with the shop that inspired this
Electron: photo in, plumber dispatched.
Built With
python · fastapi · gemini · photon · imessage · supabase · postgresql · google-calendar · serpapi · pillow