SCADAgric: Agentic Farm Monitoring
An agentic farm monitoring system combining IoT simulation, ThingsBoard, Chainlit, and LangGraph to enable real-time sensor monitoring, automated control, alerting, data visualization, and LLM-powered decision-making through a multi-agent architecture.
Team: D’Amour Nsanzimfura · Claude Kwizera · George Igwegbe · Martins Awojide
Resources: Slides · Demo Video · GitHub
Project Structure
-
cloud-integration/— Codebase for the initial cloud setup and deployment. -
llm/— Codebase for running the large language model (LLM) components. -
simulated-farm-setup/— Code for setting up the simulated farm model and integrating with ThingsBoard. -
farm-eda/— Exploratory data analysis (EDA) for the Nyagatare Farm in Eastern Province.
To run the project, first complete the setup for ThingsBoard and the IoT Simulator. Once those are configured, you can proceed to set up the agent services and the Flask integration app.
Initial Setup — ThingsBoard and IoT Simulator
Agent Services & Flask Integration
- Clone the repository and set your working directory to the
llmfolder. - Install Python 3.11+.
- Create and activate a virtual environment:
python3.11 -m venv myenv
source myenv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Create a
.envfile with your API credentials:
TAVILY_API_KEY="tvly-*****"
LANGSMITH_API_KEY="lsv2_*******"
OPENAI_PROJECT_API_KEY='sk-******'
LANGSMITH_PROJECT="SCADAgri-Visualization"
OPENWEATHERMAP_API_KEY='*************'
- Run the agent (Chainlit interface):
chainlit run sensor_chat_supervisor_agent.py -w --port 8000
- Run the Flask integration app (embeds the Chainlit chat inside ThingsBoard):
python3 app.py
Open http://localhost:5000 in your browser to see the full interface.
Performance and Evaluation
To test and evaluate agent behaviour using LangGraph and LangSmith:
- Start the LangGraph development server:
langgraph dev
- Open
http://127.0.0.1:2024to view the agent graph. - Navigate to LangSmith Studio to test and evaluate the agent.
References
Enjoy Reading This Article?
Here are some more articles you might like to read next: