๐ŸŒ TrueEarth: Real-Time Global Event Intelligence


๐ŸŒŸ Inspiration

TrueEarth emerged from recognizing a critical gap: during natural disasters or global emergencies, scattered data floods in from multiple sources โ€” but turning this raw data into timely, understandable intelligence is still hard. I wanted an AI-powered system that automates this process end-to-end, so organizations and the public can respond faster and smarter.


๐Ÿš€ What it does

TrueEarth is a global event intelligence platform that continuously collects, processes, and enriches data about:

  • ๐ŸŒ‹ Earthquakes (USGS)
  • ๐Ÿ”ฅ Wildfires (FIRMS)
  • ๐Ÿ“œ Historical disasters (EM-DAT)

It goes beyond raw numbers: by combining a real-time Retrieval Augmented Generation (RAG) pipeline with Googleโ€™s Gemini models, TrueEarth explains whatโ€™s happening, where, and why it matters โ€” all in clear language via an interactive web interface and an AI-powered climate assistant.


๐Ÿ—๏ธ How I built it

TrueEarth runs as a scalable, secure, microservices stack on Google Cloud Run, with zero manual server maintenance. The architecture includes:

โœ… Next.js Frontend โ€” An interactive web app with dynamic maps, event feeds, and an AI chat UI. โœ… Rust Backend โ€” A fast, lightweight REST API that serves the frontend, handles validation, and coordinates the AI pipeline. โœ… Go AI Orchestrator โ€” The core intelligence service, handling data fetching, embeddings, vector search, and real-time calls to Google Vertex AI for answers.


โš™๏ธ Technical details

  • Generative Model: gemini-2.5-flash-preview-05-20 โ€” used for fast, cost-effective RAG completions and conversational context.

  • Embedding Model: text-embedding-004 โ€” used to embed raw event descriptions and queries, enabling similarity searches when context is sparse.

  • Vector Database: MongoDB Atlas with custom rTree spatial indexing for geospatial lookups (country-level) to supplement embedding-based similarity.

  • Deployment: All services containerized and deployed on Cloud Run, with IAM-secured connections.

  • Data Sources:

    • USGS for global seismic activity
    • FIRMS for wildfire detection (satellite-based)
    • EM-DAT for historical disaster data
  • APIs: REST/JSON for internal orchestration (due to gRPC + Cloud Run challenges), with future support for pure gRPC once networking issues are resolved.


โšก๏ธ Technical challenges and learnings

โœ… Country-Level Mapping: FIRMS and USGS lack explicit country fields. Early attempts at embedding-based geolocation were imprecise. I solved this with an rTree spatial index, enabling fast point-in-polygon tests to classify coordinates by country on the fly.

โš ๏ธ State-Level Precision: Achieving state/province-level detail with local-only geo shape data wasnโ€™t feasible within resource constraints. I plan to integrate a managed GIS API to close this gap.

โš ๏ธ VPC Connectors & gRPC on Cloud Run: Despite following best practices, I hit issues with VPC Connector quotas, cold starts, and networking timeouts, which complicated secure internal gRPC calls. I mitigated this by using REST for now, with a clear migration path to fully private gRPC in the future.


๐Ÿ† Accomplishments Iโ€™m proud of

โœ… Designed and deployed a resilient, autoscaling, multi-language microservices system solo. โœ… Integrated Gemini Pro/Flash for real-time RAG with high accuracy and speed. โœ… Combined embedding similarity and geometric spatial search for robust country-level mapping. โœ… Maintained strong performance and security with IAM, Secret Manager, and best-practice containerization. โœ… Learned to adapt quickly to infrastructure limits โ€” rethinking networking design to ensure reliability.


๐Ÿ“š What I learned

  • Cloud Runโ€™s strengths and gotchas: When VPC Connectors and gRPC are involved, serverless trade-offs get real.
  • LLM prompt engineering: Crafting clear system and response instructions to enforce domain boundaries (climate-only answers).
  • Combining embeddings + geometry: Knowing when to trust vector similarity vs. needing hard geo boundaries.
  • Cross-language orchestration: Rust for safe, blazing-fast HTTP; Go for concurrency and AI workflows.

๐Ÿ”ฎ Whatโ€™s next for TrueEarth

โœ… More data feeds: Live weather alerts, social media signals, local government APIs. โœ… Deeper visualizations: Richer timelines, historical trend analysis, and user-controlled overlays. โœ… Custom user alerts: Real-time notifications based on user-defined event types and regions. โœ… State-level geo accuracy: Integrate high-resolution GIS shape files or managed geo APIs to answer state/province-level queries robustly. โœ… Streamlined gRPC: Switch to Cloud Runโ€™s gRPC support when VPC and cold start issues are ironed out.


โœ… Summary

TrueEarth bridges fragmented global event data and actionable insights through a practical blend of cutting-edge LLMs, embeddings, and efficient spatial search โ€” all in a secure, cloud-native microservice architecture. Iโ€™m committed to pushing it forward and making real-time global event awareness accessible to everyone.


Built With

  • Google Vertex AI Gemini Pro/Flash
  • text-embedding-004
  • Next.js
  • Rust (Axum)
  • Go (gRPC + MongoDB)
  • MongoDB Atlas + rTree
  • Google Cloud Run
  • Google Secret Manager, IAM

Built With

Share this project:

Updates