Inspiration Farming in the Western Cape is a vital part of the local economy and culture, but it faces significant threats from a changing climate and resource scarcity. We were inspired by the daily struggle of farmers who are required to make multi-million Rand decisions about water usage and pest control with immense amounts of data at their fingertips but no clear guidance. They are, in essence, drowning in data but starving for actionable, decisive recommendations. This challenge—bridging the gap between raw data and informed action—was the core motivation for building the Agri-Intel Agent.

What it does The Agri-Intel Agent is an autonomous AI agronomist designed to provide farmers with decisive recommendations. It cuts through the noise of complex variables by combining real-time data from weather and satellite APIs with historical knowledge stored in a knowledge base. The agent performs a multi-step analysis, using its historical context to find similar situations from the past, and then synthesizes its findings into a single, actionable alert. For example, instead of simply presenting a weather forecast and satellite imagery, it might tell a farmer: "Begin preventative spraying on Block C within 48 hours" due to a high risk of a powdery mildew outbreak.

How we built it We built the Agri-Intel Agent using a modern, agentic architecture. The core of our system involves a workflow that:

Ingests real-time data from external weather and satellite APIs.

Fuses this data with our extensive historical knowledge base, which is powered by TiDB Serverless.

Utilizes TiDB’s powerful vector search to find historical patterns and similar situations. We encode current data points and compare them to a large history of past events to identify hidden correlations.

Employs a Large Language Model (LLM) as the reasoning engine to chain these insights together and formulate the final, actionable advice.

Challenges we ran into One of our primary challenges was integrating disparate data sources smoothly. Connecting to different APIs and ensuring the data was structured correctly to be stored in our TiDB knowledge base required careful planning. Another significant hurdle was perfecting the vector search to produce meaningful and relevant historical comparisons. We had to experiment with different data encoding methods to ensure the patterns found by the search were truly insightful and not just noise. Finally, fine-tuning the LLM to output a clear, decisive, and reliable recommendation—rather than a vague summary—was a continuous process of refinement.

Accomplishments that we're proud of We are particularly proud of building a functional agentic workflow that goes beyond a simple data dashboard. The ability to synthesize complex, multi-variable data into a single, definitive recommendation is a significant accomplishment. We are also proud of our innovative use of TiDB Serverless and its vector search capability, which was instrumental in giving our agent the crucial historical context it needed to provide truly intelligent advice. This approach represents a real-world, high-impact solution that contributes to both higher agricultural efficiency and environmental sustainability.

What we learned Building this project taught us a lot about the power of an agentic architecture and how to effectively combine structured database capabilities with the reasoning power of an LLM. We learned that vector search isn't just a buzzword; it's a powerful tool for finding patterns in large datasets, a capability that is essential for building an intelligent and autonomous system. We also learned valuable lessons in data integration and the importance of a clear, actionable output for end-users.

What's next for Agri-Intel Agent Our next steps for the Agri-Intel Agent include expanding its capabilities to support a wider range of crops and agricultural regions. We plan to integrate more data sources, such as on-farm IoT sensors, to provide even more granular and precise recommendations. We also want to develop a more interactive user interface that allows farmers to track the agent's reasoning process and provide feedback to improve its accuracy over time.

Built With

  • blinker
  • click
  • colorama
  • external-apis-(for-live-data)
  • flask
  • itsdangerous
  • jinja
  • llm-(large-language-model)
  • markupsafe
  • openai-(implied-by-the-use-of-llm-as-a-reasoning)
  • python-(implied-by-the-use-of-flask-and-the-python-libraries)
  • tidb-(database)
  • tidb-serverless
  • vector-search-(a-feature-of-tidb)
  • werkzeug
Share this project:

Updates