Logo Lanfrica

johnmwangimegwe/kenya-climate-agent

Domain:

climategeospatial

Record type:

softwareproject
Creator:
joh
Host:
Reasoning Over Earth Engine: An AI Agent for Kenya's Climate Risk # **🌍 Reasoning Over Earth Engine: An AI Agent for Kenya's Climate Risk** Ask a question : *"Which counties in Kenya face the highest flood risk this season, and who is most exposed?"* , and get a grounded, ranked, explainable answer drawn from satellite data, population exposure, and authoritative Kenyan documents. This project is an **open replica of the Gemini-powered Geospatial Reasoning pattern announced at Google I/O 2026**. It runs on **Gemini 3.5 Flash** and the **free Earth Engine tier** , it is *not* Google's gated Geospatial Reasoning agent, but it demonstrates the same architecture, end to end, on Kenyan data. --- ## **Overview** A natural-language question is decomposed by a Gemini planner into a tool plan. An orchestrator runs the tools, each an expert "sub-agent", and a fusion layer synthesizes a grounded answer: - **Knowledge Retrieval (RAG)**: retrieves Kenyan climate documents with sources - **Earth Engine**: flood (Sentinel-1 SAR), rainfall (CHIRPS), elevation (SRTM) - **Population**: exposed population per county (WorldPop) - **Risk Scoring**: a transparent, auditable weighted score (no ML) Everything degrades gracefully: with no API key or Earth Engine auth, the agent still runs using deterministic fallbacks, so it never hard-fails in a demo. ## **Architecture** ``` Question β”‚ β–Ό Gemini 3.5 Flash (planner.py) β”‚ structured JSON plan β–Ό Orchestrator (orchestrator.py) β”‚ dispatches tools (sub-agent pattern) β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β–Ό β–Ό β–Ό β–Ό search_knowledge get_earth_engine_layers get_population_ compute_risk_ (RAG / FAISS) (Sentinel-1/CHIRPS/SRTM) exposure score β”‚ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β–Ό Fusion (fusion.py, Gemini 3.5 Flash) β”‚ ranked + explained + cited β–Ό Answer β†’ Visualization (viz.py) β†’ Streamlit UI ``` ## **I/O 2026 …