Agronexus is a specialized Q4 AI model that provides personalized crop recommendations and farming advice tailored for Kenyan farmers, considering their unique climate, soil, and weather conditions.

7B

Updated 2 weeks ago

Readme

Agronexus: Agricultural Recommendation Model for Kenya (Ollama Version)

Overview

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.

Installation

  1. Install Ollama:
    Follow the instructions at ollama.ai to install Ollama for your operating system.

  2. Pull the Agronexus model:

    ollama pull Cloudsurfer/agronexus
    

Usage

Running the Model

To start an interactive session with the model:

ollama run Cloudsurfer/agronexus

Input Format

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!

Example Input

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!

Output Format

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"
  ]
}

Using in Python

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))

Model Limitations

  • The model’s knowledge is based on its training data and may not reflect very recent changes in agricultural practices or climate conditions in Kenya.
  • Recommendations should be validated by local agricultural experts before implementation.
  • The model may not account for all possible local variations in soil and microclimate conditions.

Ethical Considerations

  • Use the model’s recommendations as a starting point for agricultural planning, not as a definitive guide.
  • Validate recommendations with local experts and consider local knowledge and practices.
  • Be aware that the model’s suggestions may not account for all socio-economic factors that could affect agricultural decisions.

Troubleshooting

  1. If the model returns an error or unexpected output, ensure your input strictly follows the specified format.
  2. Check that you’re using the latest version of the Agronexus model.
  3. If issues persist, try restarting the Ollama service.

Support

For issues related to the Agronexus model, please contact me on X or LinkedIn.
For Ollama-specific issues, refer to the Ollama documentation.

License

This model is licensed under the Apache 2.0 license. See the LICENSE file for more details.