What is SmartPlant? โ
SmartPlant is a Node.js library that treats a plant as something to be measured and asked, rather than something to be guessed about. It reads ordinary environmental sensors, the plant's own electrical signals, and โ with an LED used as a probe rather than as a lamp โ the answers it gives back.
It is not a plant monitor. It joins a plant and a computer into a functional symbiont โ a cyborgplant โ with shared perception, memory, reasoning, voice and the ability to act.
Its organising rule is a refusal: nothing is inferred from data that is not there. A missing sensor blocks a conclusion instead of being replaced by a default, a low-confidence estimate loses its authority to change anything, and every refusal names both the reason and the instrument that would lift it.
npm install smartplantimport { createPlant } from 'smartplant'
const plant = await createPlant( {
name : 'Ivy',
species : 'Monstera deliciosa',
sensor : 'mock', // no hardware needed
ai : { provider : 'ollama' }, // or gemini / openai / claude / grok
memory : { path : './ivy.json' },
units : 'metric', // or 'imperial'
} )
await plant.read()
console.log( plant.status() )
// ๐ 84% | Temperature: ๐ก๏ธ 21.6ยฐC | Humidity: ๐ง 58.9% | Soil moisture: ๐ง 62.1% | Light: ๐ 326luxThe twenty-three layers โ
The spine โ nothing runs without these โ
| Layer | What it does | Why it matters |
|---|---|---|
| ๐ก Sensors | Ten pluggable drivers behind one read() contract | Your hardware, or none at all |
| ๐พ Memory | Persistent readings, care log, species profile, and what the system worked out about itself | Advice builds on history, and the history survives a restart |
| ๐ซ Internal states | Five qualitative estimates of what the plant is doing, not what surrounds it | The system stops seeing only sensor numbers |
| ๐ Co-adaptation | One door every action goes through, and a record of when its own refusals were wrong | The system can be wrong about itself and find out |
| ๐ฆฟ Body | Multirate fusion, reflexes, safety limits, personalization | Autonomy that cannot kill the plant โ see Symbiosis |
Reading the plant โ
| Layer | What it does | Why it matters |
|---|---|---|
| ๐งฌ Signals | Electrophysiology: action and variation potentials, circadian rhythm | The plant's own electrical voice |
| ๐ช Self-reference | Electrome fingerprint, internal clock, two-site coherence, VPD-aware blue | Judged against itself, not a population average |
| ๐ฌ Spectral | ๐ต๐ข๐ด LED as a probe, not illumination | The plant is interrogated, not just listened to |
| ๐ Vision | Classical phenotyping, ONNX models, PlantCV bridge, thermal canopy | See wilting hours before you notice it |
Looking after it โ
| Layer | What it does | Why it matters |
|---|---|---|
| ๐ง Watering | Volume from the pot, fraction from the archetype, duration from a measured pump | A dose it can defend, and a check that the water arrived |
| ๐ชด The pot | Whether the container is running out, and moving to a bigger one | The pot is part of the body, and it stops fitting |
| ๐ Experience | A ledger of what resolved each problem, against the base rate of doing nothing | It reuses what worked, without inventing what did not |
| ๐ Self-correction | Prediction error, identity drift, decaying priors, response hysteresis | It finds out when it is the thing that is wrong |
Knowing whether it works โ
| Layer | What it does | Why it matters |
|---|---|---|
| ๐ฉป Diagnosis | 40 checks over everything wired up, each ending in something to do | Know it works before walking away |
| ๐ฉบ Self-check | Weekly and monthly reviews, plus a technical inspection of the instrument | It watches its own trajectory, and its own sensors |
| ๐ฅ Dashboard | The plant in a browser: vitals, activity, and what has no sensor | All of the above, visible without writing code |
Talking, and to whom โ
| Layer | What it does | Why it matters |
|---|---|---|
| ๐ง Knowledge | Ontology, forward-chaining reasoner, semantic recall | Conclusions you can audit, not just trust |
| ๐ค AI | Seven providers, structured output, offline fallback | Your model, your keys, your privacy |
| ๐ฃ Voice | Five first-person personas, emoji scales, ten languages | It talks to you, it doesn't report at you |
| ๐จ Colony | Conversation between plants, 73 skills, and delivery that survives a link failing | They talk to each other, and only about what they measure |
| ๐งฌ Inheritance | Directed transfer of validated priors between individuals | A new plant starts with what the last one learned |
Once it can move โ
| Layer | What it does | Why it matters |
|---|---|---|
| ๐ก Space | WiFi presence and a lidar scan, without a camera and without a map | It knows if you are in the room, and how far the neighbour really is |
| ๐ Navigation | Constraints a robot stack cannot know, over a delegated ROS 2 planner | A pot is not a delivery robot |
Every layer works alone. They compose.
Requirements โ
Node.js 18+ and nothing else. npm i smartplant installs zero dependencies โ the library imports nothing outside Node itself. chalk and enquirer are optional and only make the CLI prettier; without them it runs in plain text and says so. serialport, mqtt and onnxruntime-node are optional peers loaded on demand; Python and ffmpeg are needed only by the tiers that use them.
