🛡️ TerraSentinel: Autonomous Multi-Agent Ecological Defense

🌟 Inspiration

On a Tuesday at 2:14 AM, a VIIRS satellite detects a "minor" thermal spike in an Ivory Coast elephant corridor. In standard systems, this is a pixel on a map that nobody sees until sunrise. By then, 500 hectares of primary rainforest are gone, and a keystone population is displaced.

Environmental incident detection often fails in this final mile. This scenario inspired TerraSentinel — an autonomous multi-agent framework that transforms reactive environmental monitoring into proactive sovereign defense. It turns raw geospatial signals into verified, actionable field decisions in minutes, not hours.

🚀 What it does

TerraSentinel is a 5-Agent AI Reasoning Engine powered by Gemini 3.1 Flash-Lite that orchestrates a "kill chain" for ecological threats:

  • 🔭 Ecological Watcher: Monitors live NASA FIRMS telemetry, detecting thermal and acoustic anomalies with 99% spatial accuracy.
  • 🧪 Biotic Reasoner: Synthesizes raw anomaly metrics with historical ecosystem data (via ChromaDB) to formulate a detailed causal hypothesis (e.g., "Savannah Brush Clearing vs. Wildfire").
  • ⚖️ Adversarial Verifier: Red-teams every detection against the raw metrics to prevent AI hallucinations, ensuring zero-false-positive alerts and generating strict confidence scores.
  • 🗺️ Intervention Planner: Translates complex reasoning into simple, automated 5-step tactical response protocols for local ranger units.
  • 📡 Regional Command: The orchestrator that batches 10+ regional incidents into a single unified context window, optimizing for massive scale.

Key Innovation: We fuse the extreme speed of Gemini 3.1 Flash-Lite with a localized vector-database history. This allows the system to process multi-incident regional briefings and detect anthropogenic clearing patterns hours before they escalate, abstracting the complex data into a single-click deployment for the end user.

🛠️ How it was built

  • Backend: Python + FastAPI + Regional Command Architecture (Omni-Batching)
  • Frontend: React 19 + TypeScript + Deck.gl (3D Geospatial Bio-HUD)
  • AI Engine: Gemini 3.1 Flash-Lite (Causal Reasoning & Orchestration) + Gemini Embeddings (Historical RAG)
  • Geospatial: MapLibre GL + OpenFreeMap (High-fidelity dark-mode tiles)
  • Database: SQLite (Separated raw telemetry vs. causal insights) + ChromaDB (Vector Store for ecological history)

🚧 Challenges I ran into

  • API Throughput & Resilience: Gemini's 15 RPM free-tier limit required building a custom Sequential Throttling & Batching Engine to maintain live polling. We also built a dual-path fallback system so the pipeline still produces usable tactical steps even if the AI hits a rate limit.
  • Geospatial Complexity: Rendering 1,000+ real-time thermal points on a 3D globe in React 19 required deep optimization of Deck.gl layers to prevent frame-rate drops.
  • Post-Vite Configuration: Integrating Tailwind 4 with the new @tailwindcss/vite compiler required rewriting the entire CSS pipeline for the latest build specs.
  • Structured AI Outputs: Ensuring five separate agents consistently passed strictly formatted JSON back and forth (handling markdown block stripping) without breaking the application state.

🏆 Accomplishments I'm proud of

  • Transparent Chain-of-Thought: Every intervention shows the AI's "internal logic" stream in the Reasoner panel, ensuring human operators trust the system's math.
  • Actionable Abstraction: Successfully translating a massive web of satellite telemetry and historical data into a single UI button click—automatically drawing a containment radius and prompting "Deploy Ground Patrol."

💡 What I learned

  • Long Context Matters: Feeding 5 years of regional fire history into ChromaDB enables Gemini to easily distinguish between "Controlled Farming" and "Illegal Clearing." RAG is incredibly effective for geographical intelligence.
  • Multi-Agent Robustness: A single model can hallucinate a cause; a 5-agent chain that adversarially verifies itself is significantly more reliable for high-stakes operational environments.
  • Visualizing the Unseen: Environmental data shouldn't be hidden in gray spreadsheets. By creating a high-performance, visceral HUD, I make the health of our planet impossible to ignore, fostering a deeper emotional and tactical connection to the ecosystems I protect.

🔭 What's next for TerraSentinel

  • Gemini 3.1 Vision: Direct analysis of Sentinel-2 satellite imagery to detect illegal logging trucks and deforestation lines in real-time.
  • Acoustic Edge Integration: Connecting live forest microphone arrays to detect chainsaw frequencies and heavy machinery using Gemini's audio processing.
  • Ranger App Integration: Direct Push Notifications to ground units via Telegram/WhatsApp APIs the moment an intervention protocol is verified.
  • Carbon Credit Oracle: Automated verification for high-integrity carbon offset projects.

TerraSentinel — Sovereignty for the Planet. Intelligence for the Future.

Built With

Share this project:

Updates

Submission history