AI agent
The AI that actually understands your plants
PlantHub's AI is a Spring AI agent with explicit tools, hard safety limits, and persistent memory. It does not guess — it reads your sensors, checks the forecast, recalls similar past situations, and explains every decision in plain English.
What the AI can do
- Decide when to water, vent, light, mist, shade, or heat — within safety limits you control.
- Skip watering when rain is in the forecast, or pre-water before a heatwave.
- Recommend automation rules tuned to your plant species and sensor history.
- Answer questions about your garden via chat ("why are my basil leaves drooping?") with sensor history and learned context.
- Generate a one-paragraph "garden overview" summarizing what's thriving, what needs attention, and what it plans to do next.
How decisions are made
On each evaluation, the agent loads structured context — current sensor readings, recent history, weather forecast, plant profile, learning profile, and similar past situations retrieved via pgvector semantic memory — and is allowed to call a small set of tools:
getLatestSensorData,getSensorHistory— read measurements.getWeatherForecast— read OpenWeatherMap forecast for the device location.getNodeConfig,getPlantProfile— read device + species ideal ranges.sendActuatorCommand— issue a command to the ESP32 over MQTT, bounded by hard safety limits.
Safety guards
The AI cannot exceed your configured limits. These are enforced inside the command pipeline, not just in the prompt:
- Max watering duration per command (default 120 seconds).
- Per-actuator cooldown (default 300 seconds).
- Daily evaluation cap (default 4 per device per day) to prevent runaway LLM spend.
- Capability validation — the agent cannot fire an actuator the device did not declare on boot.
- Range bounds checking on every parameter.
Auditability
Every command the AI issues is logged with its full chain of reasoning — the sensor snapshot it saw, the weather it considered, the past situations it recalled, and the literal LLM output. You can review the full history on the device detail page, and the model is forced to surface its rationale up front.
Backend
The agent runs on Spring AI and is configured to use Anthropic Claude by default. OpenAI and Ollama backends are also supported — see the API reference for the relevant configuration properties.