DEV Community

Cover image for 🪨 RIVERLITHOSCOPE: An AI Geological Advisor Built with Gemini
Muhammad Yasin Khan
Muhammad Yasin Khan

Posted on

🪨 RIVERLITHOSCOPE: An AI Geological Advisor Built with Gemini

Education Track: Build Apps with Google AI Studio

This post is my submission for DEV Education Track: Build Apps with Google AI Studio.

What I Built

I set out to build RiverLithoscope, an interactive web app that acts as an AI geological advisor. It performs source-to-sink analysis on geological images, helping users—from students to exploration geologists—interpret rock specimens, hydrothermal veins, and river contexts.

The Core Prompt Used in Google AI Studio:
I engineered a detailed system instruction to guide the model's analysis.The prompt was structured to make the AI act like a Field Geologist, focusing on:

"You are a senior Field Geologist specializing in Petrology and Economic Geology. Analyze the provided image. First, identify the host rock type and any cross-cutting features (like veins). Describe the mineralogy, texture, and weathering patterns. Then, interpret the geological context: is this a bedrock outcrop, a clast, or part of a river system? Assess its significance for placer deposits or indicator minerals. Structure your output with clear headings for 'Identification Summary,' 'Transport History,' and 'Economic Significance.' Provide a confidence level for your assessment."

Features Utilized:

· Multimodal Reasoning: I used Gemini's ability to analyze visual data (uploaded field photos) combined with text prompts.
· System Instructions: The detailed persona and task list ensured the output was structured and professional.
· Grounding & Heuristics: The app includes a "sensitivity slider" that adjusts the heuristic filter, allowing users to balance between strict, factual analysis and more speculative, exploratory interpretations.
· Frontend Integration: The app, built with React and TypeScript, calls the Gemini API to display the analysis in a clean, card-based interface.

Demo

🔗 GitHub Repository: https://github.com/rajamuhammadyasinkhan2019-lgtm/River-Lithoscope

Here's a walkthrough of using RiverLithoscope in the field:

Step 1: The App Interface
The main dashboard provides access to teaching,professional, and exploration modes. The analysis sensitivity slider (currently set to Balanced at 60% strict) allows you to control how speculative versus conservative the AI's interpretation will be.

Step 2: Capturing Geological Data
I uploaded a field photograph of a dark,fine-grained rock with a prominent reddish-orange vein. The interface allows you to capture both images and field observations before initiating cloud analysis.

Step 3: Cloud Analysis in Progress
After clicking"START CLOUD ANALYSIS," the app begins processing the image through Gemini's multimodal capabilities, combining the visual data with local heuristics and the sensitivity settings.

Step 4: Results with Confidence Score
The analysis completes with remarkable detail!Gemini correctly identified the host rock as "mafic to ultramatic" (likely basalt), recognized the hydrothermal vein with iron-oxide staining, and even provided a Placer Probability Score of +55% (Moderate). The output includes identification summary, transport history, mineral assessment, and economic significance—all with confidence levels.

The final output demonstrates the app's value for real-world exploration: it correctly classified the site as a "Primary Source Zone" and noted that while the outcrop itself isn't a placer, the iron oxides act as "pathfinders" for precious metals downstream—exactly the kind of actionable insight Field Geologists need.

My Experience & Key Takeaways

Working through this track with Google AI Studio was an incredibly rewarding experience. Here are my main takeaways:

  1. Prompt Engineering is Everything: The quality of the AI's output depended almost entirely on the clarity of the prompt. I learned that by giving the AI a specific persona ("Senior Field Geologist") and a detailed task list, the analysis went from generic to highly specialized and useful. Refining the prompt to include "confidence levels" was a game-changer for making the tool trustworthy.
  2. Multimodal Power is Stunning: The most surprising moment was seeing Gemini correctly interpret a complex geological image—identifying a cross-cutting hydrothermal vein and its iron-oxide staining—and then connecting that observation to broader concepts like "pathfinder minerals" for exploration. It wasn't just describing the picture; it was reasoning about its geological significance.
  3. Balancing Speculation with Ethics: Implementing the "analysis sensitivity" slider was a fun challenge. It taught me how to design human-AI interaction where the tool can be both a strict tutor and a creative exploration partner. It also reinforced the importance of the app's Geological Safety & Ethics section—AI is a powerful tool, but it must be used responsibly, respecting local laws and environmental safety.
  4. From Concept to Deployed App: Integrating the Gemini API into a React app was smooth. The AI Studio provided a great sandbox to test the prompt, and exporting it to a functional web app made the entire "build" process tangible and fast.

This project has completely shifted how I think about building with AI. It's not just about getting an answer; it's about designing a conversation and a tool that augments human expertise. I'm excited to continue refining RiverLithoscope and explore its potential in educational and field settings.

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.