How enkiponics/smartcityfarmagent works
SmartCityFarm Agent is an aquaponics analysis and recommendation PoC. Sensor data is unified and regularized; separate workflows provide LSTM forecasts, Bayesian risk classification, and plant-disease detection. The agent can load pipeline artifacts, add that context to a user query, and request recommendations from OpenRouter. Users can access this through the CLI/Python API or the FastAPI dashboard. The dashboard also exposes plots, status, and data summaries. Workflow-to-artifact links are documented in the README; unsampled workflow details are not inferred.
Main entry points: agent.py Agent and context loading · data Analysis artifacts · dashboard.py FastAPI endpoints · data_input Unified sensor data
Components 15
Sensor preparation
- Sensor CSVs
pipelines/data/data_input - Data homogenization
pipelines/utils/data_prep.py - Unified sensor data
pipelines/data/data_input
Analysis workflows
- LSTM forecasting
pipelines/lstm_wf.py - Bayesian classification
pipelines/bn_wf.py - Plant disease detection
pipelines/yolo_wf.py - Analysis artifacts
pipelines/data
Recommendation agent
- Agent and context loading
agent.py - Recommendations
agent.py - CLI entry
agent.py - Python API
agent.py
Dashboard
- FastAPI endpoints
dashboard.py - Web interface
dashboard.html
Other components
- User
- OpenRouter LLM
Connections 21
- Sensor CSVs → Data homogenization: reads and merges
pipelines/utils/data_prep.py - Data homogenization → Unified sensor data: writes datasets
pipelines/utils/data_prep.py - Unified sensor data → LSTM forecasting: trains and forecasts
pipelines/lstm_wf.py - Unified sensor data → Bayesian classification: classifies sensor data
- Sensor CSVs → Plant disease detection: analyzes plant image
- LSTM forecasting → Analysis artifacts: writes forecasts
- Bayesian classification → Analysis artifacts: writes classifications
- Plant disease detection → Analysis artifacts: writes detections
- Analysis artifacts → Agent and context loading: loads pipeline context
agent.py - User → CLI entry: asks question
README.md - User → Python API: calls agent_chat
README.md - User → Web interface: submits query
README.md - Web interface → FastAPI endpoints: calls API
- FastAPI endpoints → Agent and context loading: runs analysis
dashboard.py - CLI entry → Agent and context loading: invokes chat
README.md - Python API → Agent and context loading: invokes chat
README.md - Agent and context loading → OpenRouter LLM: sends chat request
agent.py - OpenRouter LLM → Agent and context loading: returns response
agent.py - Agent and context loading → Recommendations: returns recommendations
agent.py - FastAPI endpoints → Web interface: serves interface
dashboard.py - FastAPI endpoints → Analysis artifacts: reads plot files
dashboard.py