11 Downloads Updated 1 year ago
Agronexus is a specialized AI model designed to provide agricultural recommendations for Kenya. It takes into account specific weather conditions, soil properties, and local agricultural knowledge to suggest suitable crops and farming practices.
Install Ollama: Follow the instructions at ollama.ai to install Ollama for your operating system.
Pull the Agronexus model:
ollama pull Cloudsurfer/agronexus
To start an interactive session with the model:
ollama run Cloudsurfer/agronexus
The model expects input in the following specific format:
You are an expert agricultural advisor specializing in Kenyan agriculture. It is [current date]. Given the following weather and soil conditions for [location], Kenya, provide a recommendation for one (1) distinct crop suitable for growing. The location has a [climate type] climate.
Weather:
- Current Description: [weather description]
- Current Temperature: [temperature]°C
- Average Annual Temperature (5-year): [average temp]°C
- Average Annual Precipitation (5-year): [average precipitation] mm
- 14-Day Forecast:
- Average Max Temperature: [max temp]°C
- Average Min Temperature: [min temp]°C
- Total Precipitation: [precipitation] mm
Soil Properties:
- clay: [percentage]%
- sand: [percentage]%
- silt: [percentage]%
- phh2o: [pH level]
- cec: [CEC value] cmol/kg
Consider the specific Kenyan climate, local soil composition, and pH level when selecting the crop and providing advice. Ensure the recommendation is tailored to the given conditions. Output the recommendation in the following JSON format ONLY!
You are an expert agricultural advisor specializing in Kenyan agriculture. It is 30 August 2024. Given the following weather and soil conditions for Nakuru, Kenya, provide a recommendation for one (1) distinct crop suitable for growing. The location has a semi-arid climate.
Weather:
- Current Description: partly cloudy
- Current Temperature: 23°C
- Average Annual Temperature (5-year): 20°C
- Average Annual Precipitation (5-year): 900 mm
- 14-Day Forecast:
- Average Max Temperature: 26°C
- Average Min Temperature: 15°C
- Total Precipitation: 25 mm
Soil Properties:
- clay: 30%
- sand: 45%
- silt: 25%
- phh2o: 6.5
- cec: 20 cmol/kg
Consider the specific Kenyan climate, local soil composition, and pH level when selecting the crop and providing advice. Ensure the recommendation is tailored to the given conditions. Output the recommendation in the following JSON format ONLY!
The model will return a JSON object with the following structure:
{
"Crop": "Recommended crop name",
"Planting Date": ["Primary planting window", "Secondary planting window"],
"Harvesting Time": ["Primary harvest time", "Secondary harvest time"],
"Farm Inputs": [
{"Type": "Input type", "Description": "Detailed description of input"}
],
"Best Care Methods": [
"Primary care method",
"Secondary care method"
],
"Cost Cutting Measures": [
"Primary cost-cutting measure",
"Secondary cost-cutting measure"
],
"Expected Yield": [
"Primary yield estimate",
"Secondary yield estimate"
],
"Market Potential": [
"Primary market information",
"Secondary market information"
],
"Environmental Impact": [
"Primary environmental impact",
"Secondary environmental impact"
],
"Crop Rotation Suggestions": [
"Primary rotation suggestion",
"Secondary rotation suggestion"
],
"Pest and Disease Management": [
"Primary pest and disease management strategy",
"Secondary pest and disease management strategy"
],
"Water Management": [
"Primary water management technique",
"Secondary water management technique"
],
"Soil Management": [
"Primary soil management practice",
"Secondary soil management practice"
]
}
To use the model in a Python script:
import json
import ollama
def get_agronexus_recommendation(location, climate, weather, soil):
prompt = f"""
You are an expert agricultural advisor specializing in Kenyan agriculture. It is 30 August 2024. Given the following weather and soil conditions for {location}, Kenya, provide a recommendation for one (1) distinct crop suitable for growing. The location has a {climate} climate.
Weather:
- Current Description: {weather['description']}
- Current Temperature: {weather['temperature']}°C
- Average Annual Temperature (5-year): {weather['avg_temp']}°C
- Average Annual Precipitation (5-year): {weather['avg_precipitation']} mm
- 14-Day Forecast:
- Average Max Temperature: {weather['forecast_max_temp']}°C
- Average Min Temperature: {weather['forecast_min_temp']}°C
- Total Precipitation: {weather['forecast_precipitation']} mm
Soil Properties:
- clay: {soil['clay']}%
- sand: {soil['sand']}%
- silt: {soil['silt']}%
- phh2o: {soil['ph']}
- cec: {soil['cec']} cmol/kg
Consider the specific Kenyan climate, local soil composition, and pH level when selecting the crop and providing advice. Ensure the recommendation is tailored to the given conditions. Output the recommendation in the following JSON format ONLY!
"""
response = ollama.chat(model='Cloudsurfer/agronexus', messages=[
{
'role': 'user',
'content': prompt
}
])
return json.loads(response['message']['content'])
# Example usage
location = "Nakuru"
climate = "semi-arid"
weather = {
"description": "partly cloudy",
"temperature": 23,
"avg_temp": 20,
"avg_precipitation": 900,
"forecast_max_temp": 26,
"forecast_min_temp": 15,
"forecast_precipitation": 25
}
soil = {
"clay": 30,
"sand": 45,
"silt": 25,
"ph": 6.5,
"cec": 20
}
recommendation = get_agronexus_recommendation(location, climate, weather, soil)
print(json.dumps(recommendation, indent=2))
For issues related to the Agronexus model, please contact me on X or LinkedIn. For Ollama-specific issues, refer to the Ollama documentation.
This model is licensed under the Apache 2.0 license. See the LICENSE file for more details.