I Made My Sump Pump Agentic

Todd Deshane · April 11, 2026 · 7 min read

Everyone is building agentic AI for code, email, and customer support. I built one for a sump pump.

Not as a joke. As a proof of concept for something much bigger: agentic AI that operates in the physical world.

My system observes sensor data from a $25 smart plug, reasons about it using a local 32B language model, correlates with weather and river data, makes autonomous recovery decisions through a tiered state machine, and alerts me only when it needs human judgment. It ran 97 autonomous recovery cycles last night while I slept. My basement stayed dry.

That's an agent. It just happens to live in my basement instead of my browser.

What Makes It "Agentic"

The word "agentic" gets thrown around a lot. Here's what I mean by it, applied to a physical system:

Typical Digital Agent

  • Observes: emails, tickets, code
  • Reasons: via LLM
  • Acts: sends email, writes code
  • Failure cost: embarrassment
  • Feedback loop: seconds

My Physical Agent

  • Observes: watts, temp, river levels
  • Reasons: via local Ollama (32B)
  • Acts: power cycles, duty cycles
  • Failure cost: $10,000+ flood
  • Feedback loop: minutes to hours

The key differences when your agent operates in the physical world:

  1. Actions are irreversible. You can undo a bad email. You cannot un-burn a motor or un-flood a basement.
  2. The environment is adversarial. Weather changes. Hardware degrades. Sensors lie. The physical world doesn't have an "undo" button.
  3. Latency matters differently. A chatbot can take 2 seconds to respond. A pump running at 500W with a stuck float has minutes before the motor overheats.
  4. Safety is not optional. You need hard constraints that no amount of LLM reasoning can override.

The Agent Architecture

I split the system into two layers that solve these problems:

Layer 1: The State Machine (Deterministic, Safety-Critical)

This is the "reflexes" of the agent. Hard-coded logic that runs deterministically:

Observe:  Pump drawing 500W for 3+ minutes? Float is stuck.
Decide:   Try power cycle (10s off, 10s on).
Act:      Power cycle via Shelly API.
Evaluate: Still stuck? Escalate to TIER 1 duty cycle.
Repeat:   Escalate through tiers. Never exceed safe motor temp.

No LLM in this loop. No probability. No hallucination risk. The state machine has exactly 7 states with defined transitions. It will never do something unexpected because it can't.

Design principle: In physical AI, the deterministic layer handles safety. The AI layer handles intelligence. Never mix them.

Layer 2: The AI Advisor (Probabilistic, Context-Rich)

This is the "brain" of the agent. A Qwen 32B model running locally via Ollama that fuses multiple data streams:

Every 5 minutes, the AI produces:

The AI never touches the pump. It only advises. If the AI hallucinates or crashes, the state machine keeps running. If the state machine enters a tier, the AI provides context about why (weather event? mechanical issue? sensor glitch?).

Why This Matters Beyond My Basement

This architecture, a deterministic safety layer + a probabilistic intelligence layer, is the pattern for all physical AI.

Self-driving cars do this: hard-coded collision avoidance (ABS, emergency braking) + neural network driving decisions. Industrial robots do this: safety PLCs + motion planning AI. My sump pump does it at the smallest possible scale.

The interesting insight: you can build this today with off-the-shelf components for under $50.

The components that make digital agents work (LLMs, tool use, memory, feedback loops) are the same components that make physical agents work. The difference is the stakes, and the architectural discipline required when mistakes cost $10,000 instead of an awkward email.

The Agentic Loop in Practice

Here's what happened last night, April 11, 2026:

03:12 AM - State machine detects stuck float (500W continuous > 3 min)
03:12 AM - Power cycle attempt: FAILED (float still stuck)
03:13 AM - Escalate to TIER 1 (60s ON / 15 min OFF)
03:13 AM - AI advisor: "Stream levels elevated. Recent rain.
           Weather risk score: 67/100. Pump is doing real work,
           not a false alarm."
03:28 AM - TIER 1 cycle 3: still stuck. Escalate to TIER 2.
04:15 AM - TIER 2 cycle 6: still stuck. Escalate to TIER 3 (max).
04:15 AM - AI advisor: "TIER 3 entered. Motor temp 38.4C (safe
           limit 45C). Mohawk at Fonda rising. Recommend continued
           operation. Manual intervention not required yet."
...
11:40 AM - TIER 3 cycle 97. Motor temp stable at 38.4C.
           Basement dry. Pump maintaining water level.
           AI advisor: "Quiet signal day. Stable operation."

97 autonomous cycles. Zero human intervention. No flood. No burned motor. The agent handled it.

What I'm Building Next

The sump pump is one sensor in one building. The same architecture scales to:

The thesis: every small business that depends on physical equipment, and can't afford enterprise monitoring, is a customer for this approach. A church with an aging boiler. An HVAC company with 50 service trucks. A bus parts distributor with a warehouse. The $1M-$5M businesses that Siemens and Honeywell don't serve.

The agentic AI revolution isn't just about chatbots and code assistants. It's about making the physical world intelligent, one sensor at a time.

Building physical AI?

I consult on edge AI architectures, sensor integration, and physical monitoring systems for small businesses.

See What We Build

Read the technical deep dive: The full architecture, state machine, and Ollama integration