DEV Community

Cover image for TerraQuest: An Offline-First AI Forager That Forces You to Touch Grass
Lakshya Mulchandani
Lakshya Mulchandani

Posted on AI-assisted

TerraQuest: An Offline-First AI Forager That Forces You to Touch Grass

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

What I Built

TerraQuest: The AI Forager is an offline-first, local-inference scavenger hunt designed to turn passive screen time into active outdoor botanical exploration.

Most wellness or fitness apps paradoxically increase screen time by demanding users log meals, monitor dashboards, or scroll through social feeds. TerraQuest does the exact opposite: it uses AI to deliberately dismiss you from the screen. The Hacktoberfest Week 1 theme challenges developers to build something where the open pieces get people outside, explicitly making the screen the shortest part of the user experience. TerraQuest enforces this by refusing to progress the application state until you are physically outside interacting with nature.

  • How It Works
  1. The Foraging Bounty: When a user initiates a session, a local LangGraph state machine powered by an open-weight model generates an outdoor botanical objective (e.g., "Find a plant with serrated leaves" or "Locate a specimen from the Rosaceae family near the ABV-IIITM Gwalior campus").

  2. Phone in Pocket: The user locks their device and steps outside to locate the target on a local trail or campus path.

  3. Zero-Cloud Verification: Upon finding a specimen, the user photographs it. A pre-trained Vision Transformer (ViT) classifies the plant locally. The LangGraph agent verifies whether the detected species satisfies the bounty criteria, logs the successful find, and returns a brief fact before immediately prompting the user to put the phone away for the next discovery.

  • Who Is It For?
  1. Developers and students fatigued by prolonged desk work looking for structured, gamified outdoor micro-breaks.

  2. Trail hikers and nature enthusiasts exploring areas with intermittent or zero cellular connectivity.

  3. Open-source engineers interested in hybrid cloud/local AI deployments.

Demo

Here is the game loop in action, showing how TerraQuest takes you from a screen prompt, out into the world, and onto the next natural discovery:

Phase 1: Receive Your Bounty
When you open TerraQuest, the Game Master initializes your quest by issuing a specific botanical task. For example, you must find a "plant from the Rosaceae family" (such as roses, brambles, or wild plums with 5-petalled flowers and toothed leaves). The interface reminds you that the models operate on your device. At this point, your task is to put your phone away, get outside, and start foraging!

Phase 2: Capture and Judge
Once you hunt down a candidate in the wild, you capture its image ensuring a single, clear leaf or flower fills the frame. You upload the photo and hit "Judge my find" to let the edge vision models analyze it.

Phase 3: Verify and Learn
The model identifies the exact species—in this case, Rosa pouzinii— and evaluates whether it matches your assigned bounty. On a successful match, the gamified state updates, increasing your Score and Streak. You get an interesting botanical insight about your find, followed immediately by your next outdoor target: a weed with serrated leaves. Now, back outside you go!

Live Deployment: https://terraquest-forager.onrender.com/

Usage: You can access the deployed web application to receive your foraging bounties. To experience the full privacy-first architecture, the backend inference engine is designed to be spun up on your local machine.

Code

Repository: https://github.com/LakshyaMulchandani/terraquest-forager

License: Permissive open source (Apache 2.0 stack)

How I Built It

TerraQuest was designed around a zero-dataset-creation, local-first inference architecture, bridging a cloud-hosted UI with edge-based AI reasoning:

  • Agent State Machine (LangGraph): Rather than using an unconstrained, rambling chatbot, LangGraph tracks the strict multi-step lifecycle of the outdoor quest (INIT_QUEST → AWAITING_CAPTURE → CLASSIFY_SPECIMEN → EVALUATE_MATCH → COMPLETE_STEP). If the user fails, the agent routes them back to the capture state.

  • Open-Weight Reasoning (Qwen 2.5 via Ollama): The reasoning agent runs locally via Ollama (http://localhost:11434). It orchestrates the challenges, evaluates the botanical classifications against the bounty rules, and keeps its responses intentionally brief to limit interaction time.

  • Computer Vision Pipeline (Hugging Face Transformers): Rather than collecting and training a custom vision dataset from scratch, the system integrates a pre-trained Vision Transformer (ViT) model for botanical identification, processing image inputs directly via Python.

  • Backend & Deployment (FastAPI & Render): The application relies on a modular FastAPI backend. I utilized Render to host the agent's front end and API routing layer, ensuring high uptime for the web interface while allowing the heavy lifting of inference to remain decentralized.

Why Does Open Innovation Matter?

  1. True Offline Independence on the Trail: The outdoors and cellular broadband are often mutually exclusive. Closed, proprietary APIs fail the moment you lose LTE/5G reception on a hiking trail. Open-weight models and local inference enable intelligence at the network edge without cloud reliance.

  2. Preserving Nature Without Data Harvesting: Users should not need to trade their camera rolls, telemetry, or GPS locations to third-party data brokers just to identify local flora. Open models running on user hardware guarantee total privacy.

  3. No Vendor Lock-in or Token Metering: Relying on closed commercial endpoints subjects developers to rate limits, arbitrary API deprecations, and per-token fees. Open-source foundations allow anyone to inspect, modify, fork, and self-host the entire stack without external dependencies.

Prize Categories

  • Hacktoberfest Open-Source AI Challenge Week 1 (Touch Grass): Overall Challenge Category.

  • Best Use of Render: I deployed the project on Render to host the agent's front end and serve the API layer.

Top comments (0)