Skip to content

iyiola-dev/agri-alert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AgriAlert — Multi-Agent Crop & Market Intelligence System

A multi-agent AI system where farmers describe crop problems in plain language and four specialized AI agents collaborate concurrently to diagnose, recommend treatment, estimate costs, and advise on timing.

Built with Python, Google ADK, Gemini API, and Flask. Presented at GDG Ilorin Build with AI 2026.

Architecture

User Query
    │
    ▼
┌─────────────────────┐
│ agrialert_orchestrator │ ← Root ADK Agent
│ (root_agent)          │   delegates via sub_agents
└──────────┬────────────┘
           │  ADK sub_agents
  ┌────────┼────────┬──────────┐
  ▼        ▼        ▼          ▼
Diag    Treat    Market    Weather
Agent   Agent    Agent      Agent
  │        │        │          │
  └────────┼────────┼──────────┘
           ▼
   Synthesized report
   (final response from root agent)

Agents

Agent Role What it returns
Diagnosis Identifies disease/pest from symptoms Disease name, confidence, symptoms matched
Treatment Recommends organic + chemical remedies Treatment options, application method
Market Estimates costs for inputs Product names, price ranges (NGN), where to buy
Weather Advises on treatment timing Best application time, seasonal advice
Orchestrator Delegates to sub-agents, synthesizes results Farmer-friendly report with all sections

Quick Start

1. Clone and install

git clone https://github.com/YOUR_USERNAME/agrialert.git
cd agrialert
pip install -r requirements.txt

2. Set your Gemini API key

Get a free key from AI Studio:

export GOOGLE_API_KEY="your-key-here"

3. Run

python app.py

Open http://localhost:8080 in your browser.

Google Cloud Shell

If using Cloud Shell, use Web Preview on port 8080 after starting the server.

Project Structure

agrialert/
├── agents/
│   ├── __init__.py
│   └── agents.py          # 4 specialist ADK agents + orchestrator
├── templates/
│   └── index.html          # Frontend with agent pipeline visualization
├── agrialert-multi-agent/  # Generated codelab (hosted on Netlify)
├── app.py                  # Flask server
├── requirements.txt
├── agrialert-codelab.md    # Google Codelab source (claat format)
└── README.md

Key Design Decisions

Why ADK? Google ADK provides declared Agent objects, native sub_agents delegation, built-in session management (InMemorySessionService), and an async Runner — so we don’t have to manually manage agent calls, routing, or state.

Why separate agents instead of one big prompt? Each agent has a focused system instruction, making outputs more reliable and the system easier to debug and extend.

Why does the orchestrator synthesize? The root agent delegates to each specialist via sub_agents, then combines their outputs into a single farmer-friendly report — all within ADK’s event-driven loop.

Extending

  • Add image upload for crop photos (Gemini Vision)
  • Add agent-to-agent communication — let the Treatment Agent read the Diagnosis Agent’s output
  • Add ADK tools (@tool decorated functions) so agents can call real APIs for live weather and market data
  • Replace InMemorySessionService with DatabaseSessionService for persistent memory
  • Use ADK’s ParallelAgent wrapper for true parallel agent execution

Tech Stack

  • Python 3.10+
  • Google ADK (google-adk)
  • Google Gemini API (google-genai)
  • Flask
  • HTML/CSS/JS (no framework)

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors