AI-powered soil-to-market platform for farmers in Kenya
# Trinity-agrisynk-Kenya-
AI-powered soil-to-market platform for farmers in Kenya
## Overview
Trinity Agrisynk is an AI-assisted soil-to-market platform that helps Kenyan farmers make better decisions by combining simple soil indicators, crop & livestock guidance, and basic market calculations.
This repository now includes a digital advisory module covering:
- Maize
- Poultry (Broiler, Improved Kienyeji, Layers)
- Dairy (milk production, fodder, feeding, pest & disease management, husbandry)
- Beans
- Azolla (aquaculture feed)
- Fish farming
- Regenerative agriculture
- Agroforestry
The advisory can deliver real-time SMS messages to farmers using a configurable SMS provider (example implementation uses Twilio).
## Features
- Topic-based advisory templates and simple rule engine
- Immediate SMS delivery via Twilio (configurable with environment variables)
- Flask HTTP endpoint to request and send advice in real time
- CLI usage for quick testing
## Files added
- `agrisynk.py` — small demo for soil fertilizer and yield estimation
- `advisory_engine.py` — advice templates and logic for topics listed above
- `sms_service.py` — thin wrapper to send SMS via Twilio (falls back to stdout when not configured)
- `server.py` — small Flask app exposing `/send_advice` to request advice and send SMS
- `requirements.txt` — Python dependencies
## Installation
Requires Python 3.8+.
```bash
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```
## Configuration (Twilio)
Set these environment variables if you want real SMS delivery via Twilio:
- `TWILIO_ACCOUNT_SID`
- `TWILIO_AUTH_TOKEN`
- `TWILIO_FROM` (a Twilio phone number in E.164 format, e.g. +12025551234)
If these are not provided the service will print the SMS contents to stdout so you can test locally.
## Usage
1) Run the HTTP server to accept send requests:
```bash
export FLASK_APP=server.py
flask run --host=0.0.0.0 --port=5000
```
2) Request advice (example with curl):
```bash
curl -X …