🪨 RIVERLITHOSCOPE: An AI Geological Advisor Built with Gemini
Source: Dev.to
DEV Education Track – Build Apps with Google AI Studio
Submission: RiverLithoscope – an AI‑powered geological advisor
What I Built
RiverLithoscope is 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.
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.
- Identify the host rock type and any cross‑cutting features (e.g., veins).
- Describe the mineralogy, texture, and weathering patterns.
- 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 – Leveraged Gemini’s ability to analyze visual data (uploaded field photos) together with text prompts.
- System Instructions – The detailed persona and task list ensured the output was structured and professional.
- Grounding & Heuristics – A “sensitivity slider” lets users balance strict, factual analysis against more speculative, exploratory interpretations.
- Frontend Integration – Built with React and TypeScript, the app calls the Gemini API and displays results in a clean, card‑based UI.
Demo
GitHub Repository:
Step 1 – The App Interface
The main dashboard provides access to Teaching, Professional, and Exploration modes. The analysis‑sensitivity slider (default Balanced at 60 % strict) lets you 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 processes the image through Gemini’s multimodal capabilities, combining visual data with local heuristics and the selected sensitivity setting.
Step 4 – Results with Confidence Scores
The analysis completes with remarkable detail! Gemini correctly identified the host rock as “mafic to ultramafic” (likely basalt), recognized the hydrothermal vein with iron‑oxide staining, and provided a Placer Probability Score of +55 % (Moderate). The output includes:
- Identification Summary
- Transport History
- Mineral Assessment
- Economic Significance
All sections are accompanied by confidence levels.
The final output demonstrates real‑world value: the site is classified as a “Primary Source Zone,” and while the outcrop itself isn’t a placer, the iron oxides act as pathfinder minerals for precious metals downstream—exactly the actionable insight field geologists need.
My Experience & Key Takeaways
Working through this track with Google AI Studio was incredibly rewarding. Here are my main takeaways:
-
Prompt Engineering is Everything
- The quality of the AI’s output depended almost entirely on prompt clarity. Giving the model a specific persona (“Senior Field Geologist”) and a detailed task list transformed generic responses into highly specialized, useful analyses. Adding “confidence levels” made the tool trustworthy.
-
Multimodal Power is Stunning
- The most surprising moment was seeing Gemini correctly interpret a complex geological image—identifying a cross‑cutting hydrothermal vein, its iron‑oxide staining, and linking that observation to broader concepts like “pathfinder minerals” for exploration. It wasn’t just describing the picture; it was providing geological context.
-
Grounding & Heuristics Add Flexibility
- The sensitivity slider lets users decide how conservative or speculative the AI should be, which is crucial when balancing scientific rigor with exploratory brainstorming.
-
Frontend Integration is Straightforward
- Using React + TypeScript to call the Gemini API and render results in a card‑based UI was smooth. The modular design makes it easy to extend the app (e.g., adding offline caching or batch processing).
-
Balancing Speculation with Ethics
- Implementing the “analysis sensitivity” slider taught me how to design human‑AI interaction where the tool can be both a strict tutor and a creative exploration partner. It reinforced the importance of a Geological Safety & Ethics section—AI must be used responsibly, respecting local laws and environmental safety.
-
From Concept to Deployed App
- Integrating the Gemini API into a React app was seamless. 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.



