DEV Community

 Omkar Dhakane
Omkar Dhakane

Posted on Edited on

TrailScribe: Offline-First Naturalist Field Companion Powered by Local Gemma 2

Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass Submission 🌿

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass

TrailScribe 🌿 — An Offline-First AI Naturalist That Gets You Outside

The AI gets you outside. Then it gets out of the way.

Most nature-identification apps expect you to have a reliable internet connection and keep looking at your screen while exploring. Sharing precise locations of rare plants, fungi, and wildlife with centralized services can also expose sensitive habitats.

TrailScribe is an offline-first naturalist field assistant designed to help hikers, nature enthusiasts, amateur botanists, birders, and curious explorers observe the world around them—not spend their time staring at a phone.

It follows one simple philosophy: capture with your device, explore with your eyes, and keep your field notes private.

What I Built

TrailScribe helps people record, organize, revisit, and export nature observations—even when they're far from cellular coverage.

🌱 Touch Grass First

  • Pocket-friendly observation capture with tactile controls.
  • Voice-note and photo-based field logging, designed to minimize screen time.
  • Audio cues and haptic feedback to make interactions less screen-dependent.
  • Proximity alerts when you approach a previously recorded observation, where device and browser support allow it.

đź§  Local Ecological Reasoning

  • Uses Google Gemma 2 2B through local Ollama inference to turn natural-language field notes into structured ecological observations.
  • Extracts candidate species, common and scientific names, broad taxonomic groups, microhabitats, substrates, life stages, and abundance counts.
  • Falls back to an offline heuristic parser when the local model is unavailable.

🗺️ Your Data Stays With You

  • Stores field observations and associated media locally using IndexedDB through Dexie.js.
  • Includes offline-oriented mapping support with Leaflet.
  • Supports structured exports such as JSON-LD/Darwin Core, GeoJSON, and CSV for use in biodiversity workflows and GIS tools.

Imagine saying:

“Found bright orange shelf fungus about two meters up a damp, decaying log on a north-facing mossy slope.”

TrailScribe can turn that free-form note into a structured record with candidate identification and habitat details, ready for review and export. Species suggestions are candidates, not guaranteed identifications, and should be verified before being treated as scientific records.

Demo

🎥 Watch the TrailScribe walkthrough and demo

Code

🌿 Explore TrailScribe on GitHub

Built with:

  • Frontend: React, Vite, TypeScript, Tailwind CSS
  • Local AI: Google Gemma 2 2B via Ollama
  • Local persistence: Dexie.js and IndexedDB
  • Mapping: Leaflet
  • Offline interaction: Web Audio API and browser vibration support where available
  • Search: A lightweight in-browser vector similarity engine

How I Built It

The central design decision was to make local-first AI part of the product architecture, not just an optional feature.

1. Gemma as a local naturalist assistant

TrailScribe routes field-note transcripts through a model runner that can query Ollama's local generation API. A structured prompt asks Gemma to extract candidate species, taxonomic groups, microhabitat, substrate, life stage, and abundance information as JSON.

The result can then be mapped into fields suitable for biodiversity records. Because natural observations are often uncertain, the model output should be treated as a structured interpretation of the note—not as unquestionable scientific truth.

2. An offline fallback

A field assistant shouldn't become unusable just because a model service is stopped or a trail has no signal. TrailScribe uses a ModelRunnerInterface with a heuristic parser fallback, so basic field-note processing can continue without relying on a cloud AI endpoint.

3. Local storage and semantic search

Observations, voice notes, and photo assets are stored in the browser's IndexedDB database through Dexie.js. A lightweight TypeScript cosine-similarity engine supports local semantic-style retrieval without sending observation content to a remote search service.

4. Built for outdoor use

The interface uses a warm archival-vellum visual style, high-contrast elements, and tactile interaction cues. Leaflet provides mapping, while proximity calculations can trigger vibration feedback when a user nears a saved observation. Browser support and device permissions affect the availability of these capabilities.

5. Testing the field experience

The project includes a TypeScript swarm-testing simulator inspired by multi-agent behavioral testing. It models different kinds of field users—including alpine botanists, urban foragers, fungal observers, and backcountry trekkers—to exercise scenarios such as network changes, varied observation notes, and offline captures.

Why Does Open Innovation Matter?

Nature is everywhere, but reliable connectivity isn't. A field assistant that depends entirely on a hosted AI API can become unavailable exactly where it is most useful. It can also require users to send sensitive observations and location data to a third party.

Using an open-weight model like Gemma makes a different architecture possible:

  • Local inference: Ecological note processing can run on the user's own machine through Ollama, without requiring a hosted model API for that inference.
  • Privacy by design: Observation data can remain in local browser storage rather than being uploaded by default.
  • Resilience: A local heuristic fallback helps preserve basic functionality when the model runtime is unavailable.
  • Freedom to experiment: Developers can inspect, adapt, and evaluate the model-powered workflow rather than building around a closed endpoint.
  • A more accessible starting point: The project can be explored and extended by contributors interested in open-source AI, biodiversity, offline-first applications, and privacy-preserving software.

Open innovation is especially valuable here because the goal isn't to put another chatbot in front of a user. It's to make AI useful in the background—so people can pay more attention to the living world around them.

My Agent Session

Optional: Add a DevRelay session link or embed your saved agent session here if you have one.

Prize Categories

  • Touch Grass
  • Best Use of Gemma

TrailScribe is an ongoing project, and there's more to explore at the intersection of local AI, biodiversity, privacy, and outdoor computing.

Step outside. Record what you notice. Let the AI get out of the way. 🌿

Top comments (0)