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

  1. Clone the repository and set your working directory to the llm folder.
  2. Install Python 3.11+.
  3. Create and activate a virtual environment:
python3.11 -m venv myenv
source myenv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file with your API credentials:
TAVILY_API_KEY="tvly-*****"
LANGSMITH_API_KEY="lsv2_*******"
OPENAI_PROJECT_API_KEY='sk-******'
LANGSMITH_PROJECT="SCADAgri-Visualization"
OPENWEATHERMAP_API_KEY='*************'
  1. Run the agent (Chainlit interface):
chainlit run sensor_chat_supervisor_agent.py -w --port 8000
  1. 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:

  1. Start the LangGraph development server:
langgraph dev
  1. Open http://127.0.0.1:2024 to view the agent graph.
  2. Navigate to LangSmith Studio to test and evaluate the agent.

(Nsanzimfura et al., 2025)

References

  1. Capstone
    SCADAgric: Agentic Farm Monitoring & Intervention System
    D. Nsanzimfura, C. Kwizera, G. Igwegbe, and Martins Awojide
    2025
    CMU Master’s Capstone



    Enjoy Reading This Article?

    Here are some more articles you might like to read next:

  • Google Gemini updates: Flash 1.5, Gemma 2 and Project Astra
  • Displaying External Posts on Your al-folio Blog
  • a post with image galleries
  • a post with tabs
  • a post with typograms